/* ==========================================================================
   DAN Digital
   Design read: studio portfolio for small-business owners, trust-first,
   native CSS + Geist, restrained motion. Dials: variance 6 / motion 5 / density 4.

   Shape rule: interactive controls are pills; surfaces (frames, tiles, form,
   dialog) are 16px; small parts (inputs, thumbnails) are 8px.
   Accent rule: one cobalt accent, used everywhere, in both themes.
   z-index scale: header 100, dialog (top layer), skip link 1000.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:        #f3f4f6;   /* cool neutral, zinc family */
  --bg-2:      #e9ebef;
  --surface:   #fbfbfc;
  --ink:       #121419;
  --ink-2:     #3a3f4a;
  --muted:     #5d6370;   /* 5.9:1 on --bg */
  --line:      rgba(18, 20, 25, .10);
  --line-2:    rgba(18, 20, 25, .18);
  --logo-blue: #5676fd;   /* brand blue from the logo artwork */
  --accent:    #2c47e8;   /* cobalt */
  --accent-2:  #2139c9;
  --accent-soft: rgba(44, 71, 232, .09);
  --on-accent: #fafbff;
  --shadow:    0 1px 2px rgba(18,20,25,.05), 0 10px 30px -14px rgba(18,20,25,.25);
  --shadow-lg: 0 1px 2px rgba(18,20,25,.05), 0 32px 64px -28px rgba(18,20,25,.38);

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 16px;
  --r-sm: 8px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0d0f13; --bg-2:#14171d; --surface:#171a21; --ink:#eef0f4; --ink-2:#c3c7d0; --muted:#9298a5;
    --line:rgba(238,240,244,.09); --line-2:rgba(238,240,244,.18);
    --accent:#6f86ff; --accent-2:#8899ff; --accent-soft:rgba(111,134,255,.12); --on-accent:#0d0f13;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
    --shadow-lg:0 1px 2px rgba(0,0,0,.4), 0 32px 64px -28px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#0d0f13; --bg-2:#14171d; --surface:#171a21; --ink:#eef0f4; --ink-2:#c3c7d0; --muted:#9298a5;
  --line:rgba(238,240,244,.09); --line-2:rgba(238,240,244,.18);
  --accent:#6f86ff; --accent-2:#8899ff; --accent-soft:rgba(111,134,255,.12); --on-accent:#0d0f13;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
  --shadow-lg:0 1px 2px rgba(0,0,0,.4), 0 32px 64px -28px rgba(0,0,0,.85);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.ph { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ── Buttons (pill) ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 46px; padding: 0 1.3rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 550; font-size: .93rem; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .25s var(--ease);
}
.btn .ph { transition: transform .25s var(--ease); }
.btn:hover .ph { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn-sm { height: 38px; padding: 0 1rem; font-size: .86rem; }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink); transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--bg-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.96); }
.icon-btn > span { display: grid; place-items: center; }
.icon-btn .ph { width: 18px; height: 18px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.scroll-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 24px; pointer-events: none; }
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand-logo { display: block; height: 38px; width: auto; color: var(--ink); transition: opacity .2s; }
.brand:hover .brand-logo { opacity: .82; }
.site-footer .brand-logo { height: 46px; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: .15rem; }
.main-nav a {
  display: block; padding: .45rem .85rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--ink-2); transition: color .2s, background-color .2s;
}
.main-nav a:hover, .main-nav a.is-current { color: var(--ink); background: var(--bg-2); }
.header-actions { display: flex; align-items: center; gap: .5rem; }

.i-sun, .i-close { display: none !important; }
:root[data-theme="dark"] .i-sun { display: grid !important; }
:root[data-theme="dark"] .i-moon { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: grid !important; }
  :root:not([data-theme="light"]) .i-moon { display: none !important; }
}
.menu-open .i-close { display: grid !important; }
.menu-open .i-open { display: none !important; }
.menu-btn { display: none; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(32px, 6vw, 72px)) 0 clamp(56px, 7vw, 88px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 55% at 82% 35%, var(--accent-soft), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hero-title {
  margin-top: 1.1rem; font-weight: 650; letter-spacing: -.045em; line-height: 1;
  font-size: clamp(2.8rem, 5.6vw, 4.9rem); text-wrap: balance;
}
.accent { color: var(--accent); }
.hero-lead { margin-top: 1.4rem; max-width: 34rem; font-size: clamp(1.02rem, 1.3vw, 1.15rem); color: var(--ink-2); line-height: 1.6; }
.hero-ctas { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .7rem; }

.frame {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }

.hero-stage { position: relative; aspect-ratio: 1 / .84; }
.hero-stage .frame { position: absolute; width: 76%; box-shadow: var(--shadow-lg); transition: transform .8s var(--ease); }
.stage-a { top: 0; right: 0; transform: rotate(1.4deg); }
.stage-b { top: 31%; left: 0; z-index: 2; transform: rotate(-1.8deg); }
.stage-c { bottom: 0; right: 7%; z-index: 3; transform: rotate(.6deg); }
@media (hover: hover) {
  .hero-stage:hover .stage-a { transform: rotate(2.2deg) translate(10px, -8px); }
  .hero-stage:hover .stage-b { transform: rotate(-2.6deg) translate(-10px, 2px); }
  .hero-stage:hover .stage-c { transform: rotate(0deg) translate(6px, 10px); }
}

/* Entry cascade: establishes reading order on load */
.js .enter { opacity: 0; transform: translateY(14px); animation: enter .9s var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 80ms); }
@keyframes enter { to { opacity: 1; transform: none; } }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: clamp(80px, 10vw, 128px) 0; }
.section-title { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 620; letter-spacing: -.035em; line-height: 1.06; max-width: 20ch; text-wrap: balance; }
.section-intro { margin-top: 1rem; max-width: 52ch; color: var(--ink-2); font-size: 1.05rem; }

/* Work */
.work .section-title { margin-bottom: clamp(36px, 5vw, 56px); }
.frame-lg { border-radius: var(--r); box-shadow: var(--shadow-lg); }
.frame img { transition: opacity .35s var(--ease), transform .8s var(--ease); }
.frame img.is-swapping { opacity: 0; }
@media (hover: hover) { .case-feature:hover .frame img, .case-card:hover .frame img, .case-split:hover .frame img { transform: scale(1.015); } }

.case-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.case-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 620; letter-spacing: -.03em; line-height: 1.1; }
.case-meta { margin-top: .35rem; font-size: .88rem; color: var(--muted); }
.case-desc { margin-top: .9rem; color: var(--ink-2); max-width: 52ch; }
.case-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.points { display: grid; gap: .7rem; }
.points li { display: flex; gap: .65rem; align-items: flex-start; font-size: .95rem; color: var(--ink-2); }
.points .ph { color: var(--accent); width: 20px; height: 20px; margin-top: .1em; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 .9rem; border-radius: 999px; font-size: .8rem; font-weight: 550; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.case-feature { padding-bottom: clamp(48px, 6vw, 80px); }
.case-feature .frame img { aspect-ratio: 2 / 1; }
.case-feature-body { margin-top: 2rem; display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.case-feature-body .points { margin-top: .3rem; }

.case-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 40px); padding-block: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.case-card .frame { margin-bottom: 1.5rem; }
.case-card .frame img { aspect-ratio: 16 / 10; }

.case-split {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 5vw, 72px); align-items: center;
  padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line);
}
.case-split .points { margin-top: 1.4rem; }

/* Services: one panel, six equal entries, hairline dividers */
.services { background: var(--bg-2); }
.svc-list {
  margin-top: clamp(36px, 5vw, 56px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.svc { background: var(--surface); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: .6rem; transition: background .3s var(--ease); }
@media (hover: hover) { .svc:hover { background: var(--bg); } }
.svc h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; margin-top: 1.1rem; }
.svc p { font-size: .95rem; color: var(--ink-2); max-width: 40ch; }
.svc-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.svc-ico .ph { width: 22px; height: 22px; }
@media (max-width: 960px) { .svc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .svc-list { grid-template-columns: 1fr; } .svc h3 { margin-top: .6rem; } }

/* Process timeline */
.timeline { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--line);
}
.timeline::after {
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease);
}
.timeline.is-visible::after { transform: scaleX(1); }
.timeline li { position: relative; padding-top: 2.2rem; }
.timeline li::before {
  content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 999px;
  background: var(--bg); border: 2px solid var(--accent); z-index: 1;
}
.timeline h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.timeline p { margin-top: .45rem; font-size: .92rem; color: var(--ink-2); }
.js .timeline li { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--n, 0) * 140ms + 200ms); }
.js .timeline.is-visible li { opacity: 1; transform: none; }

/* Standards */
.standards { border-top: 1px solid var(--line); }
.standards-groups { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 80px); }
.group-title { font-size: 1rem; font-weight: 600; color: var(--muted); padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.checks { display: grid; gap: 1.4rem; margin-top: 1.4rem; }
.checks li { display: flex; gap: .85rem; align-items: flex-start; }
.checks .ph { width: 22px; height: 22px; color: var(--accent); margin-top: .1em; }
.checks strong { display: block; font-weight: 600; letter-spacing: -.01em; }
.checks span { display: block; margin-top: .15rem; font-size: .93rem; color: var(--ink-2); }

/* Contact */
.contact { background: var(--bg-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact-card {
  padding: clamp(24px, 3.2vw, 40px); border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cc-label { font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.cc-label-2 { margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.cc-mail { display: inline-block; margin-top: .35rem; font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 600; letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; transition: color .2s; }
.cc-mail:hover { color: var(--accent); }
.cc-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.cc-actions .btn-ghost .ph { width: 18px; height: 18px; }
.cc-actions .btn-ghost:hover .ph { transform: none; }
.cc-status { font-size: .9rem; color: var(--ink-2); margin-top: .7rem; min-height: 1.4em; }
.cc-list { display: grid; gap: .6rem; margin-top: .9rem; list-style: none; padding: 0; }
.cc-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.cc-list .ph { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: .2em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0; }
.footer-inner { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.4rem; margin-left: auto; }
.footer-links a { font-size: .9rem; color: var(--ink-2); transition: color .2s; display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: .85rem; color: var(--muted); }

/* ── Case study dialog ──────────────────────────────────────────────────── */
.case-dialog {
  width: min(1160px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg); overscroll-behavior: contain;
}
.case-dialog::backdrop { background: rgba(10, 12, 16, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.case-dialog[open] { animation: dlg .45s var(--ease); }
@keyframes dlg { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.cd-inner { padding: clamp(18px, 3vw, 36px); }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.cd-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 620; letter-spacing: -.035em; line-height: 1.05; }
.cd-viewer { position: relative; }
.cd-frame img { aspect-ratio: auto; max-height: 62dvh; object-fit: contain; }
.cd-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); transition: transform .2s var(--ease);
}
.cd-nav:active { transform: translateY(-50%) scale(.95); }
.cd-nav .ph { width: 20px; height: 20px; }
.cd-prev { left: -14px; } .cd-next { right: -14px; }
.cd-caption { margin-top: .9rem; text-align: center; font-size: .9rem; color: var(--muted); }
.cd-thumbs { margin-top: .9rem; display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
.cd-thumbs button { flex: 0 0 auto; width: 112px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; opacity: .55; transition: opacity .2s, border-color .2s; }
.cd-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.cd-thumbs button:hover { opacity: 1; }
.cd-thumbs img { width: 100%; aspect-ratio: 16/9; object-fit: cover; object-position: top; background: var(--bg-2); }
.cd-details { margin-top: 2rem; padding-top: 1.75rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.cd-details h3 { font-size: .95rem; font-weight: 600; margin-bottom: .6rem; }
.cd-details p, .cd-details li { font-size: .92rem; color: var(--ink-2); }
.cd-details li { position: relative; padding-left: 1rem; margin-bottom: .45rem; }
.cd-details li::before { content: ""; position: absolute; left: 0; top: .65em; width: 5px; height: 5px; border-radius: 999px; background: var(--accent); }
body.dialog-open { overflow: hidden; }

/* ── Scroll reveal (feedback that new content has arrived) ──────────────── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── Studio: interactive 3D brand mark ─────────────────────────────────── */
.studio3d { position: relative; overflow: clip; padding-bottom: clamp(40px, 6vw, 72px); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.studio-points { margin-top: 2rem; display: grid; border-top: 1px solid var(--line); max-width: 30rem; }
.studio-points li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.sp-k { font-weight: 600; letter-spacing: -.01em; }
.sp-v { color: var(--ink-2); font-size: .95rem; }
.studio-stage {
  position: relative; aspect-ratio: 1 / .8; width: 100%;
  display: grid; place-items: center; touch-action: pan-y; user-select: none; cursor: grab;
}
.studio-stage::before {
  content: ""; position: absolute; inset: 8% 10%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
}
.studio-stage.is-dragging { cursor: grabbing; }
.studio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.studio-fallback { position: relative; width: 70%; height: auto; color: var(--ink); filter: drop-shadow(0 30px 40px rgba(0,0,0,.25)); }
.studio-stage.is-3d .studio-canvas { display: block; animation: studioIn 1.2s var(--ease) both; }
.studio-stage.is-3d .studio-fallback { display: none; }
@keyframes studioIn { from { opacity: 0; transform: scale(.96); } }
.studio-hint {
  position: absolute; left: 50%; bottom: -6px; translate: -50% 0; display: none; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 550; color: var(--muted); padding: .4rem .8rem; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity .5s var(--ease);
}
.studio-hint .ph { width: 16px; height: 16px; }
.studio-stage.is-3d .studio-hint { display: inline-flex; }
.studio-hint.is-used { opacity: 0; }
.studio3d + .work { padding-top: clamp(40px, 6vw, 72px); }
@media (max-width: 767px) {
  .studio-grid { grid-template-columns: 1fr; }
  .studio-stage { aspect-ratio: 1 / 1; max-width: 520px; margin: 0 auto; }
}

/* ══ Motion layer ═══════════════════════════════════════════════════════════
   Active only with html.motion (set before paint unless reduced motion is on).
   GSAP drives these states; CSS transitions on the same properties are switched
   off so the two never fight. Without JS or GSAP the CSS reveals above still work.
   ══════════════════════════════════════════════════════════════════════════ */

/* Lenis smooth scroll (from lenis.css, MIT) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* Scroll progress: a 2px accent line on the header edge */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; z-index: 2;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
.site-header { transition: background-color .3s, box-shadow .3s, transform .45s var(--ease); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-hidden:focus-within { transform: none; }

/* Hero atmosphere: hairline grid fading out, one slow accent glow */
.hero { overflow: clip; }
.hero::before { display: none; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center top;
  -webkit-mask-image: radial-gradient(70% 60% at 60% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(70% 60% at 60% 30%, #000 20%, transparent 75%);
  opacity: .7;
}
.hero-glow {
  position: absolute; width: min(760px, 80vw); aspect-ratio: 1; left: 58%; top: 2%;
  translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 45%, transparent 100%);
}
.hero-grid { z-index: 1; }

/* Hero headline: words rise out of a mask */
.split-w { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-w > span { display: inline-block; will-change: transform; }

.motion .enter { animation: none; opacity: 0; }
.motion .hero-stage .frame { transition: box-shadow .5s var(--ease); will-change: transform; }
.motion .hero-stage:hover .frame { transform: none; }
.motion .reveal { transition: none; }
.motion .timeline li { transition: none; }
.motion .timeline::after { transition: none; transform: scaleX(var(--p, 0)); }
.motion .timeline li::before { transition: background-color .35s var(--ease), box-shadow .35s var(--ease); }
.timeline li.is-on::before { background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }

/* Work frames: clip reveal + inner parallax (GSAP). Hover lifts the frame. */
.motion .frame img { transition: opacity .35s var(--ease); }
.motion .case-feature .frame, .motion .case-card .frame, .motion .case-split .frame { will-change: clip-path; }
@media (hover: hover) {
  .motion .case-feature:hover .frame img, .motion .case-card:hover .frame img, .motion .case-split:hover .frame img { transform: none; }
  .case-card .frame, .case-feature .frame, .case-split .frame { transition: box-shadow .5s var(--ease), translate .5s var(--ease); }
  .case-card:hover .frame, .case-feature:hover .frame, .case-split:hover .frame { translate: 0 -4px; box-shadow: var(--shadow-lg); }
}
.frame-glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.14), transparent 60%);
}
@media (hover: hover) { .frame:hover .frame-glare { opacity: 1; } }

/* Capabilities marquee */
.marquee { position: relative; overflow: clip; border-block: 1px solid var(--line); padding: 1.15rem 0; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(56px, 12vw, 180px); z-index: 1; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track, .marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-row { display: flex; flex-shrink: 0; }
.marquee-row li {
  display: inline-flex; align-items: center; gap: 2.2rem; padding-right: 2.2rem;
  font-size: clamp(1rem, 1.6vw, 1.25rem); font-weight: 550; letter-spacing: -.02em; color: var(--ink-2); white-space: nowrap;
}
.marquee-row li::after { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-toggle {
  position: absolute; right: var(--gutter); top: 50%; translate: 0 -50%; z-index: 2;
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow);
  transition: color .2s, border-color .2s;
}
.marquee-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.marquee-toggle .ph { width: 16px; height: 16px; }
.marquee-toggle > span { display: grid; place-items: center; }
.marquee-toggle .i-play, .marquee.is-paused .marquee-toggle .i-pause { display: none; }
.marquee.is-paused .marquee-toggle .i-play { display: grid; }

/* Services: a light follows the pointer across the dividers and the cells */
.svc-list { position: relative; isolation: isolate; }
.svc-list::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%);
}
.svc-list.is-lit::before { opacity: 1; }
.svc { position: relative; overflow: hidden; }
.svc::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(300px circle at var(--sx, 50%) var(--sy, 50%), var(--accent-soft), transparent 70%);
}
@media (hover: hover) { .svc:hover::after { opacity: 1; } .svc:hover { background: var(--surface); } }
.svc-ico { transition: transform .5s var(--ease), background-color .3s; }
@media (hover: hover) { .svc:hover .svc-ico { transform: translateY(-3px) rotate(-6deg); } }

/* Buttons: magnetic CTAs keep their own transforms out of GSAP's way */
.magnetic { will-change: transform; }
.motion .magnetic:hover { transform: none; }
.motion .magnetic:active { scale: .98; }


/* Theme switch: circular reveal from the toggle (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

@media (max-width: 767px) {
  .hero-lines { background-size: 48px 48px; }
  .marquee-toggle { right: 8px; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.5rem; }
  .timeline::before, .timeline::after { display: none; }
}

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .5rem var(--gutter) 1.25rem;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
  }
  .menu-open .main-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s; }
  .menu-open .site-header { background: var(--bg); }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { padding: .95rem .25rem; border-radius: 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .main-nav li:last-child a { border-bottom: 0; }
  .main-nav a:hover { background: none; }
}

/* < 768px: every multi-column layout collapses to one column */
@media (max-width: 767px) {
  :root { --header-h: 62px; }
  .brand-logo { height: 34px; }
  .hide-sm { display: none; }
  .hero-grid, .case-feature-body, .case-pair, .case-split, .standards-groups, .contact-grid, .cd-details { grid-template-columns: 1fr; }
  .hero-stage { aspect-ratio: 1 / 1.15; max-width: 520px; width: 100%; margin: 0 auto; }
  .hero-stage .frame { width: 84%; }
  .stage-b { top: 31%; }
  .stage-c { right: 2%; }
  .case-feature .frame img { aspect-ratio: 16 / 10; }
  .case-pair .case-card + .case-card { padding-top: 2.5rem; border-top: 1px solid var(--line); }
  .case-split .frame { order: -1; }
  .timeline { grid-template-columns: 1fr; row-gap: 1.8rem; }
  .timeline li { padding-top: 0; padding-left: 2.2rem; }
  .timeline li::before { top: .3em; }
  .footer-links { margin-left: 0; }
  .cd-nav { display: none; }
}


/* Phones: the process line runs vertically and draws with scroll */
@media (max-width: 767px) {
  .timeline::before, .timeline::after { display: block; top: 10px; bottom: 10px; left: 7px; right: auto; width: 2px; height: auto; }
  .timeline::after { transform-origin: 50% 0; transform: scaleY(1); }
  .motion .timeline::after { transform: scaleY(var(--p, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .enter, .js .reveal, .js .timeline li { opacity: 1; transform: none; animation: none; }
  .timeline::after { transform: scaleX(1); }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-row[aria-hidden] { display: none; }
  .marquee-row { flex-wrap: wrap; row-gap: .6rem; padding-inline: var(--gutter); }
  .marquee-toggle { display: none; }
  .marquee::before, .marquee::after { display: none; }
}
