:root {
  --ink: #13151d;      /* charcoal navy */
  --ink-2: #1d2030;
  --cream: #f2ece1;    /* warm bone */
  --sand: #e6dfd0;     /* gallery wall */
  --accent: #a27e33;   /* antique gold (footer) */
  --muted: rgba(242, 236, 225, 0.28);
  --bg: var(--ink);
  --fg: var(--cream);
  --display: "Marcellus", "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --gutter: clamp(16px, 2.4vw, 36px);
  --ease: cubic-bezier(0.6, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.8s var(--ease), color 0.8s var(--ease);
  -webkit-font-smoothing: antialiased;
}
body.theme-light { --bg: var(--sand); --fg: var(--ink); --muted: rgba(19, 21, 29, 0.22); }
body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Text roll (hover) ---------- */
.roll { display: inline-flex; flex-direction: column; overflow: hidden; height: 1.25em; line-height: 1.25em; vertical-align: top; }
.roll-row { display: block; white-space: pre; }
.roll .ch { display: inline-block; transition: transform 0.5s var(--ease) calc(var(--i) * 16ms); }
a:hover .roll .ch, .roll:hover .ch { transform: translateY(-100%); }

/* ---------- Chips & buttons ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; line-height: 1; padding: 7px 10px;
  border-radius: 4px; background: rgba(242, 236, 225, 0.08);
  color: inherit; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
body.theme-light .chip { background: rgba(19, 21, 29, 0.07); }
.chip-dark, body.theme-light .chip-dark { background: rgba(19, 21, 29, 0.55); color: var(--cream); }
.chip-line { background: transparent !important; border: 1px solid currentColor; opacity: 0.6; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; padding: 10px 14px; border-radius: 4px;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.btn .arrow { display: inline-block; transition: transform 0.5s var(--ease); font-size: 13px; }
.btn:hover .arrow { transform: translate(2px, -2px) rotate(45deg); }
.btn-solid { background: var(--cream); color: var(--ink); }
body.theme-light .btn-solid, .btn-ink { background: var(--ink); color: var(--cream); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--ink);
  display: grid; place-items: center;
  transition: transform 1.1s var(--ease) 0.1s, opacity 0.6s ease 0.5s;
}
.loader-name { font-family: var(--display); font-size: clamp(48px, 9vw, 120px); color: var(--cream); display: flex; gap: 0.35em; line-height: 1; }
.loader-word.dim { opacity: 0.45; }
.loader .ch { display: inline-block; opacity: 0; transform: translateY(40%); filter: blur(6px); animation: rise 0.9s var(--ease-out) forwards; animation-delay: calc(0.1s + var(--g) * 70ms); }
body.is-loaded .loader { transform: translateY(-100%); opacity: 0; pointer-events: none; }

@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--gutter);
  color: var(--cream);
  transition: color 0.8s var(--ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
body.theme-light .nav { color: var(--ink); }
.nav-logo {
  font-family: var(--display); font-size: 22px; letter-spacing: 0.02em;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
body.scrolled .nav-logo { opacity: 1; transform: none; }
.nav-right { display: flex; gap: 6px; align-items: center; }
.nav-pill {
  display: flex; gap: 14px; padding: 10px 14px; border-radius: 4px; font-size: 14px;
  background: rgba(19, 21, 29, 0.35); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.8s var(--ease);
}
body.theme-light .nav-pill { background: rgba(230, 223, 208, 0.6); }
body.on-accent .nav { color: var(--cream); }
body.on-accent .nav-pill { background: rgba(19, 21, 29, 0.25); }

/* ---------- Hero ---------- */
.hero { position: relative; contain: paint; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.hero-media { position: absolute; inset: 0; will-change: transform; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.12);
  transition: opacity 1.8s ease, transform 7s linear;
}
.hero-slide.is-active { opacity: 1; transform: scale(1); }
.hero-shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(19,21,29,0.55) 0%, rgba(19,21,29,0.1) 35%, rgba(19,21,29,0.15) 60%, rgba(19,21,29,0.7) 100%); }

.hero-title { position: absolute; inset: 0; font-family: var(--display); font-weight: 400; color: var(--cream); pointer-events: none; }
.hero-word { position: absolute; font-size: clamp(72px, 15.5vw, 260px); line-height: 0.85; letter-spacing: 0.01em; will-change: transform; }
.hero-word--top { top: calc(var(--gutter) * 0.9); left: var(--gutter); }
.hero-word--bottom { right: var(--gutter); bottom: calc(var(--gutter) * 0.6); }
.hero-word .ch { display: inline-block; opacity: 0; transform: translateY(30%); filter: blur(8px); }
body.is-loaded .hero-word .ch { animation: rise 1.1s var(--ease-out) forwards; animation-delay: calc(0.75s + var(--g) * 60ms); }

.hero-caption { position: absolute; left: var(--gutter); top: calc(var(--gutter) + clamp(72px, 15.5vw, 260px) * 0.95); display: flex; gap: 6px; color: var(--cream); }
.hero-name { transition: opacity 0.6s ease; }

.hero-foot { position: absolute; left: var(--gutter); bottom: calc(var(--gutter) * 1.2); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; color: var(--cream); }
.hero-tag { font-size: 15px; line-height: 1.3; }
.hero-caption, .hero-foot { opacity: 0; transform: translateY(12px); transition: opacity 1s var(--ease) 1.4s, transform 1s var(--ease) 1.4s; }
body.is-loaded .hero-caption, body.is-loaded .hero-foot { opacity: 1; transform: none; }

/* ---------- Statement (word reveal) ---------- */
.statement { position: relative; z-index: 1; padding: 22vh var(--gutter); }
.statement-text { font-size: clamp(34px, 6.2vw, 96px); line-height: 1.02; letter-spacing: -0.025em; max-width: 15ch; font-weight: 400; }
.statement-text { margin-left: 0; }
.reveal-words .w { color: inherit; }
.reveal-words .nowrap { white-space: nowrap; }
.statement--light .statement-text { margin-left: auto; text-align: right; max-width: 18ch; }

/* ---------- Full-bleed image ---------- */
.bleed { padding: 0 var(--gutter) 10vh; }
.bleed-frame { position: relative; height: 92vh; overflow: hidden; border-radius: 2px; clip-path: inset(8% 6% 8% 6%); transition: clip-path 0.1s linear; }
.parallax-img { width: 100%; height: 120%; object-fit: cover; will-change: transform; }
.bleed-labels { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; }

/* ---------- Works ---------- */
.works { padding: 12vh var(--gutter) 16vh; }
.works-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6vh; }
.section-title { font-family: var(--sans); font-weight: 400; font-size: clamp(44px, 6vw, 92px); line-height: 0.98; letter-spacing: -0.03em; }
.works-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); row-gap: 12vh; }
.work:nth-child(even) { transform: translateY(22vh); }
.work:nth-child(even).fade-up { transform: translateY(calc(22vh + 60px)); }
.work:nth-child(even).fade-up.in { transform: translateY(22vh); }
.work-img { overflow: hidden; aspect-ratio: 4 / 3.2; background: var(--ink-2); }
.work-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.4s var(--ease-out); }
.work:hover .work-img img { transform: scale(1.0); }
.work-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.work-meta h3 { font-weight: 400; font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); padding: 26vh var(--gutter) 16vh; align-items: start; }
.about-text { position: sticky; top: 14vh; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; max-width: 520px; }
.about-title { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 5.5vw, 84px); line-height: 0.95; }
.about-body p { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; margin-bottom: 1em; }
.about-img { overflow: hidden; height: 120vh; max-height: 1100px; }

/* ---------- Zoom ---------- */
.zoom { height: 420vh; position: relative; }
.zoom-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; perspective: 800px; }
.zoom-lines { position: absolute; width: min(92vw, 1100px); stroke: var(--cream); stroke-width: 0.6; opacity: 0.22; will-change: transform; }
.zoom-items { position: absolute; inset: 0; }
.zoom-item { position: absolute; left: 50%; top: 50%; opacity: 0; will-change: transform, opacity; box-shadow: 0 30px 60px rgba(0,0,0,0.45); }
.zoom-title { position: relative; z-index: 2; text-align: center; font-weight: 400; font-size: clamp(48px, 8.4vw, 136px); line-height: 0.98; letter-spacing: -0.035em; mix-blend-mode: normal; }

/* ---------- Framed horizontal ---------- */
.framed { position: relative; }
.framed-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 6vh; }
.framed-head { padding: 0 var(--gutter); display: flex; justify-content: space-between; align-items: flex-end; }
.framed-track { display: flex; gap: 6vw; padding: 0 var(--gutter); width: max-content; will-change: transform; align-items: flex-end; }
.framed-track figure { flex: none; }
.framed-track img { height: 48vh; width: auto; box-shadow: 0 30px 50px rgba(19,21,29,0.25); }
.framed-track figcaption { font-size: 13px; margin-top: 12px; opacity: 0.7; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); padding: 12vh var(--gutter) 6vh; text-align: center; }
.fact { display: flex; flex-direction: column; gap: 8px; }
.fact-num { font-family: var(--display); font-size: clamp(26px, 3vw, 44px); line-height: 1.05; }
.fact-label { font-size: 12px; opacity: 0.6; }

/* ---------- Roots ---------- */
.roots { padding: 14vh var(--gutter) 16vh; }
.roots-title { font-size: clamp(56px, 10vw, 160px); margin-bottom: 6vh; }
.roots-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: end; }
.roots-copy { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; max-width: 460px; }
.roots-copy p { font-size: 17px; line-height: 1.5; }
.roots-img { overflow: hidden; height: 78vh; }

/* ---------- Footer ---------- */
.footer { background: var(--accent); color: var(--cream); padding: 16vh var(--gutter) var(--gutter); overflow: hidden; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gutter); }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 16px; }
.footer-col--right { align-items: flex-end; }
.footer-col .chip-num, .footer-label { display: inline-flex; }
.footer-col .chip-num { background: rgba(255,255,255,0.12); padding: 5px 8px; font-size: 11px; }
.footer-label { font-size: 12px; opacity: 0.7; margin: -22px 0 14px 30px; }
.footer-col--right .footer-label { margin: -22px 30px 14px 0; }
.footer-col--right .chip-num { align-self: flex-end; }
.footer-name { font-family: var(--display); font-size: 19.5vw; line-height: 0.95; white-space: nowrap; margin: 10vh calc(var(--gutter) * -1) 4vh; overflow: hidden; }
.marquee { display: inline-flex; align-items: center; width: max-content; animation: marquee 56s linear infinite; animation-play-state: paused; will-change: transform; }
.marquee span { padding-right: 0.25em; }
.marquee .star { font-size: 0.28em; opacity: 0.7; padding-right: 0.9em; }
.footer-name.is-playing .marquee { animation-play-state: running; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
.footer-bottom { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.75; }

/* ---------- Generic reveal ---------- */
.fade-up { opacity: 0; transform: translateY(60px); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
.fade-up.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .nav-pill { display: none; }
  .nav-logo { font-size: 18px; }
  .works-grid, .about, .roots-grid, .footer-cols, .facts { grid-template-columns: 1fr; }
  .work:nth-child(even), .work:nth-child(even).fade-up.in { transform: none; }
  .work:nth-child(even).fade-up { transform: translateY(60px); }
  .works-grid { row-gap: 8vh; }
  .about { padding-top: 14vh; }
  .about-text { position: static; }
  .about-img { height: 80vh; }
  .footer-col--right { align-items: flex-start; }
  .footer-col--right .chip-num { align-self: flex-start; }
  .footer-col--right .footer-label { margin: -22px 0 14px 30px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .bleed-frame { height: 70vh; }
  .roots-img { height: 60vh; }
  .framed-track img { height: 36vh; }
  .zoom-item { max-width: 34vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal-words .w { color: inherit !important; }
  .marquee { animation: none !important; }
}
