/* =========================================================
   ZKaliware — Portfolio
   Design tokens derived 1:1 from provided mockups
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root{
  /* colors */
  --bg:            #0a0a0a;
  --bg-soft:       #111111;
  --card-bg:       #141414;
  --border:        rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text:          #f4f2ee;
  --text-muted:    #9a9893;
  --text-faint:    #6f6d69;
  --accent:        #b7ae9c;
  --accent-hover:  #c9c1b0;
  --accent-ink:    #17160f;
  --status-dot:    #7cb47c;
  --input-bg:      #16161522;
  --radius-lg:     20px;
  --radius-md:     14px;
  --radius-pill:   999px;

  /* type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;

  --ease: cubic-bezier(.16,.8,.24,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
h1,h2,h3{ font-family:var(--font-display); margin:0; letter-spacing:-0.02em; }
p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }

.container{
  max-width:1360px;
  margin:0 auto;
  padding:0 80px;
}
@media (max-width:900px){ .container{ padding:0 32px; } }
@media (max-width:560px){ .container{ padding:0 20px; } }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
  border-radius:6px;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

/* =========================
   NAV
   ========================= */
.nav{
  position:sticky;
  top:0;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:28px 0;
  background:linear-gradient(to bottom, rgba(10,10,10,.92) 60%, rgba(10,10,10,0));
  backdrop-filter:blur(6px);
}
.nav.sub-nav{ padding:24px 0; background:var(--bg); backdrop-filter:none; }
.nav .container{ display:flex; align-items:center; justify-content:space-between; width:100%; }
@media (max-width:640px){
  .nav .container{ flex-direction:column; align-items:flex-start; gap:16px; }
  .nav-links{ gap:22px; flex-wrap:wrap; }
}
.logo{ display:flex; align-items:center; gap:10px; }
.logo img{ height:22px; width:auto; transition:opacity .3s var(--ease); }
.logo:hover img{ opacity:.8; }

.nav-links{ display:flex; align-items:center; gap:40px; }
.nav-links a{
  font-size:14.5px;
  color:var(--text);
  position:relative;
  padding:4px 0;
}
.nav-links a::after{
  content:'';
  position:absolute;
  left:0; bottom:0;
  width:0; height:1px;
  background:var(--accent);
  transition:width .35s var(--ease);
}
.nav-links a:hover::after{ width:100%; }

.back-link{
  display:flex; align-items:center; gap:8px;
  font-size:14.5px; color:var(--text-muted);
  transition:color .25s var(--ease), transform .25s var(--ease);
}
.back-link svg{ transition:transform .3s var(--ease); }
.back-link:hover{ color:var(--text); }
.back-link:hover svg{ transform:translateX(-4px); }

.portfolio-tag{
  display:flex; align-items:center; gap:8px;
  font-size:13px; letter-spacing:.12em; color:var(--text-muted);
  transition:color .25s var(--ease);
}
.portfolio-tag .dot{ width:6px; height:6px; border-radius:50%; background:var(--status-dot); box-shadow:0 0 8px var(--status-dot); }
.portfolio-tag:hover{ color:var(--text); }

/* =========================
   BUTTONS
   ========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:15px 30px;
  border-radius:var(--radius-pill);
  font-size:15px;
  font-weight:500;
  border:1px solid transparent;
  transition:transform .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn-primary{
  background:var(--accent);
  color:var(--accent-ink);
}
.btn-primary:hover{
  background:var(--accent-hover);
  box-shadow:0 8px 24px -8px rgba(183,174,156,.5);
  transform:translateY(-2px);
}
.btn-outline{
  background:transparent;
  border-color:var(--border-strong);
  color:var(--text);
}
.btn-outline:hover{
  border-color:var(--text);
  transform:translateY(-2px);
}
.btn-block{ width:100%; }

/* =========================
   HERO
   ========================= */
.hero{
  padding:120px 0 100px;
  text-align:center;
}
.hero-status{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:9px 18px;
  border:1px solid var(--border);
  border-radius:var(--radius-pill);
  font-size:13px;
  color:var(--text-muted);
  margin-bottom:36px;
}
.hero-status .dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--status-dot);
  box-shadow:0 0 0 0 rgba(124,180,124,.6);
  animation:pulse 2.4s infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(124,180,124,.55); }
  70%{ box-shadow:0 0 0 8px rgba(124,180,124,0); }
  100%{ box-shadow:0 0 0 0 rgba(124,180,124,0); }
}
.hero h1{
  font-size:clamp(38px, 5.6vw, 76px);
  font-weight:700;
  line-height:1.08;
  color:#e9e6df;
  max-width:1100px;
  margin:0 auto 28px;
}
.hero p.sub{
  font-size:clamp(15px, 1.6vw, 19px);
  color:var(--text-muted);
  max-width:640px;
  margin:0 auto 44px;
}
.hero-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
}

/* entrance choreography (landing hero) */
.reveal-in{
  opacity:0;
  transform:translateY(22px);
  animation:revealUp .8s var(--ease) forwards;
}
@keyframes revealUp{
  to{ opacity:1; transform:translateY(0); }
}

/* =========================
   SECTION HEADERS
   ========================= */
.eyebrow{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:13px;
  letter-spacing:.14em;
  color:var(--text-muted);
  margin-bottom:20px;
  text-transform:uppercase;
}
.eyebrow::before{
  content:'';
  width:22px; height:1px;
  background:var(--text-muted);
}
.section-title{
  font-size:clamp(30px, 4vw, 46px);
  font-weight:700;
  color:#f2f0ea;
}
.page-head{ padding:56px 0 48px; }
.page-head .section-title{ margin-bottom:14px; }
.page-head .sub{ color:var(--text-muted); font-size:15.5px; max-width:560px; }

.section{ padding:40px 0 100px; }
.section-head-row{ margin-bottom:44px; }

/* =========================
   PROJECT CARDS
   ========================= */
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:28px;
}
@media (max-width:820px){
  .grid{ grid-template-columns:1fr; }
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:28px;
}
@media (max-width:1100px){
  .grid-3{ grid-template-columns:1fr 1fr; }
}
@media (max-width:700px){
  .grid-3{ grid-template-columns:1fr; }
}

.card{
  border-radius:var(--radius-lg);
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--card-bg);
  display:block;
  opacity:0;
  transform:translateY(28px);
  transition:border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.card.in-view{
  animation:revealUp .75s var(--ease) forwards;
}
.card:hover{
  border-color:var(--border-strong);
  box-shadow:0 24px 48px -20px rgba(0,0,0,.55);
}

.card-media{
  position:relative;
  overflow:hidden;
  aspect-ratio:760/521;
  background:#000;
}
.card-media img{
  width:100%; height:100%; object-fit:cover;
  transition:transform .7s var(--ease), filter .7s var(--ease);
}
.card:hover .card-media img{
  transform:scale(1.045);
}

.card-body{ padding:22px 26px 26px; }
.card-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
  font-size:13.5px;
  color:var(--text-muted);
}
.card-row .tag-right{ color:var(--text-faint); }

.card-arrow{
  width:34px; height:34px;
  border-radius:50%;
  border:1px solid var(--border-strong);
  display:flex; align-items:center; justify-content:center;
  transition:background .35s var(--ease), transform .45s var(--ease), border-color .35s var(--ease);
  flex-shrink:0;
}
.card-arrow svg{ transition:transform .45s var(--ease); }
.card:hover .card-arrow{
  background:var(--accent);
  border-color:var(--accent);
}
.card:hover .card-arrow svg{ transform:rotate(45deg); }
.card:hover .card-arrow svg path{ stroke:var(--accent-ink); }

.card-title{
  font-family:var(--font-display);
  font-size:22px;
  font-weight:700;
  color:#f4f2ee;
}

/* link-card wrapper used on landing (whole card clickable) */
a.card{ cursor:pointer; }

/* =========================
   CONTACT SECTION
   ========================= */
.contact{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:64px;
  align-items:start;
}
@media (max-width:900px){
  .contact{ grid-template-columns:1fr; gap:48px; }
}
.contact-copy p.sub{ color:var(--text-muted); font-size:15.5px; max-width:440px; margin-bottom:28px; }
.info-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px 20px;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  margin-bottom:14px;
  transition:border-color .3s var(--ease), transform .3s var(--ease), background .3s var(--ease);
  max-width:340px;
}
.info-row:hover{
  border-color:var(--border-strong);
  transform:translateX(4px);
  background:rgba(255,255,255,.02);
}
.info-icon{
  width:38px; height:38px;
  border-radius:50%;
  background:rgba(255,255,255,.05);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.info-row .label{ font-size:12px; color:var(--text-faint); margin-bottom:2px; }
.info-row .value{ font-size:14.5px; color:var(--text); font-weight:500; }

.form-card{
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:36px;
  background:var(--card-bg);
}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-bottom:20px;
}
@media (max-width:520px){ .form-grid{ grid-template-columns:1fr; } }
.field label{
  display:block;
  font-size:13px;
  color:var(--text-muted);
  margin-bottom:9px;
}
.field input, .field textarea{
  width:100%;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:11px;
  padding:14px 16px;
  color:var(--text);
  font-family:var(--font-body);
  font-size:14.5px;
  transition:border-color .3s var(--ease), background .3s var(--ease);
}
.field input::placeholder, .field textarea::placeholder{ color:var(--text-faint); }
.field input:focus, .field textarea:focus{
  border-color:var(--accent);
  background:rgba(255,255,255,.045);
  outline:none;
}
.field{ margin-bottom:20px; }
.field textarea{ resize:vertical; min-height:120px; }

.form-status{
  margin-top:14px;
  font-size:14px;
  min-height:20px;
  text-align:center;
  transition:opacity .3s var(--ease);
}
.form-status.ok{ color:#8fc98f; }
.form-status.err{ color:#e08b8b; }

.btn[disabled]{ opacity:.6; cursor:not-allowed; transform:none !important; }
.spinner{
  width:16px; height:16px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.25);
  border-top-color:var(--accent-ink);
  animation:spin .7s linear infinite;
  display:none;
}
.btn.loading .spinner{ display:inline-block; }
.btn.loading .btn-label{ opacity:.7; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* =========================
   FOOTER
   ========================= */
.footer{
  border-top:1px solid var(--border);
  padding:34px 0;
}
.footer .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  flex-wrap:wrap;
}
.footer-links{ display:flex; gap:32px; }
.footer-links a{
  font-size:14px;
  color:var(--text-muted);
  position:relative;
  transition:color .3s var(--ease);
}
.footer-links a:hover{ color:var(--text); }
.footer-links a::after{
  content:'';
  position:absolute; left:0; bottom:-4px;
  width:0; height:1px; background:var(--accent);
  transition:width .3s var(--ease);
}
.footer-links a:hover::after{ width:100%; }
.footer-copy{ font-size:13px; color:var(--text-faint); }
.footer-logo img{ height:20px; }

/* =========================
   SCROLL REVEAL (generic)
   ========================= */
.fx-reveal{
  opacity:0;
  transform:translateY(26px);
  transition:opacity .8s var(--ease), transform .8s var(--ease);
}
.fx-reveal.in-view{
  opacity:1;
  transform:translateY(0);
}

/* stagger helper */
.fx-reveal:nth-child(1){ transition-delay:0s; }
.fx-reveal:nth-child(2){ transition-delay:.08s; }
.fx-reveal:nth-child(3){ transition-delay:.16s; }

/* subtle ambient glow behind hero (pure CSS, no images) */
.hero-glow{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(60% 45% at 50% 0%, rgba(183,174,156,.10), transparent 70%);
  z-index:-1;
}
.hero-wrap{ position:relative; }
