/* ==========================================================================
   Lian Altamimi — night sky
   ========================================================================== */

/* ---------- Fonts (self-hosted latin subsets) ---------- */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-latin-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cal Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/cal-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --night: #0B0915;
  --moss: #1A1530;
  --canopy: #1D3A27;
  --fern: #24472F;
  --chartreuse: #D4F74A;
  --lime: #EDF1CF;
  --berry: #E0526A;

  /* live theme, swapped per section by main.js */
  --bg: #0B0915;
  --fg: #EDF1CF;
  --line: #D4F74A;
  --accent: #D4F74A;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-name: 'Cal Sans', 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(.19, 1, .22, 1);
  --ease-theme: cubic-bezier(.4, 0, .2, 1);
  --theme-t: 1.1s;
  --gutter: clamp(20px, 4.6vw, 72px);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px;
  overflow-x: hidden;
  overflow-x: clip;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--theme-t) var(--ease-theme), color var(--theme-t) var(--ease-theme);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p, h1, h2, h3, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 400; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--chartreuse); color: var(--night); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 12px 16px; border-radius: 999px;
  background: var(--chartreuse); color: var(--night);
  font-weight: 600; font-size: 14px;
  transform: translateY(-180%);
  transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

/* line masks for reveal animations */
.mask { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.line { display: inline-block; }

.eyebrow {
  display: block;
  font: 500 11px/1 var(--font-sans);
  letter-spacing: .24em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid currentColor; border-radius: 999px;
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
  transition: background-color .3s, color .3s, border-color .3s;
}
.pill:hover { background: var(--chartreuse); color: var(--night); border-color: var(--chartreuse); }
.dot {
  flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--chartreuse);
  box-shadow: 0 0 0 3px rgba(212, 247, 74, .18);
  animation: pulse 2.6s ease-in-out infinite;
}
.pill:hover .dot { background: var(--night); box-shadow: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(212, 247, 74, .2); }
  50% { box-shadow: 0 0 0 7px rgba(212, 247, 74, 0); }
}

/* ---------- Night sky ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: opacity 1.1s var(--ease-theme); }
.is-light .sky { opacity: 0; }
.sky__nebula {
  position: absolute; inset: -20%;
  background:
    radial-gradient(36% 30% at 78% 22%, rgba(122, 78, 255, .22), transparent 70%),
    radial-gradient(32% 28% at 14% 66%, rgba(214, 64, 160, .12), transparent 70%),
    radial-gradient(46% 34% at 56% 104%, rgba(70, 96, 255, .13), transparent 70%);
  animation: nebula 42s ease-in-out infinite alternate;
}
@keyframes nebula { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 1.5%, 0) scale(1.06); } }
.sky__stars { position: absolute; inset: 0; background-repeat: repeat; }
.sky__stars--1 {
  background-size: 233px 233px;
  background-image:
    radial-gradient(1px 1px at 86px 42px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 170px 16px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 214px 141px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 97px 153px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 133px 58px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 26px 115px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 21px 65px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 145px 112px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 215px 148px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1px 1px at 61px 165px, rgba(205, 190, 255, .9), transparent);
  animation: twinkle 3.8s ease-in-out infinite alternate;
}
.sky__stars--2 {
  background-size: 347px 347px;
  background-image:
    radial-gradient(1.4px 1.4px at 302px 35px, rgba(205, 190, 255, .9), transparent),
    radial-gradient(1.4px 1.4px at 303px 207px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1.4px 1.4px at 117px 27px, rgba(205, 190, 255, .9), transparent),
    radial-gradient(1.4px 1.4px at 72px 152px, rgba(230, 248, 170, .9), transparent),
    radial-gradient(1.4px 1.4px at 77px 280px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1.4px 1.4px at 296px 161px, rgba(205, 190, 255, .9), transparent),
    radial-gradient(1.4px 1.4px at 96px 56px, rgba(205, 190, 255, .9), transparent),
    radial-gradient(1.4px 1.4px at 296px 331px, rgba(255, 255, 255, .95), transparent);
  animation: twinkle 5.3s ease-in-out -2s infinite alternate;
}
.sky__stars--3 {
  background-size: 521px 521px;
  background-image:
    radial-gradient(2px 2px at 385px 103px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(2px 2px at 65px 214px, rgba(230, 248, 170, .9), transparent),
    radial-gradient(2px 2px at 441px 325px, rgba(230, 248, 170, .9), transparent),
    radial-gradient(2px 2px at 468px 374px, rgba(230, 248, 170, .9), transparent),
    radial-gradient(2px 2px at 258px 188px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(2px 2px at 87px 311px, rgba(230, 248, 170, .9), transparent);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .7));
  animation: twinkle 7.1s ease-in-out -4s infinite alternate;
}
@keyframes twinkle { from { opacity: .3; } to { opacity: 1; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) var(--gutter) 8px;
  /* on very wide screens, share the 1440px spine with every section */
  padding-inline: max(var(--gutter), calc((100% - 1440px) / 2));
  color: var(--fg);
  background-color: rgba(11, 22, 16, .0);
  transition: color var(--theme-t) var(--ease-theme), transform .6s var(--ease-out), background-color .4s;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg);
  opacity: .86;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color var(--theme-t) var(--ease-theme);
}
.site-header.is-hidden { transform: translateY(-110%); }
.brand {
  display: flex; align-items: center; min-height: 44px; padding: 0 6px;
  font: 400 clamp(19px, 1.6vw, 23px)/1 var(--font-name);
  letter-spacing: -.01em; white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: clamp(0px, 1.4vw, 22px); font: 500 13px/1 var(--font-sans); letter-spacing: .04em; }
.nav > a:not(.pill) { position: relative; display: flex; align-items: center; min-height: 44px; padding: 0 8px; }
.nav > a:not(.pill)::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 12px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.nav > a:not(.pill):hover::after { transform: scaleX(1); transform-origin: left; }
.pill--nav { margin-left: 6px; }

/* ---------- WebGL canvas ---------- */
.deck-canvas {
  position: fixed; left: 0; top: 0; z-index: 1;
  width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none;
  opacity: 0;
  transition: opacity .9s ease;
}
.is-gl .deck-canvas { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: clamp(104px, 15vh, 160px) var(--gutter) clamp(48px, 8vh, 96px);
  padding-inline: max(var(--gutter), calc((100% - 1440px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  overflow: clip;
}

.hero__text, .hero__deck { position: relative; z-index: 2; min-width: 0; }
.hero__text { display: flex; flex-direction: column; gap: clamp(22px, 3vh, 36px); }
.hero__name { font: 400 clamp(56px, 10.2vw, 156px)/.94 var(--font-name); letter-spacing: -.03em; }
.hero__role { font: 400 clamp(17px, 1.35vw, 20px)/1.4 var(--font-sans); }
.hero__status { display: none; }

/* deck anchor + fallback */
.hero__deck { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.deck {
  position: relative; width: 100%;
  height: min(70vh, 620px); min-height: 440px;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
}
.deck.is-hovering { cursor: pointer; }
.deck__fallback { position: absolute; inset: 0; }
.is-gl .deck__fallback { visibility: hidden; }
/* While the WebGL deck loads, keep the static fan out of sight so it doesn't blink;
   bring it back if WebGL is slow or fails. */
html.js:not(.reduced):not(.is-gl):not(.no-gl) .deck__fallback { opacity: 0; animation: fallbackIn .6s ease 3.5s forwards; }
@keyframes fallbackIn { to { opacity: 1; } }

.fcard {
  position: absolute; left: 50%; top: 50%;
  width: clamp(140px, 15vw, 232px); aspect-ratio: 3 / 5;
  --x: 0; --y: 0; --r: 0deg; --z: 1;
  z-index: var(--z);
  /* offsets are relative to the card's own size, so the fan scales with it */
  transform: translate(-50%, -50%) translate(calc(var(--x) * 51%), calc(var(--y) * 5.7%)) rotate(var(--r));
}
.fcard:nth-child(1) { --x: -1.5; --y: 1.5; --r: -13.5deg; --z: 1; }
.fcard:nth-child(2) { --x: -.5; --y: .5; --r: -4.5deg; --z: 2; }
.fcard:nth-child(3) { --x: .5; --y: .5; --r: 4.5deg; --z: 3; }
.fcard:nth-child(4) { --x: 1.5; --y: 1.5; --r: 13.5deg; --z: 4; }

.tcard {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px;
  border-radius: 12px;
  background: var(--night);
  color: var(--lime);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(237, 241, 207, .07);
  transition: transform .6s var(--ease-out);
}
.tcard::before {
  content: ""; position: absolute; inset: 9px;
  border: 1px solid var(--chartreuse); border-radius: 6px;
  pointer-events: none;
}
.tcard:hover { transform: translateY(-16px); }
.tcard__num { text-align: center; font: 400 22px/1 var(--font-display); }
.tcard__img { flex: 1; min-height: 0; overflow: hidden; border-radius: 2px; background: var(--moss); }
.tcard__img img { width: 100%; height: 100%; object-fit: cover; }
.tcard__cap {
  min-height: 25px; display: flex; align-items: center; justify-content: center;
  text-align: center; text-wrap: balance;
  font: 500 9.5px/1.3 var(--font-sans); letter-spacing: .2em; text-transform: uppercase;
}

.deck__meta { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.deck__index { display: flex; gap: 2px; }
.deck__index a {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px; padding: 0 6px;
  border-radius: 999px;
  font: 400 19px/1 var(--font-display);
  opacity: .6;
  transition: opacity .35s, color .35s;
}
.deck__index a:hover, .deck__index a.is-on { opacity: 1; color: var(--chartreuse); }
.deck__caption {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 14px;
  font: 500 11.5px/1.35 var(--font-sans); letter-spacing: .16em; text-transform: uppercase;
  text-align: center;
}
.deck__hint { display: inline-flex; align-items: center; gap: 14px; opacity: .6; }
.deck__hint::before { content: ""; width: 22px; height: 1px; background: currentColor; }

/* ---------- Chapters ---------- */
.work { position: relative; z-index: 2; }
.chapter {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: clamp(96px, 14vh, 160px) var(--gutter);
  display: flex; align-items: center;
}
.chapter__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 5.5vw, 96px);
  width: 100%; max-width: 1440px; margin: 0 auto;
}
.chapter--rev .chapter__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
.chapter--rev .chapter__card { order: 2; }
.chapter__card { perspective: 1600px; min-width: 0; }

.flip { position: relative; transform-style: preserve-3d; will-change: transform; }
.flip__face { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip__front { position: relative; }
.flip__back {
  position: absolute; inset: 0;
  transform: rotateY(180deg);
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0, 0, 0, .3);
  color: var(--line);
  overflow: hidden;
  transition: border-color var(--theme-t) var(--ease-theme), color var(--theme-t) var(--ease-theme);
}
.flip__back::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid currentColor; border-radius: 6px; opacity: .45;
}
.motif { width: 86%; height: 86%; }

.frame {
  display: flex; flex-direction: column; gap: 12px;
  padding: clamp(10px, 1.2vw, 16px);
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0, 0, 0, .16);
  transition: border-color var(--theme-t) var(--ease-theme);
}
.frame__num { text-align: center; font: 400 22px/1 var(--font-display); }
.frame__img { overflow: hidden; aspect-ratio: 808 / 632; border-radius: 2px; background: rgba(0, 0, 0, .25); }
.frame__img picture, .frame__img img { display: block; width: 100%; height: 100%; }
.frame__img picture { transition: transform 1.2s var(--ease-out); }
.frame__img img { object-fit: cover; }
.frame__cap { text-align: center; font: 500 11px/1.3 var(--font-sans); letter-spacing: .24em; text-transform: uppercase; }

.chapter__text { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.chapter__num { font: italic 400 clamp(88px, 10vw, 160px)/.8 var(--font-display); color: var(--accent); transition: color var(--theme-t) var(--ease-theme); }
.chapter__num .line { padding-right: .08em; }
.chapter__title { font: 400 clamp(38px, 4.4vw, 72px)/1.02 var(--font-name); letter-spacing: -.02em; text-wrap: balance; }
.chapter__title em { font-style: italic; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 8px 12px; border: 1px solid currentColor; border-radius: 999px; font: 500 12px/1 var(--font-sans); letter-spacing: .06em; }
.chapter__desc { max-width: 36ch; font: 400 clamp(17px, 1.3vw, 20px)/1.5 var(--font-sans); text-wrap: pretty; }
.link {
  align-self: flex-start;
  display: inline-flex; gap: 10px; align-items: center;
  min-height: 44px; padding-top: 6px;
  border-bottom: 1px solid currentColor;
  font: 500 15px/1 var(--font-sans);
}
.link__arrow { display: inline-block; transition: transform .5s var(--ease-out); }
.link:hover .link__arrow { transform: translateX(6px); }

/* ---------- Paintings ---------- */
.gallery { position: relative; z-index: 2; padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(40px, 8vh, 96px); }
.gallery__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px;
  max-width: 1440px; margin: 0 auto clamp(40px, 7vh, 80px);
}
.gallery__head .eyebrow { order: 2; padding-bottom: 12px; opacity: .8; }
.gallery__title { font: 400 clamp(54px, 8.2vw, 136px)/.94 var(--font-name); letter-spacing: -.03em; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.6vw, 34px);
  max-width: 1000px; margin: 0 auto;
}
.art { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.art__frame {
  display: block; width: 100%; padding: 0;
  aspect-ratio: 4 / 5;
  border: 0; border-radius: 10px;
  background: rgba(0, 0, 0, .3);
  overflow: hidden; cursor: zoom-in;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.art__frame picture, .art__frame img { display: block; width: 100%; height: 100%; }
.art__frame img { object-fit: cover; transition: transform 1.2s var(--ease-out); }
/* yellow glow on hover and keyboard focus */
.art__frame:hover, .art__frame:focus-visible {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(255, 228, 92, .95),
    0 0 26px 2px rgba(255, 214, 64, .55),
    0 0 80px 10px rgba(255, 196, 40, .22);
}
.art__frame:hover img { transform: scale(1.04); }
.art__frame:focus-visible { outline: none; }
.art__label {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(237, 241, 207, .2);
}
.art__title { font: 400 clamp(17px, 1.5vw, 22px)/1.15 var(--font-name); letter-spacing: -.01em; }
.art__meta { font: 500 10px/1 var(--font-sans); letter-spacing: .2em; text-transform: uppercase; opacity: .7; }

/* lightbox */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: clamp(56px, 8vh, 80px) clamp(16px, 4vw, 64px) clamp(24px, 5vh, 48px);
  border: 0;
  background: transparent;
  color: var(--lime);
  overflow: hidden;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lightbox::backdrop { background: rgba(6, 12, 8, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox__img { max-width: 100%; max-height: calc(100dvh - 170px); width: auto; height: auto; object-fit: contain; border-radius: 3px; box-shadow: 0 40px 100px -40px #000; }
.lightbox__cap { font: italic 400 clamp(20px, 2vw, 28px)/1.2 var(--font-display); text-align: center; }
.lightbox__close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: clamp(14px, 3vw, 40px);
  min-height: 44px; padding: 0 20px;
  border: 1px solid currentColor; border-radius: 999px;
  background: transparent; cursor: pointer;
  font: 500 13px/1 var(--font-sans); letter-spacing: .04em;
}
.lightbox__close:hover { background: var(--chartreuse); color: var(--night); border-color: var(--chartreuse); }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 2; padding: clamp(80px, 14vh, 160px) 0; overflow: hidden; }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group {
  display: flex; align-items: center; gap: .35em; padding-right: .35em;
  white-space: nowrap;
  font: 400 clamp(72px, 9.6vw, 168px)/1.1 var(--font-name);
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
}
/* Cal Sans has no italic: alternate outlined and solid words instead */
.marquee__group .solid { color: var(--fg); -webkit-text-stroke: 0; }
.marquee__group i { font-style: normal; color: var(--chartreuse); -webkit-text-stroke: 0; }
html:not(.js) .marquee__track { animation: marquee 60s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- About ---------- */
.about { position: relative; z-index: 2; padding: clamp(96px, 16vh, 180px) var(--gutter); }
.about__inner {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(40px, 7vw, 120px);
  max-width: 1440px; margin: 0 auto;
}
.about__card { perspective: 1400px; min-width: 0; }
.flip--portrait { aspect-ratio: 4 / 5; }
.flip--portrait .flip__front { height: 100%; }
.pcard {
  position: relative; height: 100%;
  padding: 11px; border-radius: 14px;
  background: var(--night);
  box-shadow: 0 40px 80px -40px rgba(11, 22, 16, .6);
}
.pcard__frame {
  height: 100%;
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px;
  border: 1px solid var(--chartreuse); border-radius: 7px;
  color: var(--lime);
}
.pcard__num { text-align: center; font: 400 26px/1 var(--font-display); }
.pcard__img { flex: 1; min-height: 0; overflow: hidden; border-radius: 2px; background: var(--moss); }
.pcard__img picture, .pcard__img img { width: 100%; height: 100%; }
.pcard__img img { object-fit: cover; object-position: 50% 30%; }
.pcard__cap { text-align: center; font: 500 12px/1 var(--font-sans); letter-spacing: .34em; text-transform: uppercase; }
.pcard__glint {
  position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  mix-blend-mode: screen; opacity: 0;
  background-image: linear-gradient(112deg, transparent 30%, rgba(212, 247, 74, .26) 42%, rgba(255, 255, 255, .5) 48%, rgba(150, 110, 255, .26) 54%, transparent 66%);
  background-size: 300% 100%;
  background-position: var(--gx, 50%) 0;
  transition: opacity .5s;
}
.about__card:hover .pcard__glint { opacity: 1; }
.flip__back--portrait { border: 0; border-radius: 14px; background: var(--night); color: var(--chartreuse); }
.flip__back--portrait::before { inset: 11px; border-radius: 7px; opacity: .9; }
.motif--portrait { width: 132%; height: auto; transform: rotate(90deg); }

.about__text { display: flex; flex-direction: column; gap: clamp(30px, 5vh, 52px); padding-bottom: 8px; min-width: 0; }
.about__bio { font: 400 clamp(24px, 2.4vw, 36px)/1.22 var(--font-display); letter-spacing: -.005em; text-wrap: pretty; max-width: 26em; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 26px 32px;
  padding-top: 26px;
  border-top: 1px solid currentColor;
}
.facts div { display: flex; flex-direction: column; gap: 10px; }
.facts dt { font: 500 11px/1 var(--font-sans); letter-spacing: .22em; text-transform: uppercase; opacity: .72; }
.facts dd { font: 400 16px/1.5 var(--font-sans); }
.dot--dark { display: inline-block; margin-right: 9px; vertical-align: 1px; background: var(--accent); box-shadow: none; animation: none; transition: background-color var(--theme-t) var(--ease-theme); }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: clamp(88px, 12vh, 140px) var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(32px, 6vh, 64px);
  overflow: clip;
}
.contact__inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: clamp(26px, 5vh, 56px); width: 100%; max-width: 1440px; margin: 0 auto; }
.contact__title { font: 400 clamp(52px, min(8vw, 14vh), 140px)/.94 var(--font-name); letter-spacing: -.03em; }
.contact__email { display: flex; flex-direction: column; gap: 18px; }
.email-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 26px; }
.email {
  max-width: 100%;
  overflow-wrap: anywhere;
  font: 400 clamp(24px, min(3.8vw, 7vh), 62px)/1.1 var(--font-name);
  letter-spacing: -.01em;
  color: var(--chartreuse);
  padding-bottom: 10px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .7s var(--ease-out);
}
.email:hover { background-size: 0% 1px; background-position: 100% 100%; }
.copy {
  min-height: 44px; padding: 0 20px;
  border: 1px solid currentColor; border-radius: 999px;
  background: transparent; cursor: pointer;
  font: 500 13px/1 var(--font-sans); letter-spacing: .04em;
  transition: background-color .3s, color .3s, border-color .3s;
}
.copy:hover, .copy.is-done { background: var(--chartreuse); color: var(--night); border-color: var(--chartreuse); }
/* white platform icons; the negative margin lines the first glyph up with the text above */
.socials { display: flex; gap: 8px; margin-left: -9px; }
.social {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  color: #fff;
  transition: color .3s, transform .45s var(--ease-out);
}
.social svg { display: block; fill: currentColor; }
.social--behance svg { width: 30px; height: 30px; }
.social--instagram svg { width: 25px; height: 25px; }
.social:hover, .social:focus-visible { color: var(--chartreuse); transform: translateY(-3px); }
.social:focus-visible { outline: 1px solid var(--chartreuse); outline-offset: 2px; }
.footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(237, 241, 207, .22);
  font: 400 13px/1 var(--font-sans);
}
.footer__top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--chartreuse); }
.footer__top span { display: inline-block; transition: transform .4s var(--ease-out); }
.footer__top:hover span { transform: translateY(-3px); }

/* ---------- Grain + cursor ---------- */
/* z-index 0: the grain textures the background "paper" only, never the artwork */
.grain {
  position: fixed; inset: -50%; z-index: 0; pointer-events: none;
  opacity: .075;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -.2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  animation: grain 1s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor__dot {
  position: absolute; left: -6px; top: -6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--chartreuse);
  mix-blend-mode: difference;
  transition: transform .45s var(--ease-out);
}
.cursor.is-hover .cursor__dot { transform: scale(3.4); }
.cursor__label {
  position: absolute; left: 0; top: 0;
  padding: 9px 13px; border-radius: 999px;
  background: var(--chartreuse); color: var(--night);
  font: 600 11px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.5);
  transition: opacity .3s, transform .45s var(--ease-out);
}
.cursor.is-label .cursor__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cursor.is-label .cursor__dot { transform: scale(0); }

/* ---------- Intro state (before main.js starts) ---------- */
.js:not(.ready) [data-intro] { transform: translateY(115%); }
.js:not(.ready) .site-header { opacity: 0; transform: translateY(-14px); }
.site-header {
  transition:
    color var(--theme-t) var(--ease-theme),
    transform .7s var(--ease-out),
    opacity 1s ease .35s,
    background-color .4s;
}
.site-header.is-hidden { transition-delay: 0s; }

/* ---------- Tablet / phone ---------- */
@media (max-width: 820px) {
  .pill--nav { display: none; }
  .nav { gap: 0; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 30px;
    padding-top: clamp(92px, 13vh, 120px);
  }
  .hero__name { font-size: clamp(48px, 15.5vw, 100px); }
  .hero__status { display: block; }
  .hero__status .mask { padding-bottom: 4px; }

  .deck { width: min(60vw, 236px); height: auto; aspect-ratio: 3 / 5; min-height: 0; margin-top: 6px; }
  .fcard { left: 0; top: 0; width: 100%; transform: none; transform-origin: 50% 90%; }
  .fcard:nth-child(1) { z-index: 4; transform: none; }
  .fcard:nth-child(2) { z-index: 3; transform: translateY(14px) scale(.945) rotate(-4.5deg); }
  .fcard:nth-child(3) { z-index: 2; transform: translateY(28px) scale(.89) rotate(3.5deg); }
  .fcard:nth-child(4) { z-index: 1; transform: translateY(42px) scale(.835) rotate(-2.5deg); }
  .tcard:hover { transform: none; }
  .deck__meta { margin-top: 18px; }

  .chapter { min-height: 0; padding: 84px var(--gutter); }
  .chapter__inner, .chapter--rev .chapter__inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .chapter--rev .chapter__card { order: 0; }
  .chapter__text { gap: 20px; }
  .chapter__num { font-size: clamp(76px, 22vw, 124px); }
  .chapter__title { font-size: clamp(32px, 9.4vw, 54px); }
  .frame__num { font-size: 19px; }
  .frame__cap { font-size: 10px; letter-spacing: .2em; }

  .gallery { padding-top: 84px; }
  .gallery__title { font-size: clamp(48px, 14.5vw, 92px); }
  .gallery__head .eyebrow { order: 0; padding-bottom: 0; }
  .gallery__grid { gap: 10px; }
  .art { gap: 10px; }
  .art__frame { border-radius: 8px; }
  .art__label { flex-direction: column; align-items: flex-start; gap: 5px; padding-top: 8px; }
  .art__title { font-size: 15px; }
  .art__meta { font-size: 8.5px; letter-spacing: .14em; }

  .marquee__group { font-size: clamp(56px, 15vw, 108px); }

  .about__inner { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .about__card { width: 100%; max-width: 360px; margin: 0 auto; }

  .contact { gap: 56px; }
  .contact__title { font-size: clamp(46px, 14vw, 96px); }
  .email { font-size: clamp(19px, 6.2vw, 40px); }
}

@media (max-width: 380px) {
  .brand { font-size: 19px; padding: 0 2px; }
  .nav > a:not(.pill) { padding: 0 6px; font-size: 12.5px; }
  .hero__row { gap: 10px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (hover: none) {
  .tcard:hover { transform: none; }
}

/* ---------- Reduced motion ----------
   .reduced is set by the head script (it honours the "?motion" override);
   the media query covers visitors without JavaScript. */
.reduced *, .reduced *::before, .reduced *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
.reduced .grain, .reduced .dot, .reduced .sky__stars, .reduced .sky__nebula { animation: none !important; }
.reduced [data-intro] { transform: none !important; }
/* colour isn't motion: keep a gentle cross-fade between sections */
html.reduced body, html.reduced .site-header::before { transition-duration: .5s !important; }
/* the marquee can't scroll here, so show every discipline as a wrapped list */
.reduced .marquee { padding-inline: var(--gutter); }
.reduced .marquee__group[aria-hidden="true"], .reduced .marquee__group i { display: none; }
.reduced .marquee__group { flex-wrap: wrap; white-space: normal; column-gap: .4em; font-size: clamp(34px, 5.6vw, 92px); }
@media (prefers-reduced-motion: reduce) {
  html:not(.js) *, html:not(.js) *::before, html:not(.js) *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }
}
