:root {
  --ink: #07080a;
  --ink-2: #0d0f13;
  --paper: #ecebe6;
  --muted: #8b8d93;
  --line: rgba(236, 235, 230, 0.12);
  --oak: #e3a868;
  --cyan: #7fd3ff;
  --violet: #b59cff;
  --mint: #7ef0c6;
  --accent: var(--cyan);
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Geist", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.oak { color: var(--oak); }
.cyan { color: var(--cyan); }
.dim { color: var(--muted); }
::selection { background: var(--oak); color: var(--ink); }

/* ---------- layers ---------- */
.webgl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(0,0)} }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,0.65) 100%); }
main { position: relative; z-index: 2; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--ink); display: grid; place-items: center; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loader__name { font-family: "Instrument Serif", serif; font-style: italic; font-size: clamp(28px, 5vw, 54px); }
.loader__count { color: var(--muted); font-size: 13px; }
.loader__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 48px; height: 1px; background: var(--line); }
.loader__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--oak), var(--cyan)); }
html:not(.js) .loader { display: none; }

/* ---------- cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(236,235,230,0.5); border-radius: 50%; display: grid; place-items: center; transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), background .4s var(--ease), border-color .4s; }
.cursor__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--paper); transition: opacity .3s; }
.cursor__label { position: absolute; font-size: 10px; color: var(--ink); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.cursor.is-active { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--paper); border-color: transparent; }
.cursor.is-active .cursor__label { opacity: 1; }
.cursor.is-active .cursor__dot { opacity: 0; }
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor { display: none; } }
@media (pointer: fine) { html.js.has-cursor, html.js.has-cursor a { cursor: none; } }

/* ---------- HUD ---------- */
.hud { position: fixed; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud--top { top: 0; mix-blend-mode: difference; }
.hud--bottom { bottom: 0; color: var(--muted); gap: 24px; }
.mark { display: inline-flex; align-items: baseline; font-size: 22px; font-weight: 600; letter-spacing: -0.04em; }
.mark__a { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; font-size: 26px; margin-left: 1px; }
.nav { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav a { position: relative; padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.hud__meta { display: flex; align-items: center; gap: 8px; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(126,240,198,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(126,240,198,0); } 100% { box-shadow: 0 0 0 0 rgba(126,240,198,0); } }
.hud__chapter { min-width: 200px; color: var(--paper); }
.hud__sep { color: var(--muted); margin: 0 4px; }
.hud__progress { flex: 1; max-width: 420px; height: 1px; background: var(--line); }
.hud__progress span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--oak), var(--cyan)); }
.hud__coords { min-width: 200px; text-align: right; }

/* ---------- shared ---------- */
section, .work-intro { position: relative; padding: 0 var(--gutter); }
.label { color: var(--muted); margin: 0 0 28px; }
.eyebrow { color: var(--muted); margin: 0 0 24px; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 14vh; }
.hero__title { margin: 0; font-weight: 500; font-size: clamp(56px, 13.5vw, 230px); line-height: 0.86; letter-spacing: -0.055em; }
.hero__line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__word { display: inline-block; }
.hero__word.serif { font-weight: 400; letter-spacing: -0.03em; }
.hero__sub { max-width: 520px; margin: 32px 0 0; font-size: clamp(16px, 1.4vw, 20px); color: rgba(236,235,230,.78); font-weight: 300; }
.hero__sub em { font-size: 1.2em; }
.hero__scroll { position: absolute; right: var(--gutter); bottom: 14vh; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.hero__scroll-line { width: 48px; height: 1px; background: var(--muted); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--paper); animation: scan 2.2s var(--ease) infinite; }
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- manifesto ---------- */
.manifesto { padding-top: 22vh; padding-bottom: 22vh; }
.manifesto__text { margin: 0; max-width: 1180px; font-size: clamp(28px, 4.2vw, 64px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 400; }
.manifesto__text .w { opacity: 0.14; transition: none; }

/* ---------- work ---------- */
.work-intro { padding-top: 10vh; padding-bottom: 8vh; }
.big-head { margin: 0; font-size: clamp(44px, 8vw, 132px); line-height: 0.94; letter-spacing: -0.05em; font-weight: 500; }
.big-head .serif { font-weight: 400; }

.project { min-height: 135vh; display: flex; align-items: center; }
.project--right { justify-content: flex-end; }
.project__card {
  position: relative; width: min(560px, 100%); padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(160deg, rgba(20,22,28,.72), rgba(10,11,14,.55));
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transform-style: preserve-3d; will-change: transform;
  box-shadow: 0 40px 120px -40px rgba(0,0,0,.8);
}
.project__card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--accent), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; pointer-events: none; }
.project__head { display: flex; justify-content: space-between; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.project__head span:first-child { color: var(--accent); }
.project__title { margin: 0 0 22px; font-size: clamp(42px, 5.4vw, 84px); line-height: .92; letter-spacing: -0.05em; font-weight: 500; }
.project__title .serif { font-weight: 400; color: var(--accent); }
.project__lede { margin: 0 0 26px; color: rgba(236,235,230,.78); font-size: 16px; font-weight: 300; }
.project__facts { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 0; }
.project__facts li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.project__facts li .mono { color: var(--muted); font-size: 11px; padding-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; font-size: 15px; transition: background .5s var(--ease), color .5s var(--ease); }
.btn:hover { background: var(--accent); }
.btn__arrow { display: inline-block; transition: transform .5s var(--ease); }
.btn:hover .btn__arrow { transform: translate(3px, -3px); }
.btn--ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn--big { font-size: clamp(16px, 1.4vw, 20px); padding: 20px 32px; }

/* ---------- stack ---------- */
.stack { padding: 20vh 0 18vh; }
.stack > .label, .pillars { margin-left: var(--gutter); margin-right: var(--gutter); }
.marquee { overflow: hidden; white-space: nowrap; border-top: 1px solid var(--line); padding: 2vh 0; }
.marquee:last-of-type { border-bottom: 1px solid var(--line); }
.marquee__track { display: inline-flex; align-items: center; gap: 4vw; padding-right: 4vw; font-size: clamp(48px, 9vw, 150px); letter-spacing: -0.05em; line-height: 1; font-weight: 500; will-change: transform; }
.marquee__track i { font-style: normal; font-size: .35em; color: var(--oak); }
.marquee--rev .marquee__track { color: transparent; -webkit-text-stroke: 1px rgba(236,235,230,.5); }
.marquee--rev .marquee__track .serif { color: var(--oak); -webkit-text-stroke: 0; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 12vh; }
.pillar { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: rgba(10,11,14,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pillar .mono { color: var(--oak); }
.pillar h4 { margin: 18px 0 10px; font-size: 26px; font-weight: 500; letter-spacing: -0.03em; }
.pillar p { margin: 0; color: rgba(236,235,230,.7); font-weight: 300; font-size: 15px; }

/* ---------- contact ---------- */
.contact { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 16vh; }
.contact__title { margin: 0 0 48px; font-size: clamp(60px, 13vw, 220px); line-height: .86; letter-spacing: -0.055em; font-weight: 500; }
.contact__title .serif { font-weight: 400; color: var(--oak); }
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer { margin-top: auto; padding: 60px 0 80px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 18vh; }

/* ---------- motion pre-states (only with JS + motion) ---------- */
html.has-motion [data-reveal], html.has-motion [data-reveal-item], html.has-motion [data-hero-item] { visibility: hidden; }
html.has-motion [data-hero-word] { transform: translateY(110%); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .project, .project--right { justify-content: center; align-items: flex-end; min-height: 120vh; padding-bottom: 12vh; }
  .project__card { background: linear-gradient(160deg, rgba(16,18,23,.86), rgba(9,10,13,.8)); }
  .hud__coords, .hud__progress { display: none; }
  .hud__chapter { min-width: 0; }
  .hud__meta { display: none; }
  .hero__scroll { display: none; }
  .hero { padding-bottom: 12vh; }
}
@media (max-width: 520px) {
  .nav { gap: 14px; }
  .project__facts li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .pulse, .hero__scroll-line::after { animation: none; }
}
