/* ==========================================================================
   KVR Studio — Premium digital studio website
   Controlled Maximalism: dark canvas, electric blue accent, technical/mono
   annotations paired with a bold display face. One signature move per section.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root{
  /* Brand colors (from KVR brand sheet) */
  --bg: #0b0b0b;
  --bg-soft: #0d0d0e;
  --card: #151515;
  --card-hover: #1a1a1c;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);
  --text: #f7f7f8;
  --text-secondary: #b8b8bb;
  --text-tertiary: #707074;
  --accent: #2563ff;
  --accent-bright: #5b85ff;
  --accent-dim: rgba(37,99,255,.14);
  --accent-line: rgba(37,99,255,.35);
  --accent-2: #8b5cf6;
  --accent-2-dim: rgba(139,92,246,.12);
  --glow-shadow: 0 10px 40px -12px rgba(37,99,255,.45);
  --glow-shadow-lg: 0 20px 60px -16px rgba(37,99,255,.4);

  /* Type */
  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
  --font-body: 'Switzer', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --container: 1280px;
  --pad: clamp(24px, 5vw, 80px);
  --section-pad: clamp(88px, 12vw, 160px);
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 24px;

  /* Motion */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);

  --mx: 50%;
  --my: 40%;
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; margin: 0; padding: 0; }

html{
  background: var(--bg);
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
}

html.lenis{ height: auto; }
.lenis.lenis-smooth{ scroll-behavior: auto; }
.lenis.lenis-stopped{ overflow: hidden; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  touch-action: pan-y;
  position: relative;
}

/* Persistent, gentle aurora wash — keeps the dark canvas feeling premium
   and alive rather than flat/void black, without touching the brand's
   actual background/card hex values. */
body::before{
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1100px 640px at 14% -6%, rgba(37,99,255,.16), transparent 60%),
    radial-gradient(900px 620px at 88% 8%, rgba(139,92,246,.10), transparent 62%),
    radial-gradient(1000px 700px at 50% 108%, rgba(37,99,255,.09), transparent 60%);
  pointer-events: none;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul{ list-style: none; }
svg{ display: block; }

::selection{ background: var(--accent); color: #fff; }

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible{
  outline: 2px solid var(--accent-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.eyebrow::before{
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  flex-shrink: 0;
  animation: eyebrow-pulse 2.6s var(--ease-in-out) infinite;
}
@keyframes eyebrow-pulse{
  0%, 100%{ box-shadow: 0 0 0 3px var(--accent-dim); }
  50%{ box-shadow: 0 0 0 6px var(--accent-dim); }
}

.section-head{
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: clamp(48px, 7vw, 84px);
}
.section-head h2{
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  color: var(--text);
}
.section-head p{
  max-width: 44ch;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.text-secondary{ color: var(--text-secondary); }

/* ---------- Layout ---------- */
.container{
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

section{
  position: relative;
  padding-block: var(--section-pad);
}

#services, #why, #build, #process, #work{ overflow: hidden; }

#services::before,
#why::before,
#build::before,
#process::before,
#work::before{
  content: '';
  position: absolute;
  z-index: -1;
  width: 620px;
  height: 420px;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  opacity: .7;
}
#services::before{ top: -60px; left: -180px; background: radial-gradient(circle, rgba(37,99,255,.14), transparent 70%); }
#why::before{ top: -40px; right: -220px; left: auto; background: radial-gradient(circle, rgba(139,92,246,.12), transparent 70%); }
#build::before{ top: -80px; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(37,99,255,.12), transparent 70%); }
#process::before{ top: -40px; right: -200px; background: radial-gradient(circle, rgba(139,92,246,.1), transparent 70%); }
#work::before{ top: -60px; left: -200px; background: radial-gradient(circle, rgba(37,99,255,.13), transparent 70%); }

.divider{
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ---------- Buttons ---------- */
.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 30px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  border-radius: 100px;
  white-space: nowrap;
  isolation: isolate;
  transition: transform .15s var(--ease-out);
}
.btn:active{ transform: scale(.96); }

.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #fff;
  box-shadow: var(--glow-shadow);
  transition: box-shadow .35s var(--ease-out), transform .35s var(--ease-out), filter .35s var(--ease-out);
}
.btn-primary:hover{
  box-shadow: var(--glow-shadow-lg);
  filter: brightness(1.08);
}

.btn-glow{ box-shadow: 0 14px 50px -12px rgba(37,99,255,.55); }

.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: border-color .35s var(--ease-out), background .35s var(--ease-out);
}
.btn-ghost:hover{
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.btn-arrow{
  width: 16px; height: 16px;
  transition: transform .4s var(--ease-out);
}
.btn:hover .btn-arrow{ transform: translate(3px,-3px); }

/* Magnetic wrapper — JS toggles translate via inline transform */
.magnetic{ transition: transform .25s var(--ease-out); will-change: transform; }

/* ---------- Custom cursor (desktop only, added via JS) ---------- */
.cursor-dot{
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%,-50%);
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .3s ease, width .3s var(--ease-out), height .3s var(--ease-out);
}
.cursor-ring{
  position: fixed;
  top: 0; left: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  pointer-events: none;
  z-index: 998;
  transform: translate(-50%,-50%);
  opacity: 0;
  transition: opacity .3s ease, width .3s var(--ease-out), height .3s var(--ease-out), border-color .3s ease;
}
.has-custom-cursor .cursor-dot,
.has-custom-cursor .cursor-ring{ opacity: 1; }
.has-custom-cursor{ cursor: none; }
.has-custom-cursor a, .has-custom-cursor button{ cursor: none; }

.cursor-ring.is-active{
  width: 56px; height: 56px;
  border-color: var(--accent-line);
}
.cursor-dot.is-active{ width: 0; height: 0; }

/* ---------- Noise overlay (subtle texture, no heavy image) ---------- */
.grain{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  opacity: .025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   NAV
   ========================================================================== */
.nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding .4s var(--ease-out), background .4s var(--ease-out), border-color .4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled{
  padding-block: 14px;
  background: rgba(11,11,11,.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}

.nav-logo{
  display: flex;
  align-items: center;
  height: 26px;
}
.nav-logo img{ height: 100%; width: auto; }

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

.nav-cta{ display: flex; align-items: center; gap: 20px; }
.nav-cta .btn{ padding: 11px 22px; font-size: 13.5px; }

.nav-burger{
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  z-index: 210;
}
.nav-burger span{
  width: 20px; height: 1.5px;
  background: var(--text);
  transition: transform .35s var(--ease-out), opacity .3s ease;
}
.nav-burger.is-open span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2){ opacity: 0; }
.nav-burger.is-open span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

/* Hidden and inert by default on ALL screen sizes. It only becomes
   display:flex inside the tablet/mobile media query below, so it can never
   render (or be clicked) on desktop regardless of class state. */
.mobile-menu{
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  z-index: 190;
  background: var(--bg);
  display: none;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  padding: 32px var(--pad);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), visibility 0s linear .4s;
}
.mobile-menu.is-open{
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), visibility 0s linear 0s;
}
.mobile-menu a{
  font-family: var(--font-display);
  font-size: 13vw;
  font-weight: 500;
  color: var(--text);
  display: block;
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
}
/* Higher specificity than ".mobile-menu a" so the CTA keeps normal button
   proportions instead of inheriting the giant nav-link type scale. */
.mobile-menu .btn.mobile-menu-cta{
  display: inline-flex;
  width: fit-content;
  margin-top: 32px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-bottom: none;
  padding: 16px 30px;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero{
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 140px;
  padding-bottom: 60px;
  overflow: hidden;
}

.hero-bg{
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(37,99,255,.10), transparent 70%);
}

/* signature: blueprint grid that glows where the cursor moves */
.hero-grid{
  position: absolute;
  inset: -1px;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .28;
}
.hero-grid::after{
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91,133,255,.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,133,255,.55) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(260px circle at var(--mx) var(--my), black 0%, transparent 72%);
  mask-image: radial-gradient(260px circle at var(--mx) var(--my), black 0%, transparent 72%);
}

.hero-inner{ position: relative; }

.hero-eyebrow{ margin-bottom: 28px; }

.hero h1{
  font-size: clamp(2.9rem, 7.4vw, 6.6rem);
  color: var(--text);
}
.hero h1 .line{ display: block; overflow: hidden; }
.hero h1 .line span{ display: inline-block; will-change: transform; }
.hero h1 .accent{ color: var(--accent); }

.hero-trust{
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.hero-trust li{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.hero-trust li::before{
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px 1px var(--accent-line);
  flex-shrink: 0;
}

.hero-sub{
  margin-top: 28px;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-actions{
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-meta{
  margin-top: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero-meta .scroll-cue{
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-meta .scroll-cue svg{ width: 14px; height: 14px; animation: bob 2s var(--ease-in-out) infinite; }

@keyframes bob{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(5px); }
}

/* ==========================================================================
   SERVICES — horizontal-reveal accordion rows. The row itself stays put;
   clicking + grows a panel to the RIGHT of the title (desktop), rather than
   pushing content down. On narrow screens there isn't room for that, so a
   dedicated mobile treatment further down switches it to a vertical reveal.
   ========================================================================== */
.services-list{
  border-top: 1px solid var(--border);
}

.service-row{
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2.6vw, 32px);
  padding-block: clamp(22px, 3vw, 30px);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .4s var(--ease-out);
  max-width: 100%;
  overflow: hidden;
}
.service-row:hover{ background: rgba(255,255,255,.015); }

.service-index{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  width: 26px;
  flex-shrink: 0;
  padding-top: 14px;
}

.service-title{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  color: var(--text-secondary);
  transition: color .4s var(--ease-out);
  flex: 0 1 auto;
  min-width: 0;
  max-width: 340px;
  padding-top: 4px;
}
.service-row.is-open .service-title,
.service-row:hover .service-title{ color: var(--text); }

.service-toggle{
  width: 40px; height: 40px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .4s var(--ease-out), border-color .4s var(--ease-out), transform .5s var(--ease-out);
}
.service-row.is-open .service-toggle{
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(135deg);
  box-shadow: 0 0 24px -4px rgba(37,99,255,.6);
}
.service-toggle svg{ width: 15px; height: 15px; color: var(--text); }
.service-row.is-open .service-toggle svg{ color: #fff; }

/* The panel that grows horizontally to the right of the toggle. Width is
   driven by JS (0 -> measured content width); opacity/translate handled
   here for a smooth arrival rather than a hard reveal. */
.service-reveal{
  flex: none;
  width: 0;
  overflow: hidden;
  align-self: stretch;
}
.service-reveal-inner{
  width: min(420px, 40vw);
  padding-left: clamp(20px, 2.4vw, 32px);
  border-left: 1px solid var(--border);
  height: 100%;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.service-row.is-open .service-reveal-inner{
  opacity: 1;
  transform: translateX(0);
  transition-delay: .12s;
}

.service-reveal-label{
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.service-checklist{
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
}
.service-checklist li{
  position: relative;
  padding-left: 24px;
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.service-checklist li::before{
  content: '';
  position: absolute;
  left: 0; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.service-checklist li::after{
  content: '';
  position: absolute;
  left: 4px; top: 8px;
  width: 6px; height: 3px;
  border-left: 1.5px solid var(--accent-bright);
  border-bottom: 1.5px solid var(--accent-bright);
  transform: rotate(-45deg);
}

.service-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.service-tags span{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border-radius: 100px;
  padding: 6px 12px;
  white-space: nowrap;
}

/* ==========================================================================
   WHY KVR — principles
   ========================================================================== */
.principles-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.principle{
  background: var(--bg);
  padding: clamp(28px, 3vw, 40px) clamp(22px, 2.6vw, 32px);
  transition: background .4s var(--ease-out);
}
.principle:hover{ background: var(--card); }

.principle-icon{
  width: 44px; height: 44px;
  margin-bottom: 28px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(37,99,255,.4));
  transition: transform .45s var(--ease-out);
}
.principle:hover .principle-icon{ transform: scale(1.1) rotate(-4deg); }
.principle-icon svg{ width: 100%; height: 100%; }
.principle-icon svg path,
.principle-icon svg circle,
.principle-icon svg rect,
.principle-icon svg polyline{
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.principle:hover .principle-icon svg path,
.principle:hover .principle-icon svg circle,
.principle:hover .principle-icon svg rect,
.principle:hover .principle-icon svg polyline{
  stroke-dashoffset: 0;
}

.principle h3{
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.principle p{
  color: var(--text-secondary);
  font-size: .93rem;
  line-height: 1.55;
}

/* ==========================================================================
   WHAT WE BUILD — bento grid
   ========================================================================== */
.bento{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(180px, auto);
  grid-auto-flow: dense;
  gap: 16px;
}

.bento-item{
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform .45s var(--ease-out), border-color .45s var(--ease-out), background .45s var(--ease-out);
  will-change: transform;
}
.bento-item::before{
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--bx,50%) var(--by,0%), var(--accent-dim), transparent 70%);
  opacity: 0;
  transition: opacity .5s ease;
}
.bento-item:hover{
  transform: translateY(-4px);
  border-color: var(--accent-line);
  background: var(--card-hover);
  box-shadow: 0 24px 60px -24px rgba(37,99,255,.35);
}
.bento-item:hover::before{ opacity: 1; }

.bento-item.w-third{ grid-column: span 2; }
.bento-item.w-half{ grid-column: span 3; }
.bento-item.w-full{ grid-column: span 6; }

.bento-icon{
  width: 34px; height: 34px;
  color: var(--accent);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(37,99,255,.4));
  transition: transform .45s var(--ease-out);
}
.bento-item:hover .bento-icon{ transform: scale(1.12) rotate(-4deg); }
.bento-icon svg{ width: 100%; height: 100%; }

.bento-text{ position: relative; z-index: 1; }
.bento-item h3{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.bento-item p{
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.5;
  max-width: 32ch;
}

/* ==========================================================================
   PROCESS — real sequence, numbered timeline
   ========================================================================== */
.process{
  position: relative;
}
.process-line{
  position: absolute;
  left: calc(var(--pad) + 21px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.process-line-fill{
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(var(--accent), var(--accent-bright));
  transform-origin: top;
}

.process-list{ position: relative; }

.process-step{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: clamp(20px, 4vw, 56px);
  padding-block: clamp(32px, 4.5vw, 52px);
  border-bottom: 1px solid var(--border);
}
.process-step:first-child{ padding-top: 0; }
.process-step:last-child{ border-bottom: none; }

.process-num{
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  transition: border-color .5s ease, color .5s ease, background .5s ease;
}
.process-step.is-active .process-num{
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 6px var(--accent-dim);
}

.process-content{
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.3fr);
  gap: clamp(16px, 4vw, 60px);
}
.process-content h3{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
}
.process-content p{
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 48ch;
}
.process-tag{
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
  margin-top: 10px;
}

/* ==========================================================================
   SELECTED WORK
   ========================================================================== */
.work-grid{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  align-items: stretch;
}

.work-feature{
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .4s ease, transform .4s var(--ease-out), box-shadow .4s ease;
  will-change: transform;
}
.work-feature:hover{ border-color: var(--border-strong); box-shadow: 0 30px 70px -30px rgba(37,99,255,.3); }

.work-mock{
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(160deg, #101014, #0a0a0c);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.work-mock-bar{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.work-mock-bar span{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}
.work-mock-screen{
  position: relative;
  padding: 22px;
  height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.work-mock-glow{
  position: absolute;
  top: -20%; left: 20%;
  width: 60%; height: 80%;
  background: radial-gradient(circle, rgba(37,99,255,.28), transparent 65%);
  filter: blur(10px);
  animation: float-glow 8s var(--ease-in-out) infinite alternate;
}
@keyframes float-glow{
  0%{ transform: translate(0,0); }
  100%{ transform: translate(-8%, 10%); }
}
.work-mock-row{
  position: relative;
  height: 12px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
}
.work-mock-row.w-60{ width: 60%; }
.work-mock-row.w-40{ width: 40%; }
.work-mock-row.w-80{ width: 80%; }
.work-mock-cards{
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  margin-top: auto;
}
.work-mock-cards div{
  height: 54px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.work-mock-cards div:first-child{ background: var(--accent-dim); border-color: var(--accent-line); }

.work-info{
  padding: clamp(24px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.work-info-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.work-info h3{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
}
.work-status{
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border-radius: 100px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.work-info p{ color: var(--text-secondary); line-height: 1.6; max-width: 52ch; }
.work-info-tags{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.work-info-tags span{
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 11px;
}

.work-side{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .4s ease, background .4s ease, transform .4s var(--ease-out), box-shadow .4s ease;
  will-change: transform;
}
.work-side:hover{ border-color: var(--border-strong); background: var(--card-hover); box-shadow: 0 24px 60px -28px rgba(37,99,255,.28); }

.work-side-icon{
  width: 36px; height: 36px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}
.work-side-icon svg{ width: 100%; height: 100%; }
.work-side h4{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.work-side p{ color: var(--text-tertiary); font-size: .9rem; line-height: 1.55; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact{
  position: relative;
  text-align: center;
  overflow: hidden;
}
.contact-grid{
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .22;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 40%, black, transparent 85%);
  mask-image: radial-gradient(60% 60% at 50% 40%, black, transparent 85%);
}

.contact-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.contact h2{
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  max-width: 16ch;
}
.contact-sub{
  max-width: 46ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.6;
}

.contact-actions{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.contact-actions .btn-primary{ padding: 19px 38px; font-size: 16px; }

.contact-direct{
  margin-top: 28px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}
.contact-direct a,
.contact-direct .contact-direct-link{ color: var(--text-secondary); transition: color .3s ease; border-bottom: 1px solid transparent; }
.contact-direct a:hover,
.contact-direct .contact-direct-link:hover{ color: var(--accent-bright); border-color: var(--accent-line); }
.contact-direct-link{
  background: none; border: none; padding: 0; margin: 0;
  font-family: inherit; font-size: inherit; cursor: pointer;
}
.contact-note{ color: var(--text-tertiary); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer{
  padding-block: 56px;
  border-top: 1px solid var(--border);
}
.footer-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 48px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.footer-brand{ max-width: 340px; }
.footer-brand img{ height: 28px; width: auto; margin-bottom: 18px; }
.footer-brand p{ color: var(--text-tertiary); font-size: .9rem; line-height: 1.6; }

.footer-cols{ display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h5{
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}
.footer-col ul{ display: flex; flex-direction: column; gap: 12px; }
.footer-col a,
.footer-col .footer-contact-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .92rem;
  color: var(--text-secondary);
  transition: color .3s ease, gap .3s var(--ease-out);
}
.footer-contact-link{
  background: none; border: none; padding: 0; margin: 0;
  font-family: inherit; cursor: pointer; text-align: left;
}
.footer-col a::after,
.footer-col .footer-contact-link::after{
  content: '→';
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .3s ease, transform .3s var(--ease-out);
}
.footer-col a:hover,
.footer-col .footer-contact-link:hover{ color: var(--text); gap: 9px; }
.footer-col a:hover::after,
.footer-col .footer-contact-link:hover::after{ opacity: 1; transform: translateX(0); }

.footer-bottom{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   RESPONSIVE — each breakpoint is treated as its own composition, not a
   scaled-down copy of desktop.
   ========================================================================== */

/* ---- Tablet: 1024px and below ---- */
@media (max-width: 1024px){
  :root{ --section-pad: clamp(72px, 12vw, 120px); }

  .nav-links{ display: none; }
  .nav-burger{ display: flex; }
  .mobile-menu{ display: flex; }
  .nav-cta .btn-ghost{ display: none; }

  .hero{ padding-top: 120px; }
  .hero-meta{ margin-top: 72px; }

  .principles-grid{ grid-template-columns: repeat(2, 1fr); }

  .bento{ grid-template-columns: repeat(2, 1fr); }
  .bento-item.w-third,
  .bento-item.w-half,
  .bento-item.w-full{ grid-column: span 2; }

  /* Process on tablets: use the clean mobile-style layout without the
     vertical rail crossing the content. Active step highlighting remains. */
  .process-line{ display: none; }
  .process-step{ grid-template-columns: 1fr; gap: 16px; }
  .process-num{ width: 40px; height: 40px; }
  .process-content{ grid-template-columns: 1fr; gap: 10px; padding-left: 0; }

  .work-grid{ grid-template-columns: 1fr; grid-template-rows: auto; }
  .work-feature{ grid-row: auto; }
  .work-side{ min-height: 200px; }

  .footer-top{ flex-direction: column; gap: 32px; }
  .footer-cols{ gap: 48px; }
}

/* ---- Below 860px: not enough room for the side-by-side reveal, so the
   accordion switches from a horizontal to a vertical opening (handled by
   JS animating height instead of width once this query is active). ---- */
@media (max-width: 860px){
  .service-row{ flex-wrap: wrap; }
  .service-reveal{ flex: 1 1 100%; width: 100% !important; height: 0; overflow: hidden; order: 3; }
  .service-reveal-inner{
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 18px;
    margin-top: 4px;
  }
  .service-row.is-open .service-reveal-inner{ transform: translateY(0); }
  .service-reveal-inner{ transform: translateY(-6px); }
}

/* ---- Mobile: 680px and below — deliberately redesigned, not shrunk ---- */
@media (max-width: 680px){
  :root{
    --section-pad: 72px;
    --pad: 20px;
  }

  body{ font-size: 15px; }

  .has-custom-cursor{ cursor: auto; }
  .cursor-dot, .cursor-ring{ display: none; }

  /* Nav */
  .nav{ padding-block: 16px; }
  .nav-cta .btn{ padding: 10px 18px; font-size: 13px; }
  .mobile-menu a{ font-size: 12vw; }

  /* Hero: single-column, tighter rhythm, meta stacks */
  .hero{ padding-top: 104px; padding-bottom: 40px; min-height: auto; }
  .hero h1{ font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-sub{ margin-top: 20px; font-size: 1rem; }
  .hero-actions{ margin-top: 36px; gap: 12px; }
  .hero-actions .btn{ width: 100%; }
  .hero-trust{ margin-top: 22px; flex-direction: column; gap: 8px; }
  .hero-meta{
    margin-top: 56px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .section-head{ margin-bottom: 40px; gap: 14px; }
  .section-head p{ max-width: none; }

  /* Services: index hides, title takes remaining space, panel stacks below */
  .service-index{ display: none; }
  .service-row{ gap: 12px; }
  .service-title{ font-size: 1.4rem; max-width: none; flex: 1 1 auto; }
  .service-toggle{ width: 34px; height: 34px; }

  /* Why KVR: single column list instead of grid */
  .principles-grid{ grid-template-columns: 1fr; border-radius: var(--radius-s); }

  /* What we build: compact 2-column grid instead of one long column of
     big rectangles — scannable in a glance rather than endless scrolling */
  .bento{ grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; gap: 10px; }
  .bento-item.w-third,
  .bento-item.w-half,
  .bento-item.w-full{ grid-column: span 1; }
  .bento-item{
    padding: 18px;
    border-radius: var(--radius-s);
    min-height: 0;
    justify-content: flex-start;
  }
  .bento-icon{ width: 26px; height: 26px; margin-bottom: 0; }
  .bento-text{ margin-top: 14px; }
  .bento-item h3{ font-size: 1rem; margin-bottom: 6px; line-height: 1.2; }
  .bento-item p{ font-size: .8rem; line-height: 1.45; max-width: none; }

  /* Process: number sits above content, own rhythm */
  .process-line{ display: none; }
  .process-step{ grid-template-columns: 1fr; gap: 16px; }
  .process-num{ width: 38px; height: 38px; }
  .process-content{ padding-left: 0; }

  /* Selected work: fully stacked cards */
  .work-grid{ gap: 14px; }
  .work-info-top{ flex-direction: column; gap: 10px; }
  .work-mock-cards{ grid-template-columns: repeat(2,1fr); }

  /* Contact */
  .contact-actions{ flex-direction: column; width: 100%; }
  .contact-actions .btn{ width: 100%; }
  .contact-direct{ flex-direction: column; gap: 12px; align-items: center; }

  /* Footer */
  .footer-cols{ flex-direction: column; gap: 28px; }
  .footer-bottom{ flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Touch devices: no hover-dependent affordances get stuck ---- */
@media (hover: none){
  .cursor-dot, .cursor-ring{ display: none; }
  .has-custom-cursor{ cursor: auto; }
}

/* ==========================================================================
   CONTACT MODAL
   ========================================================================== */
.contact-modal{
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease-out), visibility 0s linear .35s;
}
.contact-modal.is-open{
  opacity: 1; visibility: visible;
  transition: opacity .35s var(--ease-out), visibility 0s linear 0s;
}
.contact-modal-overlay{
  position: absolute; inset: 0;
  background: rgba(6,6,8,.72);
  backdrop-filter: blur(6px);
}
.contact-modal-panel{
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  padding: clamp(28px, 5vw, 44px);
  box-shadow: var(--glow-shadow-lg), 0 30px 80px -20px rgba(0,0,0,.6);
  transform: translateY(18px) scale(.97);
  opacity: 0;
  transition: transform .4s var(--ease-out), opacity .4s var(--ease-out);
}
.contact-modal.is-open .contact-modal-panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}
.contact-modal-close{
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, transform .25s ease;
}
.contact-modal-close svg{ width: 16px; height: 16px; }
.contact-modal-close:hover{ color: var(--text); border-color: var(--border-strong); transform: rotate(90deg); }

.contact-modal-panel h3{
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  margin-top: 10px;
}
.contact-modal-sub{
  color: var(--text-secondary); font-size: .95rem; line-height: 1.6;
  margin-top: 10px;
}
.contact-modal-list{
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.contact-modal-item{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  transition: border-color .3s ease, background .3s ease, transform .25s ease;
}
.contact-modal-item:hover{
  border-color: var(--accent-line);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.contact-modal-label{
  font-family: var(--font-mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-tertiary);
}
.contact-modal-value{
  font-size: .98rem; color: var(--text); font-weight: 500;
}
@media (max-width: 480px){
  .contact-modal-item{ flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (prefers-reduced-motion: reduce){
  .contact-modal-panel{ transform: none !important; }
}

/* ---------- KVR motion showcase ---------- */
.kvr-motion{
  padding-block:clamp(56px, 7vw, 88px);
}
.kvr-motion-frame{
  width:min(100%, 840px);
  margin-inline:auto;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:var(--radius-l);
  background:#fff;
  box-shadow:0 28px 70px -38px rgba(0,0,0,.72), 0 0 0 1px rgba(37,99,255,.045);
}
.kvr-motion-video{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1080 / 586;
  object-fit:contain;
  background:#fff;
}
@media (max-width:680px){
  .kvr-motion{padding-block:42px 56px;}
  .kvr-motion-frame{width:100%; border-radius:var(--radius-m);}
}
@media (prefers-reduced-motion:reduce){
  .kvr-motion-video{animation:none;}
}

