/* =========================================================
   Mobile-first. Base styles target phones; larger screens
   are layered on with min-width queries, and hover-only
   effects live behind (hover: hover) and (pointer: fine).
   Breakpoints: 600px (large phone / small tablet), 900px (desktop).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink: #0b0b0c;
  --ink-2: #151517;
  --ink-3: #232326;
  --paper: #eeebe4;
  --white: #faf9f6;
  --accent: #ff4d1f;
  --violet: #6b5bff;
  --green: #15b67a;

  --bg: #0b0b0c;
  --fg: #eeebe4;
  --muted: color-mix(in srgb, var(--fg) 55%, var(--bg));
  --line: color-mix(in srgb, var(--fg) 14%, var(--bg));

  --f-display: "Syne", "Arial Black", sans-serif;
  --f-sans: "Inter Tight", system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: max(16px, env(safe-area-inset-left));
  --nav-h: 64px;
  --ease: cubic-bezier(.7, 0, .2, 1);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.is-loading, body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip { position: fixed; left: -999px; top: 10px; z-index: 1000; background: var(--accent); color: var(--ink); padding: 10px 14px; }
.skip:focus { left: 10px; }

.label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; gap: 10px; align-items: center;
}
.label span { color: var(--accent); }

.line { display: block; overflow: hidden; padding-bottom: .04em; }
.word { display: inline-block; white-space: nowrap; text-indent: 0; }
.char { display: inline-block; will-change: transform; text-indent: 0; }

.big-heading {
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 12.5vw, 168px); line-height: .9; letter-spacing: -0.045em;
}
.big-heading em { text-transform: none; color: var(--accent); font-size: 1.08em; letter-spacing: -0.03em; }

/* =========================================================
   Loader
   ========================================================= */
.loader {
  position: fixed; inset: 0; z-index: 900; color: var(--ink); isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) max(20px, env(safe-area-inset-bottom));
}
html:not(.js) .loader { display: none; }
.loader__top { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.loader__words { position: relative; align-self: center; height: 1.2em; overflow: hidden; font-family: var(--f-serif); font-style: italic; font-size: clamp(34px, 9vw, 72px); line-height: 1.2; }
.loader__words span { position: absolute; left: 0; top: 0; transform: translateY(110%); white-space: nowrap; }
.loader__count { font-family: var(--f-display); font-weight: 800; font-size: clamp(110px, 38vw, 360px); line-height: .8; letter-spacing: -0.06em; text-align: right; }
.loader__count::after { content: "%"; font-size: .3em; vertical-align: top; margin-left: .05em; }
.loader__bar { height: 2px; background: color-mix(in srgb, var(--ink) 20%, transparent); margin-top: 16px; }
.loader__bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* =========================================================
   Cursor (desktop only), grain, progress
   ========================================================= */
.cursor { position: fixed; left: 0; top: 0; z-index: 800; pointer-events: none; display: none; opacity: 0; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; border-radius: 50%; }
.cursor__dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff; mix-blend-mode: difference; }
.cursor__ring {
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1px solid rgba(255,255,255,.6);
  mix-blend-mode: difference; display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
}
.cursor__label { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); opacity: 0; transition: opacity .2s; }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--accent); border-color: var(--accent); mix-blend-mode: normal; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-hover .cursor__ring { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: #fff; }

.grain {
  position: fixed; inset: -50%; z-index: 700; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-5%,3%); } 40% { transform: translate(3%,-6%); }
  60% { transform: translate(-7%,-2%); } 80% { transform: translate(6%,5%); } 100% { transform: translate(0,0); }
}

/* phones: thin bar along the top edge; desktop: vertical rail */
.scroll-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 600; background: transparent; }
.scroll-progress i { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* =========================================================
   Nav + mobile menu
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 560;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: calc(var(--nav-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0;
  color: #fff; mix-blend-mode: difference; transition: color .4s;
}
.on-accent .nav, .menu-open .nav { mix-blend-mode: normal; color: var(--ink); }
.nav__logo { font-family: var(--f-display); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; display: inline-block; padding: 10px 0; }
.nav__logo sup { font-size: .5em; }
.nav__links { display: none; }
.nav__time { display: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blinkdot 1.6s infinite; }
@keyframes blinkdot { 50% { opacity: .2; } }

.nav__menu {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px 0 12px;
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.nav__menu-icon { position: relative; width: 26px; height: 12px; }
.nav__menu-icon i { position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; transition: transform .5s var(--ease), top .5s var(--ease); }
.nav__menu-icon i:first-child { top: 1px; }
.nav__menu-icon i:last-child { top: 9px; }
.menu-open .nav__menu-icon i:first-child { top: 5px; transform: rotate(45deg); }
.menu-open .nav__menu-icon i:last-child { top: 5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 550; background: var(--accent); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + env(safe-area-inset-top) + 4vh) var(--gutter) max(24px, env(safe-area-inset-bottom));
  clip-path: circle(0% at calc(100% - 40px) 32px); visibility: hidden;
}
.menu__links { display: flex; flex-direction: column; }
.menu__links a { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; border-bottom: 1px solid rgba(11,11,12,.18); overflow: hidden; }
.menu__n { font-family: var(--f-mono); font-size: 12px; }
.menu__t { display: inline-block; font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: clamp(24px, 7vw, 96px); line-height: 1.05; letter-spacing: -0.05em; }
.menu__links a:active .menu__t { font-family: var(--f-serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -0.02em; }
.menu__foot { display: flex; flex-direction: column; gap: 14px; font-size: 17px; }
.menu__foot > a { font-family: var(--f-serif); font-style: italic; font-size: 30px; }
.menu__foot div { display: flex; gap: 24px; font-family: var(--f-mono); font-size: 13px; text-transform: uppercase; }
.menu__foot div a { padding: 10px 0; }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__inner {
  position: relative; z-index: 2; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--nav-h) + env(safe-area-inset-top) + 8px) var(--gutter) max(20px, env(safe-area-inset-bottom));
}
.hero__meta { display: flex; justify-content: space-between; gap: 16px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(238,235,228,.7); }
.hero__meta span:nth-child(n+2) { display: none; }
.hero__title {
  align-self: center; font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  font-size: 15.5vw; line-height: .9; letter-spacing: -0.055em; color: var(--paper);
}
.hero__title .line { padding-bottom: .02em; }
.line--r { text-align: right; position: relative; }
.hero__star { display: none; }
.hero__bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px 20px; }
.hero__lede { grid-column: 1 / -1; font-size: 21px; line-height: 1.2; max-width: 22ch; letter-spacing: -0.01em; }
.hero__lede em { color: var(--accent); font-size: 1.1em; }
.hero__role { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero__role-label { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: rgba(238,235,228,.55); }
.rotator { position: relative; display: block; height: 1.3em; overflow: hidden; font-size: 17px; font-weight: 500; }
.rotator span { position: absolute; left: 0; top: 0; white-space: nowrap; transform: translateY(110%); }
.rotator span:first-child { transform: none; }
.hero__scroll { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.hero__scroll-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 14s linear infinite; }
.hero__scroll-ring text { font-family: var(--f-mono); font-size: 9.6px; letter-spacing: .18em; fill: var(--paper); }
.hero__scroll-arrow { font-size: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Manifesto + stats
   ========================================================= */
.manifesto { padding: 16vh var(--gutter) 12vh; }
.manifesto__text {
  margin-top: 28px; font-size: clamp(28px, 8vw, 76px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 500;
  max-width: 24ch;
}
.manifesto__text em { color: var(--accent); }
.manifesto__text .w { display: inline-block; text-indent: 0; }
.stats { margin-top: 10vh; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.stat { padding: 22px 14px 22px 0; }
.stat:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.stat strong { display: block; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 13vw, 120px); line-height: .9; letter-spacing: -0.05em; }
.stat > span { display: block; margin-top: 12px; color: var(--muted); font-size: 14px; max-width: 22ch; }

/* =========================================================
   Work — phones: native swipe carousel; desktop: pinned horizontal scroll
   ========================================================= */
.work { position: relative; }
.work__track { display: flex; flex-direction: column; padding: 14vh 0 8vh; }
.work__intro { display: flex; flex-direction: column; gap: 22px; padding: 0 var(--gutter); margin-bottom: 32px; }
.work__hint { display: none; }
.work__rail {
  display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  padding: 4px var(--gutter) 8px; scrollbar-width: none;
}
.work__rail::-webkit-scrollbar { display: none; }
.work__swipe {
  display: flex; align-items: center; gap: 14px; padding: 16px var(--gutter) 0;
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.work__count b { color: var(--fg); font-weight: 500; }
.work__bar { flex: 1; height: 2px; background: var(--line); }
.work__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(.1667); transition: transform .3s; }

.panel {
  flex: 0 0 86vw; max-width: 460px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--ink-2);
  position: relative; overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(255,77,31,.14), transparent 40%);
}
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel__tag { text-align: right; }
.panel__num { color: var(--accent); font-size: 13px; }
.panel__visual {
  height: 230px; flex: none; border-radius: 14px; background: var(--ink); border: 1px solid var(--line);
  position: relative; overflow: hidden; display: grid; place-items: center;
}
.panel__title { font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.02; letter-spacing: -0.03em; }
.panel__text { color: var(--muted); font-size: 15px; line-height: 1.5; }
.panel__tags { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.panel__tags li { font-family: var(--f-mono); font-size: 11px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.panel__result { margin-top: auto; font-size: 15px; }
.panel__result b { font-family: var(--f-display); font-weight: 800; color: var(--accent); font-size: 22px; letter-spacing: -0.02em; margin-right: 6px; }

.work__end { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10vh var(--gutter) 0; }
.work__end p { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 10vw, 88px); line-height: .92; letter-spacing: -0.045em; text-transform: uppercase; }
.work__end em { color: var(--accent); text-transform: none; }
.work__progress { display: none; }

.circle-btn {
  flex-shrink: 0; width: 120px; height: 120px; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; text-align: center; font-weight: 600; line-height: 1.1; font-size: 15px;
  position: relative; overflow: hidden; isolation: isolate; transition: transform .3s var(--ease);
}
.circle-btn::before { content: ""; position: absolute; inset: 0; background: var(--paper); border-radius: 50%; transform: translateY(102%); transition: transform .55s var(--ease); z-index: -1; }
.circle-btn:active { transform: scale(.94); }
.circle-btn--ink { background: var(--ink); color: var(--paper); }

/* --- panel visuals --- */
.v-gate svg { width: 94%; height: auto; overflow: visible; }
.gate__path { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 6 8; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.gate__nodes circle { fill: var(--ink-2); stroke: var(--ink-3); stroke-width: 1.5; }
.gate__nodes text { fill: var(--paper); font-family: var(--f-mono); font-size: 12px; text-anchor: middle; }
.gate__ok circle { stroke: var(--green); fill: rgba(21,182,122,.1); animation: okpulse 2.6s infinite; }
.gate__ok text { fill: var(--green); }
@keyframes okpulse { 0%, 60% { stroke-width: 1.5; } 70% { stroke-width: 6; } 100% { stroke-width: 1.5; } }
.gate__pulse { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.gate__pulse--x { fill: #ff2a55; }

.v-stream { place-items: stretch; padding: 14px; }
.chat { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; height: 100%; }
.chat__q { align-self: flex-end; background: var(--accent); color: var(--ink); padding: 8px 12px; border-radius: 14px 14px 4px 14px; max-width: 85%; font-weight: 500; }
.chat__a { position: relative; background: var(--ink-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 14px 14px 14px 4px; min-height: 80px; color: var(--paper); line-height: 1.5; }
.chat__skel { display: flex; flex-direction: column; gap: 8px; }
.chat__skel i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ink-3), #3a3a3f, var(--ink-3)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.chat__skel i:nth-child(2) { width: 85%; } .chat__skel i:nth-child(3) { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chat__caret { display: inline-block; width: 7px; height: 1em; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.chat__out .tok { animation: tokin .35s ease both; }
@keyframes tokin { from { opacity: 0; filter: blur(4px); } }
.chat__files { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.chat__files span { font-family: var(--f-mono); font-size: 10.5px; padding: 4px 8px; border-radius: 6px; background: var(--ink-3); color: var(--muted); }

.v-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.ds { display: grid; grid-template-columns: repeat(2, auto); gap: 12px; align-items: center; justify-items: center; padding: 14px; }
.ds > * { animation: dsfloat 4s ease-in-out infinite; }
.ds > *:nth-child(odd) { animation-delay: -2s; }
@keyframes dsfloat { 50% { transform: translateY(-6px); } }
.ds__btn { background: var(--paper); color: var(--ink); padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.ds__toggle { width: 46px; height: 26px; border-radius: 99px; background: var(--ink-3); position: relative; }
.ds__toggle i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); animation: tog 2.4s var(--ease) infinite; }
@keyframes tog { 0%, 40% { transform: none; } 50%, 90% { transform: translateX(20px); background: var(--accent); } }
.ds__check { width: 26px; height: 26px; border-radius: 7px; background: var(--violet); color: #fff; display: grid; place-items: center; font-size: 14px; }
.ds__slider { width: 90px; height: 4px; border-radius: 4px; background: var(--ink-3); position: relative; }
.ds__slider i { position: absolute; top: -7px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 3px solid var(--accent); animation: slide 3s ease-in-out infinite alternate; }
@keyframes slide { to { left: 72px; } }
.ds__badge { background: rgba(21,182,122,.15); color: var(--green); font-family: var(--f-mono); font-size: 11px; padding: 4px 9px; border-radius: 99px; }
.ds__avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--violet)); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.ds__input { grid-column: span 2; width: 100%; border: 1px solid var(--ink-3); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.ds__tabs { grid-column: span 2; position: relative; display: flex; background: var(--ink-3); border-radius: 10px; padding: 3px; font-size: 12px; }
.ds__tabs b { position: relative; z-index: 1; font-weight: 500; padding: 5px 12px; }
.ds__tabs i { position: absolute; top: 3px; left: 3px; bottom: 3px; width: 33%; border-radius: 8px; background: var(--ink-2); animation: tabs 4.5s var(--ease) infinite; }
@keyframes tabs { 0%, 28% { transform: none; } 33%, 61% { transform: translateX(100%); } 66%, 95% { transform: translateX(200%); } }

.v-yaml { place-items: stretch; padding: 12px; }
.wiz { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wiz__steps { display: flex; gap: 5px; font-family: var(--f-mono); font-size: 10px; }
.wiz__steps span { flex: 1; padding: 6px 6px; border-radius: 6px; background: var(--ink-3); color: var(--muted); white-space: nowrap; text-align: center; }
.wiz__steps .on { background: rgba(255,77,31,.15); color: var(--accent); }
.wiz__code { margin: 0; font-family: var(--f-mono); font-size: 11.5px; line-height: 1.55; color: var(--paper); white-space: pre-wrap; overflow: hidden; }
.wiz__code .k { color: var(--accent); } .wiz__code .s { color: var(--green); }

.dev { position: absolute; border: 1px solid var(--ink-3); background: var(--ink-2); border-radius: 12px; overflow: hidden; }
.dev--web { width: 70%; height: 72%; left: 7%; top: 12%; }
.dev--phone { width: 28%; height: 80%; right: 7%; top: 10%; border-radius: 18px; animation: dsfloat 5s ease-in-out infinite; box-shadow: -20px 20px 40px rgba(0,0,0,.5); }
.dev__bar { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--ink-3); }
.dev__bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.dev__screen { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dev__card { height: 54px; border-radius: 8px; background: linear-gradient(120deg, var(--accent), var(--violet)); animation: hue 6s linear infinite; }
.dev--phone .dev__card { height: 64px; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.dev__line { height: 7px; border-radius: 4px; background: var(--ink-3); }
.dev__line.s { width: 60%; }

/* =========================================================
   Marquee
   ========================================================= */
.marquee { padding: 8vh 0; overflow: hidden; }
.marquee__row { white-space: nowrap; overflow: hidden; }
.marquee__row + .marquee__row { margin-top: 2vw; }
.marquee__inner { display: inline-flex; align-items: center; will-change: transform; }
.marquee__inner span { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: clamp(48px, 14vw, 170px); line-height: 1; letter-spacing: -0.05em; padding: 0 .25em; }
.marquee__inner em { font-style: normal; color: var(--accent); font-size: clamp(30px, 8vw, 100px); }
.marquee__row--alt span { color: transparent; -webkit-text-stroke: 1.2px var(--fg); }

/* =========================================================
   Experience
   ========================================================= */
.experience { padding: 14vh var(--gutter) 8vh; }
.experience__head { display: flex; flex-direction: column; gap: 22px; margin-bottom: 7vh; }
.exp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.exp { border-bottom: 1px solid var(--line); position: relative; }
.exp__row {
  width: 100%; display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 6px 12px;
  padding: 22px 0; min-height: 64px; text-align: left; position: relative; isolation: isolate;
}
.exp__row::before { content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1; background: var(--fg); opacity: 0; transition: opacity .2s; }
.exp__row:active::before { opacity: .06; }
.exp__year { grid-column: 1; grid-row: 1; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.exp__metric {
  grid-column: 1; grid-row: 1; justify-self: end; margin-right: 4px;
  font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--ink); white-space: nowrap;
}
.exp__role { grid-column: 1; font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 6.4vw, 44px); line-height: 1.02; letter-spacing: -0.035em; }
.exp__role small { font-family: var(--f-mono); font-weight: 400; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; margin-left: 6px; opacity: .6; }
.exp__co { grid-column: 1; font-size: 15px; }
.exp__plus { grid-column: 2; grid-row: 1 / span 3; position: relative; width: 22px; height: 22px; justify-self: end; }
.exp__plus::before, .exp__plus::after { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px; background: currentColor; transition: transform .45s var(--ease); }
.exp__plus::after { transform: rotate(90deg); }
.exp.is-open .exp__plus::after { transform: rotate(0); }
.exp.is-open .exp__plus::before { transform: rotate(180deg); }
.exp__body { height: 0; overflow: hidden; }
.exp__body ul { margin: 0; padding: 0 0 26px; list-style: none; display: grid; grid-template-columns: 1fr; gap: 12px; color: var(--muted); font-size: 15.5px; }
.exp__body li { position: relative; padding-left: 20px; }
.exp__body li::before { content: "↳"; position: absolute; left: 0; color: var(--accent); }
.edu { margin-top: 32px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.exp-float { display: none; }

/* =========================================================
   Skills (stacking cards)
   ========================================================= */
.skills { padding: 10vh var(--gutter) 14vh; }
.skills__head { display: flex; flex-direction: column; gap: 22px; margin-bottom: 6vh; }
.stack { position: relative; }
.stack-card {
  position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--i, 0) * 10px);
  min-height: 62vh; min-height: 62svh; margin-bottom: 6vh; border-radius: 24px; padding: 24px;
  display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; gap: 16px;
  transform-origin: 50% 0; will-change: transform; overflow: hidden;
}
.stack-card:last-child { margin-bottom: 0; }
.stack-card__n { font-family: var(--f-mono); font-size: 13px; }
.stack-card h3 { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: clamp(24px, 7.2vw, 110px); line-height: .92; letter-spacing: -0.05em; }
.stack-card p { align-self: end; font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; max-width: 34ch; }
.c-ink { background: var(--ink); color: var(--paper); }
.c-ink .stack-card__n { color: var(--accent); }
.c-accent { background: var(--accent); color: var(--ink); }
.c-white { background: var(--white); color: var(--ink); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.c-white .stack-card__n { color: var(--accent); }
.c-violet { background: var(--violet); color: var(--white); }

/* =========================================================
   Contact
   ========================================================= */
.contact {
  position: relative; min-height: 100vh; min-height: 100svh; background: var(--accent); color: var(--ink);
  padding: calc(var(--nav-h) + 8vh) var(--gutter) max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  --muted: rgba(11,11,12,.6); --line: rgba(11,11,12,.2);
}
.contact .label span { color: var(--ink); }
.contact__big {
  margin-top: 3vh; font-family: var(--f-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(64px, 22vw, 260px); line-height: .86; letter-spacing: -0.05em;
}
.contact__big .char { font-variation-settings: "wght" 700; }
.contact__sub { margin-top: 24px; font-size: 18px; max-width: 36ch; }
.contact__mail {
  margin-top: 4vh; align-self: flex-start; position: relative; max-width: 100%;
  font-family: var(--f-serif); font-style: italic; font-size: clamp(30px, 9vw, 104px); line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.contact__mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.04em; height: .05em; min-height: 2px; background: currentColor; transform-origin: right; transition: transform .6s var(--ease); }
.contact__row { margin-top: 5vh; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.contact__row .circle-btn { grid-row: 1 / span 3; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border-radius: 99px; border: 1.5px solid var(--ink);
  font-weight: 500; position: relative; overflow: hidden; isolation: isolate; transition: color .45s var(--ease), transform .2s;
}
.pill::before { content: ""; position: absolute; inset: 0; background: var(--ink); transform: translateY(101%); transition: transform .45s var(--ease); z-index: -1; border-radius: inherit; }
.pill:active { transform: scale(.96); }
.footer { margin-top: auto; padding-top: 8vh; display: flex; flex-direction: column; gap: 10px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.footer a { padding: 8px 0; }

/* =========================================================
   FX layer
   ========================================================= */
.loader__strips { position: absolute; inset: 0; z-index: -1; display: flex; }
.loader__strips i { flex: 1; background: var(--accent); margin-right: -1px; }

.curtain { position: fixed; inset: 0; z-index: 850; pointer-events: none; visibility: hidden; }
.curtain.is-active { pointer-events: auto; }
.curtain__strips { position: absolute; inset: 0; display: flex; }
.curtain__strips i { flex: 1; margin-right: -1px; transform: scaleY(0); transform-origin: 50% 100%; }
.curtain__strips i:nth-child(1) { background: var(--accent); }
.curtain__strips i:nth-child(2) { background: var(--ink); }
.curtain__strips i:nth-child(3) { background: var(--violet); }
.curtain__strips i:nth-child(4) { background: var(--paper); }
.curtain__strips i:nth-child(5) { background: var(--accent); }
.curtain__label {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase; color: #fff; mix-blend-mode: difference;
  font-size: clamp(30px, 8.6vw, 200px); letter-spacing: -0.05em; line-height: 1; text-align: center;
}
.curtain__label > span { display: block; overflow: hidden; padding: 0 .05em; }

.fx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.trail { position: fixed; inset: 0; z-index: 790; pointer-events: none; display: none; }
.has-cursor .trail { display: block; }
.trail { transition: opacity .3s; }
.cursor-label .trail { opacity: 0; }
.trail i { position: fixed; left: 0; top: 0; border-radius: 50%; background: #fff; mix-blend-mode: difference; will-change: transform; }

.ripple {
  position: fixed; z-index: 780; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 1.5px solid var(--accent); pointer-events: none;
}

/* chromatic aberration + skew driven by scroll velocity (vars set in JS) */
:root { --rgb: 0; --rgbA: 0; --skew: 0; }
.hero__title, .big-heading, .marquee__row:not(.marquee__row--alt) span, .contact__big, .stat strong, .stack-card h3 {
  text-shadow:
    calc(var(--rgb) * 1px) 0 0 rgba(255, 60, 40, var(--rgbA)),
    calc(var(--rgb) * -1px) 0 0 rgba(40, 200, 255, var(--rgbA));
}
.big-heading, .manifesto__text, .stats { transform: skewY(calc(var(--skew) * 1deg)); }

/* odometer digits */
.odo { display: inline-block; height: 1em; overflow: hidden; line-height: 1; vertical-align: top; }
.odo__strip { display: block; }
.odo__strip span { display: block; height: 1em; text-align: center; }
.stat strong { white-space: nowrap; line-height: 1 !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3D skill sphere */
.sphere {
  position: relative; width: min(92vw, 520px); aspect-ratio: 1; margin: 2vh auto 0; align-self: center;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.sphere:active { cursor: grabbing; }
.sphere__glow {
  position: absolute; inset: 18%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, rgba(255,77,31,.45), rgba(107,91,255,.25) 45%, transparent 70%);
  filter: blur(30px); animation: glowpulse 5s ease-in-out infinite;
}
@keyframes glowpulse { 50% { transform: scale(1.12); opacity: .7; } }
.sphere__inner { position: absolute; inset: 0; }
.sphere__tag {
  position: absolute; left: 50%; top: 50%; white-space: nowrap; will-change: transform, opacity;
  font-family: var(--f-display); font-weight: 700; font-size: clamp(13px, 3.6vw, 20px); letter-spacing: -0.02em;
  transform: translate(-50%, -50%);
}
.sphere__tag.hot { color: var(--accent); }
.sphere__tag.mono { font-family: var(--f-mono); font-weight: 400; font-size: clamp(11px, 2.8vw, 14px); text-transform: uppercase; letter-spacing: .06em; }
.sphere__hint {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}

.contact__big .char { cursor: pointer; }

@media (min-width: 900px) {
  .skills__head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 4vw; }
  .skills__head .label { grid-column: 1 / -1; }
  .sphere { width: min(38vw, 540px); margin: 0 2vw 0 0; }
  .skills__head .big-heading { font-size: clamp(48px, 8.4vw, 150px); }
}

/* =========================================================
   Pre-animation states (only when JS + motion are on)
   ========================================================= */
.anim .hero-fade { opacity: 0; }
.anim .hero__title .char { transform: translateY(110%); }
.anim .hero__star { opacity: 0; }

/* =========================================================
   ≥ 600px — large phones / small tablets
   ========================================================= */
@media (min-width: 600px) {
  :root { --gutter: max(28px, env(safe-area-inset-left)); }
  body { font-size: 17px; }
  .hero__meta span:nth-child(3) { display: inline; }
  .hero__title { font-size: 14vw; line-height: .84; }
  .hero__star { display: inline-block; position: absolute; left: 4%; top: 50%; font-style: normal; font-family: var(--f-sans); font-size: .32em; color: var(--accent); transform: translateY(-50%); }
  .hero__lede { font-size: 24px; }
  .hero__scroll { width: 108px; height: 108px; }
  .manifesto__text { text-indent: 12vw; }
  .panel { flex-basis: 62vw; }
  .panel__visual { height: 260px; }
  .ds { grid-template-columns: repeat(4, auto); }
  .contact__row { display: flex; flex-wrap: wrap; }
  .footer { flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
  .stack-card { padding: 40px; }
}

/* =========================================================
   ≥ 900px — desktop
   ========================================================= */
@media (min-width: 900px) {
  :root { --gutter: clamp(28px, 3vw, 40px); --nav-h: 76px; }
  .label { font-size: 12px; gap: 12px; }

  /* nav */
  .nav__links { display: flex; gap: 32px; }
  .nav__links a { position: relative; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; padding: 8px 0; }
  .nav__links a::after { content: ""; position: absolute; left: 0; bottom: 2px; width: 100%; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
  .nav__time { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .nav__menu, .menu { display: none; }
  .nav__logo { font-size: 20px; }

  .scroll-progress { left: auto; right: 10px; top: 50%; width: 2px; height: 120px; margin-top: -60px; background: rgba(255,255,255,.12); mix-blend-mode: difference; }
  .scroll-progress i { background: #fff; transform-origin: top; transform: scaleY(0); }

  /* hero */
  .hero { min-height: 640px; }
  .hero__meta { font-size: 12px; }
  .hero__meta span:nth-child(n+2) { display: inline; }
  .hero__title { font-size: clamp(64px, 13.2vw, 260px); line-height: .82; }
  .hero__bottom { grid-template-columns: 1.3fr 1fr auto; gap: 32px; }
  .hero__lede { grid-column: auto; font-size: clamp(20px, 2vw, 28px); }
  .hero__role-label { font-size: 11px; }
  .rotator { font-size: clamp(18px, 1.6vw, 24px); }
  .hero__scroll { width: 120px; height: 120px; }

  /* manifesto */
  .manifesto { padding: 22vh var(--gutter) 16vh; }
  .manifesto__text { margin-top: 40px; font-size: clamp(30px, 4.6vw, 76px); line-height: 1.04; }
  .stats { margin-top: 18vh; grid-template-columns: repeat(4, 1fr); }
  .stat, .stat:nth-child(n) { padding: 28px 24px 0; border-top: 0; }
  .stat:first-child { padding-left: 0; }
  .stat + .stat { border-left: 1px solid var(--line); }
  .stat strong { font-size: clamp(48px, 7vw, 120px); }
  .stat > span { margin-top: 16px; font-size: 15px; }

  /* work: pinned horizontal */
  .work { height: 100vh; height: 100svh; overflow: hidden; }
  .work__track { flex-direction: row; align-items: stretch; gap: 3vw; height: 100%; padding: 110px var(--gutter) 70px; width: max-content; will-change: transform; }
  .work__intro { width: 38vw; justify-content: space-between; flex-shrink: 0; padding: 0; margin: 0; gap: 0; }
  .work__hint { display: block; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .work__hint span { display: inline-block; animation: nudge 1.4s var(--ease) infinite; color: var(--accent); }
  .work__rail { overflow: visible; scroll-snap-type: none; padding: 0; gap: 3vw; }
  .work__swipe { display: none; }
  .panel { flex: 0 0 auto; width: min(560px, 42vw); max-width: none; height: 100%; padding: 24px; gap: 14px; border-radius: 22px; }
  .panel__head { font-size: 11.5px; }
  .panel__visual { height: auto; flex: 1; min-height: 160px; }
  .panel__title { font-size: clamp(24px, 2.2vw, 34px); }
  .panel__tags { margin-top: 0; }
  .panel__result { margin-top: 0; }
  .work__end { flex-shrink: 0; width: 34vw; flex-direction: column; justify-content: center; align-items: flex-start; gap: 40px; padding: 0 0 0 4vw; }
  .work__progress { display: block; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 30px; height: 2px; background: var(--line); }
  .work__progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
  .circle-btn { width: 160px; height: 160px; font-size: 17px; }
  .chat { font-size: 14px; gap: 12px; }
  .wiz__steps { font-size: 11px; }
  .wiz__code { font-size: 12.5px; }

  /* marquee */
  .marquee { padding: 10vh 0; }
  .marquee__row + .marquee__row { margin-top: 1vw; }
  .marquee__inner span { font-size: clamp(56px, 10vw, 170px); }
  .marquee__inner em { font-size: clamp(36px, 6vw, 100px); }
  .marquee__row--alt span { -webkit-text-stroke-width: 1.5px; }

  /* experience */
  .experience { padding: 18vh var(--gutter) 10vh; }
  .experience__head { gap: 32px; margin-bottom: 10vh; }
  .exp__row { grid-template-columns: 170px 1.4fr 1fr 40px; gap: 24px; padding: 34px 0; overflow: hidden; }
  .exp__row::before { inset: 0; opacity: 1; transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); }
  .exp.is-open .exp__row::before { transform: scaleY(1); }
  .exp__row > * { transition: transform .55s var(--ease), color .35s; }
  .exp.is-open .exp__row > * { color: var(--bg); }
  .exp__year { grid-column: auto; grid-row: auto; font-size: 13px; padding-left: 8px; }
  .exp__metric { display: none; }
  .exp__role, .exp__co { grid-column: auto; }
  .exp__co { font-size: 17px; }
  .exp__plus { grid-column: auto; grid-row: auto; margin-right: 8px; }
  .exp__body ul { padding: 28px 8px 36px calc(170px + 24px); grid-template-columns: 1fr 1fr; gap: 14px 40px; font-size: 16px; }
  .edu { margin-top: 40px; font-size: 13px; }

  /* skills */
  .skills { padding: 12vh var(--gutter) 20vh; }
  .skills__head { gap: 32px; margin-bottom: 8vh; }
  .stack-card {
    top: calc(12vh + var(--i, 0) * 14px); min-height: 56vh; margin-bottom: 8vh; border-radius: 28px; padding: clamp(24px, 4vw, 56px);
    grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 20px 40px;
  }
  .stack-card__n { padding-top: 12px; }
  .stack-card h3 { font-size: clamp(38px, 6.4vw, 110px); line-height: .9; }
  .stack-card p { grid-column: 2; font-size: clamp(20px, 2.2vw, 34px); line-height: 1.2; }

  /* contact */
  .contact { padding: 16vh var(--gutter) 28px; }
  .contact__big { margin-top: 4vh; font-size: clamp(64px, 14.2vw, 260px); line-height: .82; white-space: nowrap; }
  .contact__sub { margin-top: 32px; font-size: clamp(18px, 1.6vw, 24px); }
  .contact__mail { margin-top: 5vh; font-size: clamp(36px, 6vw, 104px); }
  .contact__row { margin-top: 6vh; gap: 14px; }
  .pill { padding: 16px 26px; }
  .footer { padding-top: 10vh; font-size: 12px; }
  .footer a { padding: 0; }

  /* floating experience card (mouse only, see below) */
  .exp-float {
    display: flex; position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
    width: 260px; height: 180px; margin: -90px 0 0 -130px; border-radius: 18px;
    background: var(--accent); color: #fff; padding: 18px;
    flex-direction: column; justify-content: space-between;
    transform: scale(0); opacity: 0; box-shadow: 0 30px 60px rgba(0,0,0,.25);
  }
  .exp-float__co { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
  .exp-float__metric { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: .95; letter-spacing: -0.04em; }
}
@keyframes nudge { 50% { transform: translateX(8px); } }

/* =========================================================
   Hover-capable, fine pointers only
   ========================================================= */
@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
  .panel:hover::before { opacity: 1; }
  .circle-btn:hover::before { transform: none; }
  .circle-btn--ink:hover { color: var(--ink); }
  .pill:hover { color: var(--accent); }
  .pill:hover::before { transform: none; }
  .contact__mail:hover::after { transform: scaleX(0); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .exp__row:hover::before { transform: scaleY(1); }
  .exp__row:hover > * { color: var(--bg); }
  .exp__row:hover .exp__role { transform: translateX(16px); }
}
/* touch-first large screens (e.g. iPad landscape): inline metrics, no floating card */
@media (min-width: 900px) and ((hover: none) or (pointer: coarse)) {
  .exp-float { display: none; }
  .exp__row { grid-template-columns: 170px 1.4fr 1fr auto 40px; }
  .exp__metric { display: inline-block; grid-row: auto; grid-column: auto; order: 1; }
  .exp__plus { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .grain { display: none; }
}
