/* ==========================================================================
   PANE — cinematic wallpapers
   Palette sampled from the paintings themselves:
   night = wet asphalt, nicotine cream, tungsten lamp, harbour-window blue, oxblood
   day   = sunlit plaster, graphite, rose-blood red
   ========================================================================== */

:root {
  --bg: #0d0b09;          /* wet asphalt */
  --bg-2: #17130f;
  --ink: #efe4cf;         /* nicotine cream */
  --ink-2: rgba(239, 228, 207, .64);
  --ink-3: rgba(239, 228, 207, .3);
  --line: rgba(239, 228, 207, .16);
  --lamp: #e2a24c;        /* tungsten */
  --window: #1c2a4a;      /* harbour window */
  --deep: #2e0b11;        /* oxblood */
  --on-deep: #efe4cf;
  --glass: rgba(18, 14, 11, .5);
  --glass-edge: rgba(239, 228, 207, .14);

  --display: "Bodoni Moda", "Didot", "Bodoni 72", "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --ui: "Archivo", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.76, 0, .24, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 3.2vw, 48px);
  --rail-w: clamp(0px, 6vw, 88px);
  --section: clamp(96px, 14vw, 200px);
}

[data-theme="day"] {
  --bg: #ebe7e0;          /* plaster */
  --bg-2: #e0dbd2;
  --ink: #16161a;         /* graphite */
  --ink-2: rgba(22, 22, 26, .64);
  --ink-3: rgba(22, 22, 26, .3);
  --line: rgba(22, 22, 26, .14);
  --lamp: #a3141d;        /* rose-blood */
  --window: #cfc9bf;
  --deep: #16161a;
  --on-deep: #ebe7e0;
  --glass: rgba(235, 231, 224, .56);
  --glass-edge: rgba(255, 255, 255, .5);
}

*, *::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: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--ui);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .9s var(--ease), color .9s var(--ease);
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 1.5px solid var(--lamp); outline-offset: 4px; border-radius: 2px; }

.ui {
  font-family: var(--ui);
  font-stretch: 125%;
  font-weight: 500;
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.script {
  font-family: var(--script);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--lamp);
}

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--bg);
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

.link-line { position: relative; }
.link-line::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: currentColor; transform-origin: right; transform: scaleX(1);
  transition: transform .5s var(--ease);
}
.link-line:hover::after { transform-origin: left; animation: line-redraw .7s var(--ease); }
@keyframes line-redraw { 0% { transform: scaleX(1); transform-origin: right; } 49% { transform: scaleX(0); transform-origin: right; } 50% { transform-origin: left; } 100% { transform: scaleX(1); transform-origin: left; } }

/* ---------- Round button (Era-style drawn circle) ---------- */
.round {
  --size: 118px;
  position: relative; display: inline-grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; text-align: center;
  color: var(--ink);
  transition: transform .15s ease-out;
}
.round::before, .round::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--ink-3);
}
.round::after {
  border-color: var(--ink);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease);
}
.round:hover::after, .round:focus-visible::after { clip-path: inset(0 0 0 0); }
.round:active { transform: scale(.96); }
.round.is-small { --size: 64px; font-size: 8.5px; }
.round span { position: relative; max-width: 80%; }

.pill {
  height: 40px; padding: 0 18px; border-radius: 40px;
  border: 1px solid var(--glass-edge);
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase;
  transition: background-color .3s, transform .15s ease-out;
}
.pill:hover { background: rgba(255,255,255,.08); }
.pill:active { transform: scale(.97); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: #0d0b09; color: #efe4cf;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease);
}
.loader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.loader-inner { display: flex; align-items: baseline; gap: 22px; }
.loader-mark {
  font-family: var(--display); font-optical-sizing: auto; font-size: 44px;
  font-weight: 400; letter-spacing: -.02em;
}
.loader-num {
  font-family: var(--ui); font-stretch: 125%; font-size: 11px; letter-spacing: .2em;
  color: rgba(239,228,207,.6); min-width: 3ch; font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Fixed chrome
   ========================================================================== */
.chrome {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--gutter);
  pointer-events: none;
  color: #f2ebdd;
  mix-blend-mode: difference;
}
.chrome > * { pointer-events: auto; }

/* size is real width/height (set by main.js via --size), never a transform scale,
   so the SVG ring and glyph are redrawn sharp at every size */
.badge { --b: 84px; position: relative; width: var(--size, var(--b)); height: var(--size, var(--b)); display: grid; place-items: center; }
.badge .badge-glyph { --s: calc(var(--size, var(--b)) * .26); }
.badge .badge-glyph i { border-width: max(1.25px, calc(var(--size, var(--b)) * .015)); }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; } /* turned by scroll speed in main.js */
.badge text { font-family: var(--ui); font-stretch: 125%; font-size: 11px; letter-spacing: 0; fill: currentColor; font-weight: 600; }

/* the four-pane window glyph */
.badge-glyph {
  --s: 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5px;
  width: var(--s); height: calc(var(--s) * 1.18);
}
.badge-glyph i { border: 1.25px solid currentColor; border-radius: 1px; }
.badge-glyph i:nth-child(1) { border-top-left-radius: calc(var(--s) * .5); }
.badge-glyph i:nth-child(2) { border-top-right-radius: calc(var(--s) * .5); }
.badge-glyph.is-small { --s: 26px; color: var(--lamp); }
.badge-glyph.is-tiny { --s: 11px; gap: 1.5px; }
.badge-glyph.is-tiny i { border-width: 1px; }

.topnav { display: grid; justify-items: end; gap: 10px; text-align: right; }
.topnav-big {
  font-family: var(--display); font-size: 17px; line-height: 1.02; letter-spacing: -.005em;
  text-transform: uppercase; font-weight: 500;
  padding-bottom: 6px; border-bottom: 1px solid currentColor; margin-bottom: 4px;
}
.topnav-small {
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px;
  letter-spacing: .18em; text-transform: uppercase; opacity: .82;
  transition: opacity .2s;
}
.topnav-small:hover { opacity: 1; }

.rail {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 39; width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  pointer-events: none; color: #f2ebdd; mix-blend-mode: difference;
}
.rail-num { font-family: var(--ui); font-stretch: 125%; font-size: 9.5px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.rail-line { position: relative; width: 1px; height: 22vh; background: rgba(242,235,221,.28); overflow: hidden; }
.rail-line i { position: absolute; inset: 0; background: currentColor; transform-origin: top; transform: scaleY(0); }
.rail-label {
  position: absolute; bottom: 38px; writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--ui); font-stretch: 125%; font-size: 8.5px; letter-spacing: .3em; font-weight: 600;
}

/* ==========================================================================
   HERO — the fogged window
   ========================================================================== */
.hero { position: relative; height: 290vh; }
.hero-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: #0d0b09;
}
.hero-media { position: absolute; inset: 0; will-change: transform; transform-origin: 34% 58%; }
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity 1.2s var(--ease);
}
.hero-img.is-day { opacity: 0; object-position: 60% 50%; }
[data-theme="day"] .hero-img.is-day { opacity: 1; }
[data-theme="day"] .hero-img.is-night { opacity: 0; }

.hero-rain, .hero-fog { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-rain { pointer-events: none; opacity: .75; transition: opacity 1s; }
[data-theme="day"] .hero-rain { opacity: 0; }
.hero-fog { touch-action: pan-y; cursor: crosshair; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(8,6,4,.55) 100%),
    linear-gradient(180deg, rgba(8,6,4,.45) 0%, transparent 22%, transparent 70%, rgba(8,6,4,.55) 100%);
  transition: opacity 1s;
}
[data-theme="day"] .hero-shade { opacity: .25; }

.hero-title {
  --base: -58%;
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(var(--base));           /* main.js replaces this with a whole-pixel offset */
  display: grid; justify-items: center;
  color: #f3eadb; pointer-events: none;
}
[data-theme="day"] .hero-title { color: #16161a; }
.hero-word {
  display: flex; font-family: var(--display); font-optical-sizing: auto;
  font-weight: 400; font-size: clamp(104px, 21.5vw, 400px); line-height: .8;
  letter-spacing: -.035em;
  text-shadow: 0 10px 60px rgba(0,0,0,.25);
}
.hero-word span { display: inline-block; }
.is-intro .hero-word span { transform: translateY(40%); opacity: 0; filter: blur(12px); }
.hero-word span { transition: transform 1.4s var(--ease-out), opacity 1.2s var(--ease-out), filter 1.2s var(--ease-out); }
.hero-word span:nth-child(2) { transition-delay: .07s; }
.hero-word span:nth-child(3) { transition-delay: .14s; }
.hero-word span:nth-child(4) { transition-delay: .21s; }

.hero-flank {
  position: absolute; top: 58%;
  font-family: var(--display); font-weight: 500; text-transform: uppercase;
  font-size: clamp(12px, 1.12vw, 19px); letter-spacing: .04em; line-height: 1;
}
.hero-flank.is-left { left: calc(var(--rail-w) + 3vw); }
.hero-flank.is-right { right: calc(var(--gutter) + 2vw); }
.hero-flank span { display: inline-block; transition: opacity 1.2s .5s var(--ease-out), transform 1.2s .5s var(--ease-out); }
.is-intro .hero-flank span { opacity: 0; transform: translateY(12px); }

.hero-script {
  position: relative; margin-top: -.34em;
  font-family: var(--script); font-size: clamp(44px, 6.8vw, 116px); line-height: 1;
  color: var(--lamp); transform: rotate(-7deg) translateX(14%);
  text-shadow: 0 4px 30px rgba(0,0,0,.35);
  transition: opacity 1.4s .7s var(--ease-out), clip-path 1.6s .7s var(--ease-out);
  clip-path: inset(-20% 0 -20% 0);
}
.is-intro .hero-script { opacity: 0; clip-path: inset(-20% 100% -20% 0); }

.daynight {
  position: absolute; bottom: 13vh; left: 0; right: 0; margin-inline: auto; width: max-content;
  display: flex; align-items: center; gap: 14px;
  color: #f3eadb; transition: opacity 1s 1s;
}
[data-theme="day"] .daynight { color: #16161a; }
.is-intro .daynight { opacity: 0; }
.dn-btn {
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px;
  letter-spacing: .18em; text-transform: uppercase; opacity: .45;
  padding: 8px 2px; white-space: nowrap; transition: opacity .3s;
}
.dn-btn[aria-pressed="true"], .dn-btn:hover { opacity: 1; }
.dn-line { position: relative; width: 64px; height: 1px; background: currentColor; opacity: .5; }
.dn-line i {
  position: absolute; top: -2.5px; left: 0; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; transition: transform .7s var(--ease);
}
[data-theme="day"] .dn-line i { transform: translateX(58px); }

.hero-hint {
  position: absolute; bottom: calc(13vh - 44px); left: 0; right: 0; margin-inline: auto; width: max-content;
  color: rgba(243,234,219,.62); white-space: nowrap; transition: opacity .8s;
}
[data-theme="day"] .hero-hint { color: rgba(22,22,26,.55); }
.hint-coarse { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-coarse { display: inline; } }
.is-intro .hero-hint, .hero-hint.is-gone { opacity: 0; }

.hero-caption {
  position: absolute; right: var(--gutter); bottom: var(--gutter);
  display: flex; gap: 22px; align-items: baseline; color: #f3eadb;
  transition: opacity 1s 1.1s;
}
[data-theme="day"] .hero-caption { color: #16161a; }
.is-intro .hero-caption { opacity: 0; }

.hero-outro {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px;
  text-align: center; color: #f3eadb; pointer-events: none; opacity: 0;
  padding: 0 var(--gutter);
}
[data-theme="day"] .hero-outro { color: #16161a; }
.outro-line {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(38px, 6.2vw, 104px); line-height: .95; letter-spacing: -.03em;
  text-shadow: 0 6px 40px rgba(0,0,0,.4);
}
[data-theme="day"] .outro-line { text-shadow: none; }
.outro-line .script { font-size: 1.22em; display: inline-block; transform: translateY(.08em) rotate(-4deg); margin-left: .05em; }
.outro-sub { opacity: .75; }

.hero-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(243,234,219,.12); }
.hero-progress i { position: absolute; inset: 0; background: var(--lamp); transform-origin: left; transform: scaleX(0); }

/* ==========================================================================
   STATEMENT
   ========================================================================== */
.statement {
  position: relative; z-index: 2;
  padding: var(--section) var(--gutter) var(--section) calc(var(--rail-w) + var(--gutter));
  background: var(--bg);
  display: grid; gap: clamp(40px, 5vw, 72px);
  transition: background-color .9s var(--ease);
}
.eyebrow { color: var(--ink-2); }
.statement-head {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(46px, 8.6vw, 152px); line-height: .9; letter-spacing: -.035em;
}
.statement-head em { font-style: italic; color: var(--lamp); }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line > span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease-out); }
.line:nth-child(2) > span { transition-delay: .08s; }
.line:nth-child(3) > span { transition-delay: .16s; }
.statement-head.in .line > span { transform: none; }

.statement-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 390px)); gap: clamp(32px, 4vw, 64px);
  margin-left: auto; margin-right: 6vw; color: var(--ink-2);
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(18px, 1.4vw, 21px); line-height: 1.55; letter-spacing: -.004em;
  text-wrap: pretty;
}
.statement-cols p:first-child { font-style: italic; color: var(--ink); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.statement-cols .reveal:nth-child(2) { transition-delay: .12s; }

/* ==========================================================================
   ARC reveal
   ========================================================================== */
.arc { position: relative; height: 190vh; }
.arc-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.arc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.arc-disc {
  position: absolute; left: 50%; top: 0;
  width: max(170vw, 170vh); aspect-ratio: 1; margin-left: calc(max(170vw, 170vh) / -2);
  border-radius: 50%; background: var(--bg);
  transform: translateY(100vh);
  transition: background-color .9s var(--ease);
}
.arc-text { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arc-text text {
  font-family: var(--display); font-size: 21px; font-weight: 400; letter-spacing: .12em;
  fill: var(--ink); transition: fill .9s var(--ease);
}
.arc-center {
  position: absolute; top: 21vh; left: 0; right: 0; margin-inline: auto; width: max-content;
  display: flex; align-items: center; gap: 22px; white-space: nowrap; color: var(--ink-2);
}
.arc-stem { position: absolute; left: 50%; top: calc(21vh + 60px); width: 1px; height: 28vh; background: var(--line); }

/* ==========================================================================
   ROOMS — stacked sticky chapters
   ========================================================================== */
.rooms { position: relative; display: flow-root; /* keeps the last room's margin inside, so it can stay pinned */ background: var(--bg); transition: background-color .9s var(--ease); }
.room {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  margin-bottom: 70vh;
  background: var(--bg);
  transition: background-color .9s var(--ease);
}
/* the last room settles like the others, then the Index slides over it */
.room:last-of-type { margin-bottom: 0; }
/* a sticky element can't use its own margin to stay pinned, so a spacer after the
   last room gives Wildcards the same dwell as the others (70vh) plus the 100vh the
   Index needs to slide over it */
.rooms-tail { height: 170vh; }
.rooms + .index { margin-top: -100vh; }
.room-inner { position: absolute; inset: 0; transform-origin: 50% 0; }
.room-aperture {
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(18% 24% 22% 24%);
  will-change: clip-path;
}
.room-aperture img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); will-change: transform; }
.room-aperture::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,6,4,.62) 0%, rgba(8,6,4,.18) 26%, transparent 42%, transparent 55%, rgba(8,6,4,.72) 100%);
}
.room-top, .room-strip { text-shadow: 0 1px 14px rgba(0,0,0,.55); }
.room-top .ui { opacity: 1; }

/* White Room is lit by day: graphite ink on plaster */
.room[data-room="white-room"] .room-aperture::after {
  background: linear-gradient(180deg, rgba(236,232,225,.7) 0%, rgba(236,232,225,.15) 28%, transparent 42%, transparent 60%, rgba(236,232,225,.55) 100%);
}
.room[data-room="white-room"] .room-top,
.room[data-room="white-room"] .room-name,
.room[data-room="white-room"] .room-open { color: #16161a; text-shadow: none; }
.room[data-room="white-room"] .room-note { color: rgba(22,22,26,.78); }
.room[data-room="white-room"] .room-open.round::before { border-color: rgba(22,22,26,.3); }
.room[data-room="white-room"] .room-open.round::after { border-color: #16161a; }
.room-top {
  position: absolute; top: calc(var(--gutter) + 116px); left: calc(var(--rail-w) + var(--gutter));
  display: grid; gap: 14px; max-width: min(420px, 70vw);
  color: #f3eadb;
}
.room-note {
  font-family: var(--display); font-style: italic; font-optical-sizing: auto;
  font-size: clamp(18px, 1.5vw, 23px); line-height: 1.38; letter-spacing: -.005em;
  color: rgba(243,234,219,.94);
}
.room-strip {
  position: absolute; left: calc(var(--rail-w) + var(--gutter)); bottom: 29vh;
  display: flex; gap: 8px;
}
.room-strip button {
  width: clamp(64px, 7vw, 104px); aspect-ratio: 16 / 10; overflow: hidden; border-radius: 2px;
  outline-offset: 3px; transition: transform .15s ease-out;
}
.room-strip button:active { transform: scale(.95); }
.room-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.room-strip button:hover img { transform: scale(1.08); }
.room-open { position: absolute; right: calc(var(--gutter) + 2vw); bottom: 30vh; color: #f3eadb; }
.room-open.round { --size: 126px; }
.room-open.round::before { border-color: rgba(243,234,219,.35); }
.room-open.round::after { border-color: #f3eadb; }
.room-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--display); font-optical-sizing: auto; font-weight: 400;
  font-size: clamp(40px, 13.6vw, 250px); line-height: .76; letter-spacing: -.045em;
  text-transform: uppercase; text-align: center; white-space: nowrap;
  color: #f3eadb; transform: translateY(8%);
  pointer-events: none;
}
.room-count { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   INDEX
   ========================================================================== */
.index {
  position: relative; z-index: 2; background: var(--bg);
  padding: var(--section) var(--gutter) var(--section) calc(var(--rail-w) + var(--gutter));
  transition: background-color .9s var(--ease);
}
.index-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.index-title, .index-count {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 400;
  font-size: clamp(56px, 10vw, 180px); line-height: .82; letter-spacing: -.04em; text-transform: uppercase;
}
.index-count { font-variant-numeric: lining-nums; }

.filters {
  display: flex; flex-wrap: wrap; gap: 6px 26px; align-items: center;
  margin: clamp(32px, 4vw, 56px) 0 clamp(24px, 3vw, 40px);
  padding: 16px 20px; border: 1px solid var(--line); border-radius: 60px;
}
.filter {
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
  padding: 6px 0; transition: color .25s;
}
.filter sup { font-size: 8px; margin-left: 3px; letter-spacing: .05em; }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); }
.filter[aria-pressed="true"]::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--lamp); margin-right: 8px; vertical-align: 2px; }
.filters .spacer { flex: 1; }

.grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 48px) clamp(12px, 1.6vw, 24px);
}
.card { position: relative; opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.card.in { opacity: 1; transform: none; }
.card.is-hidden { display: none; }
.card-open { display: block; width: 100%; text-align: left; }
.card-frame {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 3px;
  background: var(--tint, var(--bg-2));
}
.card-frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease-out), opacity .6s;
  opacity: 0;
}
.card-frame img.is-loaded { opacity: 1; }
.card:hover .card-frame img { transform: scale(1.045); }
.card-meta {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline;
  padding-top: 14px;
}
.card-num { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-title { font-family: var(--display); font-size: 22px; line-height: 1.05; letter-spacing: -.01em; }
.card-room { color: var(--ink-2); }
.card-dl {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-edge);
  opacity: 0; transform: scale(.85);
  transition: opacity .3s var(--ease-out), transform .4s var(--ease-out);
}
.card:hover .card-dl, .card-dl:focus-visible { opacity: 1; transform: none; }
.card-dl:active { transform: scale(.92); }
.card-dl svg { width: 16px; height: 16px; }
@media (hover: none) { .card-dl { opacity: 1; transform: none; } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.foot {
  position: relative; z-index: 2; overflow: hidden;
  background: var(--deep); color: var(--on-deep);
  padding: clamp(80px, 10vw, 150px) var(--gutter) clamp(28px, 3vw, 44px) calc(var(--rail-w) + var(--gutter));
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
.foot-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.foot-line { font-family: var(--display); font-size: clamp(40px, 5.6vw, 96px); line-height: .95; letter-spacing: -.03em; }
.foot-line .script { font-size: 1.2em; display: inline-block; transform: rotate(-4deg); }
[data-theme="day"] .foot .script { color: #e0464d; }
.foot-links { display: flex; gap: 28px; flex-wrap: wrap; }
.foot-links .link-line { font: inherit; letter-spacing: inherit; text-transform: inherit; }
.foot-word {
  position: relative; z-index: 1; pointer-events: none;
  font-family: var(--display); font-optical-sizing: auto; font-weight: 500;
  font-size: min(25vw, 520px); line-height: .78; letter-spacing: -.035em; text-align: center;
  margin: clamp(56px, 7vw, 110px) 0 0; padding-top: clamp(24px, 3vw, 44px);
  border-top: 1px solid rgba(239,228,207,.16);
  color: var(--on-deep);
}
.foot-sign {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  margin-top: clamp(22px, 2.6vw, 40px);
}
.foot-meta { opacity: .6; }
.signature { display: flex; align-items: baseline; gap: 14px; }
.signature .ui { opacity: .6; }
.sig {
  white-space: nowrap;
  font-family: var(--script); font-size: clamp(34px, 3.4vw, 54px); line-height: 1;
  color: var(--lamp); display: inline-block; transform: rotate(-5deg) translateY(4px);
}
[data-theme="day"] .sig { color: #e0464d; }

/* ==========================================================================
   LETTER (Connect)
   ========================================================================== */
.letter-layer { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; }
.letter-layer[hidden] { display: none; }
.letter-scrim { position: absolute; inset: 0; background: rgba(6, 5, 4, .62); opacity: 0; }
[data-theme="day"] .letter-scrim { background: rgba(22, 22, 26, .38); }
.letter {
  --paper: #ece3d2; --paper-ink: #1d1813; --paper-line: rgba(29, 24, 19, .2); --seal: #8f1d25;
  position: relative; z-index: 1;               /* centred by the layer's grid: no -50% transform */
  width: min(1080px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100svh - 2 * var(--gutter)); overflow: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: 1fr auto 1.15fr; gap: clamp(20px, 3vw, 48px);
  padding: clamp(28px, 3.6vw, 56px);
  color: var(--paper-ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 0 0.22  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.35), transparent 60%);
  box-shadow: 0 40px 90px rgba(0,0,0,.45), 0 8px 20px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.4);
  border-radius: 3px;
  transform-origin: 50% 50%;
}
[data-theme="day"] .letter { --paper: #f7f4ee; --paper-ink: #16161a; --paper-line: rgba(22,22,26,.18); --seal: #a3141d; box-shadow: 0 40px 90px rgba(22,22,26,.22), 0 8px 20px rgba(22,22,26,.12); }
.letter .ui { font-size: 9.5px; }
.letter-close {
  position: absolute; right: 16px; top: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--paper-line); transition: transform .15s ease-out, background-color .2s;
}
.letter-close:hover { background: rgba(0,0,0,.05); }
.letter-close:active { transform: scale(.92); }
.letter-close svg { width: 15px; height: 15px; }
.letter-left { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 100%; }
.letter-title {
  font-family: var(--script); font-weight: 400; font-size: clamp(56px, 6.4vw, 104px); line-height: .9;
  color: var(--paper-ink); transform: rotate(-6deg); transform-origin: left bottom; margin: 10px 0 0 -4px;
}
.letter-lede { font-family: var(--display); font-style: italic; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.4; max-width: 30ch; }
.letter-foot { opacity: .8; line-height: 1.9; }
.letter-foot a { text-transform: none; letter-spacing: .02em; font-size: 12px; }
.letter-copy {
  margin-left: 8px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--paper-line);
  font-family: var(--ui); font-stretch: 125%; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.letter-copy:hover { background: rgba(0,0,0,.05); }
.letter-spine { display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; gap: 14px; }
.letter-spine > span:not(.spine-badge) { width: 1px; background: var(--paper-line); }
.spine-badge { position: relative; width: 78px; height: 78px; display: grid; place-items: center; }
.spine-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.spine-badge text { font-family: var(--ui); font-stretch: 125%; font-size: 9.2px; font-weight: 600; fill: currentColor; }
.letter-form { position: relative; display: grid; gap: 22px; align-content: start; padding-top: 64px; }
.stamp { position: absolute; right: 38px; top: -8px; width: 92px; height: 70px; transform: rotate(3deg); }
.stamp-img {
  position: absolute; inset: 0; padding: 6px;
  /* perforated edge: holes along the border only; the picture covers the middle */
  background: radial-gradient(circle at 50% 50%, transparent 2.4px, #fbf7ef 2.7px) -5px -5px / 9px 9px;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.22));
}
.stamp-img img { width: 100%; height: 100%; object-fit: cover; }
.postmark { position: absolute; left: -44px; top: 6px; width: 74px; height: 74px; color: var(--seal); opacity: .72; transform: rotate(-14deg); mix-blend-mode: multiply; }
.postmark svg { width: 100%; height: 100%; }
.postmark text { font-family: var(--ui); font-stretch: 125%; font-size: 9px; font-weight: 700; fill: currentColor; }
.field { display: grid; gap: 6px; }
.field .ui { opacity: .66; }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--paper-line); border-radius: 0;
  background: transparent; color: var(--paper-ink); padding: 6px 0 8px; resize: vertical;
  font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.45;
  transition: border-color .25s;
}
.field textarea {
  min-height: 118px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 28px, var(--paper-line) 28px, var(--paper-line) 29px);
  background-attachment: local; border-bottom: 0; line-height: 29px; padding-top: 0;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--paper-ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: 0 1px 0 0 var(--paper-ink); }
.field [aria-invalid="true"] { border-color: var(--seal); }
.letter-error { min-height: 14px; color: var(--seal); }
.letter-send { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.letter-send .ui { opacity: .6; max-width: 26ch; }
.letter .round { color: var(--paper-ink); --size: 108px; flex-shrink: 0; }
.letter .round::before { border-color: var(--paper-line); }
.letter .round::after { border-color: var(--paper-ink); }

/* ==========================================================================
   VIEWER
   ========================================================================== */
.viewer {
  position: fixed; inset: 0; z-index: 70; background: #070605; color: #f3eadb;
  overscroll-behavior: contain;
  clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path .9s var(--ease);
}
.viewer[hidden] { display: block; visibility: hidden; }
.viewer.is-open { clip-path: circle(150% at var(--ox, 50%) var(--oy, 50%)); }
.v-stage { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; }
.v-stage.is-dragging { cursor: grabbing; }
.v-track { position: absolute; inset: 0; will-change: transform; }
.v-slide { position: absolute; top: 0; left: 0; width: 100vw; height: 100%; overflow: hidden; }
.v-slide img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.12); will-change: transform; user-select: none; -webkit-user-drag: none;
  opacity: 0; transition: opacity .5s;
}
.v-slide img.is-loaded { opacity: 1; }
.v-slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,6,5,.5) 0%, transparent 18%, transparent 68%, rgba(7,6,5,.65) 100%);
  transition: opacity .6s;
}
.viewer.is-desktop .v-slide::after { opacity: 0; }

.v-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 28px; padding: var(--gutter);
  transition: opacity .5s, transform .6s var(--ease);
}
.v-count { font-variant-numeric: tabular-nums; }
.v-room { opacity: .7; }
.v-close { margin-left: auto; color: #f3eadb; }
.v-close::before { border-color: rgba(243,234,219,.35); }
.v-close::after { border-color: #f3eadb; }

.v-arrow {
  position: absolute; top: 50%; z-index: 3; width: 56px; height: 56px; margin-top: -28px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(18,14,11,.35); border: 1px solid rgba(243,234,219,.16);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: opacity .3s, transform .15s ease-out, background-color .3s;
}
.v-arrow:hover { background: rgba(18,14,11,.6); }
.v-arrow:active { transform: scale(.92); }
.v-arrow svg { width: 20px; height: 20px; }
.v-arrow.is-prev { left: var(--gutter); }
.v-arrow.is-next { right: var(--gutter); }
.v-arrow[disabled] { opacity: .25; pointer-events: none; }

.v-bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 3;
  display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 28px;
  transition: opacity .5s, transform .6s var(--ease);
}
.v-title {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(40px, 5.4vw, 92px); line-height: .9; letter-spacing: -.035em;
}
.v-note { margin-top: 12px; color: rgba(243,234,219,.8); font-family: var(--display); font-style: italic; font-size: clamp(16px, 1.3vw, 19px); }
.v-meta { opacity: .6; padding-bottom: 8px; font-variant-numeric: tabular-nums; }
.v-actions { display: flex; align-items: center; gap: 14px; }
.v-actions .round { --size: 104px; color: #f3eadb; background: rgba(18,14,11,.28); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.v-actions .round::before { border-color: rgba(243,234,219,.35); }
.v-actions .round::after { border-color: #f3eadb; }
.v-actions .pill { background: rgba(18,14,11,.35); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-color: rgba(243,234,219,.2); color: #f3eadb; }
.v-actions .pill[aria-pressed="true"] { background: #f3eadb; color: #0d0b09; }

.v-drag {
  position: absolute; top: calc(var(--gutter) + 22px); left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 3;
  opacity: .5; white-space: nowrap; pointer-events: none;
}

.viewer.is-clean .v-top, .viewer.is-clean .v-bar, .viewer.is-clean .v-arrow, .viewer.is-clean .v-drag { opacity: 0; pointer-events: none; }
.v-arrow { transition: opacity .4s, transform .15s ease-out, background-color .3s; }

/* Desktop preview (menu bar + dock over the wallpaper) */
.v-desktop { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .6s var(--ease-out); }
.viewer.is-desktop .v-desktop { opacity: 1; }
.viewer.is-desktop .v-top, .viewer.is-desktop .v-drag { opacity: 0; pointer-events: none; transform: translateY(-12px); }
.viewer.is-desktop .v-bar { transform: translateY(-78px); }
.viewer.is-desktop .v-info, .viewer.is-desktop .v-meta { opacity: 0; }
.v-info, .v-meta { transition: opacity .4s; }
.v-menubar {
  position: absolute; inset: 0 0 auto 0; height: 30px;
  display: flex; justify-content: space-between; align-items: center; padding: 0 14px;
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", var(--ui);
  color: #fff; background: rgba(20,20,24,.28);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  transform: translateY(-100%); transition: transform .6s var(--ease);
}
.viewer.is-desktop .v-menubar { transform: none; }
.mb-left, .mb-right { display: flex; align-items: center; gap: 18px; }
.mb-left b { font-weight: 700; }
.mb-right svg { width: 17px; height: 17px; }
.mb-right svg:nth-child(2) { width: 25px; height: 13px; }
.v-folder {
  position: absolute; right: 22px; top: 52px; display: grid; justify-items: center; gap: 4px;
  font: 500 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", var(--ui); color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.folder-icon {
  width: 58px; height: 46px; border-radius: 5px; position: relative;
  background: linear-gradient(180deg, #7cc3f5, #3f93d8);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.folder-icon::before { content: ""; position: absolute; left: 0; top: -5px; width: 24px; height: 9px; border-radius: 4px 4px 0 0; background: #64b0ec; }
.v-dock {
  position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 130%);
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 22px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  transition: transform .7s var(--ease);
}
.viewer.is-desktop .v-dock { transform: translate(-50%, 0); }
.v-dock i { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.35); }
.v-dock em { width: 1px; height: 40px; background: rgba(255,255,255,.35); margin: 0 3px; }

.toast {
  position: fixed; bottom: 28px; z-index: 80; left: 0; right: 0; margin-inline: auto; width: max-content;
  transform: translateY(140%); opacity: 0;
  padding: 13px 20px; border-radius: 40px;
  background: var(--glass); color: var(--ink); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  transition: transform .6s var(--ease), opacity .4s;
}
.viewer.is-open ~ .toast { background: rgba(18,14,11,.55); color: #f3eadb; border-color: rgba(243,234,219,.16); }
.toast.is-on { transform: none; opacity: 1; }

/* ==========================================================================
   PHONE PREVIEW (lock screen)
   ========================================================================== */
.v-stage { transition: filter .7s var(--ease), transform .7s var(--ease); }
.viewer.is-phone .v-stage { filter: blur(26px) brightness(.42) saturate(1.15); transform: scale(1.06); }
.viewer.is-phone .v-arrow { opacity: 0; pointer-events: none; }
.v-phone { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease-out); }
.viewer.is-phone .v-phone { opacity: 1; }
.phone {
  position: relative; height: min(74svh, 800px); aspect-ratio: 1290 / 2796;
  border-radius: 13.5% / 6.2%; overflow: hidden; background: #000;
  box-shadow: 0 0 0 9px #0b0b0d, 0 0 0 10.5px #3b3b40, 0 0 0 11px #111, 0 60px 120px rgba(0,0,0,.65);
  transform: translateY(26px) scale(.94); filter: blur(6px);
  transition: transform .8s var(--ease-out), filter .6s var(--ease-out);
}
.viewer.is-phone .phone { transform: none; filter: none; }
.phone-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) 50%; }
.phone-island { position: absolute; left: 50%; top: 1.6%; width: 31%; height: 3.5%; margin-left: -15.5%; border-radius: 40px; background: #000; }
.phone-lock {
  position: absolute; left: 0; right: 0; top: 8.5%; display: grid; justify-items: center; gap: 2px;
  color: rgba(255,255,255,.94); text-shadow: 0 1px 12px rgba(0,0,0,.35);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", var(--ui);
}
.phone-date { font-size: clamp(11px, 1.9svh, 16px); font-weight: 600; letter-spacing: .01em; }
.phone-time { font-size: clamp(54px, 10.5svh, 98px); font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.phone-round {
  position: absolute; bottom: 5.5%; width: 12%; aspect-ratio: 1; border-radius: 50%;
  background: rgba(40,40,44,.42); border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.phone-round.is-l { left: 11%; }
.phone-round.is-r { right: 11%; }
.phone-bar { position: absolute; bottom: 1.4%; left: 50%; width: 36%; height: .55%; margin-left: -18%; border-radius: 4px; background: rgba(255,255,255,.9); }
.v-modes { display: flex; gap: 8px; }

/* ==========================================================================
   INDEX CARDS — tilt in 3D toward the cursor, with a sheen of light
   ========================================================================== */
.grid { perspective: 1400px; }
.card-frame {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--press, 1));
  transform-style: preserve-3d;
  box-shadow: 0 var(--sh, 0px) calc(var(--sh, 0px) * 2.4) rgba(0,0,0,.35);
}
.card-open:active .card-frame { --press: .985; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(.985); }
.card-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--go, 0);
  background: radial-gradient(60% 70% at var(--gx, 50%) var(--gy, 50%), rgba(255,244,222,.22), transparent 62%);
  mix-blend-mode: soft-light;
}

/* ==========================================================================
   CURSOR LENS — a small glass disc that says what a click will do
   ========================================================================== */
.lens {
  position: fixed; left: 0; top: 0; z-index: 85; pointer-events: none;
  width: 0; height: 0;
}
.lens span {
  position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--ui); font-stretch: 125%; font-weight: 600; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: #f3eadb; background: rgba(18,14,11,.32); border: 1px solid rgba(243,234,219,.3);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transform: scale(0); opacity: 0;
  transition: transform .45s var(--ease-out), opacity .3s;
}
.lens.is-on span { transform: scale(1); opacity: 1; }
.has-lens [data-lens], .has-lens [data-lens] * { cursor: none; }
@media (hover: none), (pointer: coarse) { .lens { display: none; } }

/* round buttons drift toward the cursor (magnetic); --mx/--my set in main.js */
.round, .v-arrow { translate: var(--mx, 0px) var(--my, 0px); }
.round span { display: inline-block; translate: calc(var(--mx, 0px) * .35) calc(var(--my, 0px) * .35); }

/* ==========================================================================
   FILM GRAIN — a whisper of 35mm over the paintings (never over text, which stays crisp)
   ========================================================================== */
.grain {
  position: absolute; inset: -60%; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  mix-blend-mode: overlay;
  animation: grain 1.1s steps(6) infinite;
}
[data-theme="day"] .grain { opacity: .07; mix-blend-mode: multiply; filter: invert(1); }
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-6%, 4%); } 33% { transform: translate(5%, -7%); }
  50% { transform: translate(-3%, 8%); } 67% { transform: translate(8%, 2%); } 83% { transform: translate(-7%, -4%); } 100% { transform: translate(0, 0); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --rail-w: 0px; }
  .letter { grid-template-columns: 1fr; gap: 18px; }
  .letter-spine { display: none; }
  .letter-left { min-height: 0; gap: 14px; }
  .letter-form { padding-top: 12px; }
  .stamp { display: none; }
  .foot-sign { flex-direction: column; align-items: flex-start; }
  .rail { display: none; }
  .badge { --b: 66px; }
  .badge text { font-size: 10px; }
  .hero-flank { top: auto; bottom: calc(100% + 12px); }
  .hero-flank.is-left { left: var(--gutter); }
  .hero-flank.is-right { right: var(--gutter); }
  .hero-title { --base: -50%; }
  .statement-cols { grid-template-columns: 1fr; margin: 0; max-width: 520px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-top { top: calc(var(--gutter) + 132px); gap: 10px; }
  .viewer.is-phone .v-info { opacity: 0; }
  .phone { height: min(62svh, 640px); margin-top: -8svh; }
  .v-modes .pill { padding: 0 14px; white-space: nowrap; }
  .v-actions { justify-content: space-between; gap: 10px; }
  .v-modes { gap: 6px; }
  .v-modes .pill { padding: 0 11px; height: 36px; font-size: 8.5px; letter-spacing: .12em; }
  .v-actions .round { --size: 74px; font-size: 8px; }
  .room-strip { bottom: 24vh; }
  .room-open { bottom: 22vh; }
  .room-open.round { --size: 96px; }
  .v-bar { grid-template-columns: 1fr; gap: 16px; }
  .v-meta { display: none; }
  .v-arrow { display: none; }
  .v-actions .round { --size: 88px; }
  .v-dock i { width: 34px; height: 34px; border-radius: 9px; }
  .v-dock i:nth-child(n+6) { display: none; }
  .mb-left span:nth-child(n+5) { display: none; }
}
@media (max-width: 560px) {
  .topnav-big { font-size: 14px; }
  .topnav a.topnav-small { display: none; }
  .hero-word { font-size: 25vw; }
  .v-drag { display: none; }
  .index { padding-top: calc(var(--section) + 40px); }
  .grid { grid-template-columns: 1fr; }
  .card-meta { grid-template-columns: auto 1fr; }
  .card-room { display: none; }
  .index-head { align-items: baseline; }
  .filters { border-radius: 18px; }
  .room-strip button:nth-child(n+4) { display: none; }
  .daynight { bottom: 16vh; }
  .hero-hint { bottom: calc(16vh - 40px); }
  .hero-caption { left: var(--gutter); justify-content: space-between; }
  .foot-links { flex-wrap: wrap; gap: 18px; }
}

/* ==========================================================================
   Reduced motion / transparency / contrast
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .lens { display: none; }
  .card-frame, .round, .v-arrow { --rx: 0deg; --ry: 0deg; --mx: 0px; --my: 0px; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .hero { height: 100vh; height: 100svh; }
  .arc { height: auto; }
  .arc-stage { position: relative; }
  .arc-disc { transform: translateY(30vh) !important; }
  .room-aperture { clip-path: none !important; }
  .line > span, .reveal, .card { transform: none !important; transition: opacity .4s !important; }
  .viewer { transition: opacity .3s; clip-path: none; opacity: 0; }
  .viewer.is-open { opacity: 1; }
  .loader { transition: opacity .4s; }
  .loader.is-done { clip-path: none; opacity: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .card-dl, .v-arrow, .v-actions .pill, .v-actions .round, .toast, .v-dock, .v-menubar {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .card-dl, .toast { background: var(--bg); }
  .v-arrow, .v-actions .pill, .v-actions .round { background: #120e0b; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); --line: var(--ink-3); }
}
