/* Mihai Cristofor — One night: from last light to first light */
/* registered so the whole sky (background AND text) changes together, smoothly */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #0c1222; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #e9edf7; }
@property --ink-2 { syntax: "<color>"; inherits: true; initial-value: #c9d0e2; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #9aa6c2; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #b4c4ff; }
@property --stars { syntax: "<number>"; inherits: true; initial-value: .55; }
:root {
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  /* night (default for inner pages) */
  --bg: #0c1222; --ink: #e9edf7; --ink-2: #c9d0e2; --muted: #9aa6c2; --accent: #b4c4ff; --line: rgba(233, 237, 247, .13); --stars: .55;
  color-scheme: dark;
}
body[data-sky="dusk"]     { --bg: #22140c; --ink: #f7e9d6; --ink-2: #e6d3bc; --muted: #c4a88c; --accent: #ff9b4d; --line: rgba(247, 233, 214, .14); --stars: .12; }
body[data-sky="evening"]  { --bg: #1a1220; --ink: #f1e6ee; --ink-2: #dccdd8; --muted: #b6a1b2; --accent: #f3a66f; --line: rgba(241, 230, 238, .13); --stars: .35; }
body[data-sky="night"]    { --bg: #0c1222; --ink: #e9edf7; --ink-2: #c9d0e2; --muted: #9aa6c2; --accent: #b4c4ff; --line: rgba(233, 237, 247, .13); --stars: .75; }
body[data-sky="midnight"] { --bg: #000000; --ink: #f3f3f3; --ink-2: #cfcfcf; --muted: #8d8d8d; --accent: #ffffff; --line: rgba(255, 255, 255, .14); --stars: 1; }
body[data-sky="deep"]     { --bg: #061217; --ink: #e2eef0; --ink-2: #c3d6d9; --muted: #8aa6ab; --accent: #6fd6d6; --line: rgba(226, 238, 240, .13); --stars: .7; }
body[data-sky="predawn"]  { --bg: #1b1c2b; --ink: #efe8e2; --ink-2: #d9d0c9; --muted: #aaa1a1; --accent: #f2b48c; --line: rgba(239, 232, 226, .13); --stars: .3; }
body[data-sky="dawn"]     { --bg: #f2e8db; --ink: #1d1813; --ink-2: #3b332b; --muted: #6e6255; --accent: #b4462a; --line: rgba(29, 24, 19, .16); --stars: 0; color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
  transition: --bg 1.6s ease, --ink 1.6s ease, --ink-2 1.6s ease, --muted 1.6s ease, --accent 1.6s ease, --stars 1.6s ease;
}
body.modal-open, body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--bg); padding: 10px 14px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(680px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* stars */
.stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: var(--stars); transition: opacity 1.6s ease; }
main, .site-footer { position: relative; z-index: 1; }

/* type */
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mono b { color: var(--accent); font-weight: 500; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 300; color: var(--ink); letter-spacing: -.015em; margin: 0; font-optical-sizing: auto; }
.t-xl { font-size: clamp(3rem, 8.6vw, 8.2rem); line-height: .94; }
.t-l { font-size: clamp(2.4rem, 5.6vw, 5rem); line-height: 1; }
.t-m { font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08; }
.t-s { font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.3; }
em, .it { font-style: italic; }
h1 em, h2 em, .t-xl em, .t-l em, .t-m em { color: var(--accent); }
p { margin: 0 0 1.05em; }
.lede { font-size: clamp(1.05rem, 1.35vw, 1.2rem); color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.link:hover { color: var(--accent); }
.go { display: inline-flex; gap: .5em; align-items: center; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); transition: color .3s, border-color .3s; }
.go:hover { color: var(--accent); border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 500 14px/1 var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; text-decoration: none; transition: background .3s, border-color .3s, color .3s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.solid:hover { filter: brightness(1.08); color: var(--bg); }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* header */
.site-header { position: fixed; inset: 0 0 auto; z-index: 40; transition: background .4s, border-color .4s; border-bottom: 1px solid transparent; }
.site-header.scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 24px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 12px; }
.brand-name { font: 400 19px/1 var(--serif); color: var(--ink); }
.brand-sub { font: 400 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: clamp(18px, 2.6vw, 34px); }
.nav a { font: 400 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: 10px 0; transition: color .3s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font: 400 11px/1 var(--mono); letter-spacing: .1em; }
  .nav { position: fixed; inset: 68px 0 auto; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 24px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .25s, visibility .25s; }
  .nav a { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .nav-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav-open .site-header { background: var(--bg); }
}

/* the clock (home only) */
.clock { position: fixed; left: var(--gutter); bottom: 22px; z-index: 30; display: flex; align-items: baseline; gap: 12px; pointer-events: none; mix-blend-mode: normal; }
.clock-time { font: 400 15px/1 var(--mono); color: var(--ink); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.clock-label { font: 400 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nightbar { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); width: 1px; height: 38vh; background: var(--line); z-index: 30; pointer-events: none; }
.nightbar span { position: absolute; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); top: calc(var(--night, 0) * 100%); box-shadow: 0 0 10px var(--accent); transition: background 1.6s; }
@media (max-width: 760px) { .nightbar { display: none; } .clock { bottom: 14px; } }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.chapter-mark { display: flex; gap: 14px; align-items: baseline; margin-bottom: 26px; }
.chapter-mark .mono:first-child { color: var(--accent); }

/* ---------- prologue: a slit of light opening ---------- */
.prologue { position: relative; height: 270vh; }
.prologue-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.slit { position: absolute; inset: 0; clip-path: inset(calc(50% * (1 - var(--p, 0))) 0 calc(50% * (1 - var(--p, 0))) 0); will-change: clip-path; }
.slit img { width: 100%; height: 100%; object-fit: cover; filter: blur(calc((1 - var(--p, 0)) * 16px)) saturate(calc(.6 + var(--p, 0) * .5)); transform: scale(calc(1.12 - var(--p, 0) * .12)); }
.slit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 6, 3, .35), rgba(10, 6, 3, .1) 45%, rgba(10, 6, 3, .75)); }
.horizon { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: calc(1 - var(--p, 0) * 3); box-shadow: 0 0 24px var(--accent); }
.pro-a, .pro-b { position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter); transition: opacity .4s linear; }
.pro-a { opacity: calc(1 - var(--p, 0) * 2.2); transform: translateY(calc(var(--p, 0) * -40px)); }
.pro-b { position: absolute; left: 0; right: 0; bottom: 12vh; opacity: calc((var(--p, 0) - .62) * 3.4); }
.pro-a .mono { display: block; margin-bottom: 26px; }
.pro-a h1 { max-width: 11em; margin-inline: auto; }
.pro-b p { margin: 0 auto 10px; max-width: 34em; color: var(--ink); }
.pro-b .early { font: italic 300 clamp(1.6rem, 3vw, 2.4rem)/1.1 var(--serif); margin-bottom: 18px; }
.pro-b .who { font-size: 15px; color: var(--ink-2); }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; opacity: calc(1 - var(--p, 0) * 4); }
@media (prefers-reduced-motion: reduce) { .prologue { height: auto; } .prologue-stage { position: relative; } }

/* ---------- 20:12 afterimage ---------- */
.ch { position: relative; padding: clamp(110px, 16vw, 200px) 0; }
.afterimage-frame { position: relative; margin: 0; }
.afterimage-frame img { width: 100%; height: min(86svh, 900px); object-fit: cover; }
.afterimage-frame .over { position: absolute; left: var(--gutter); bottom: clamp(20px, 5vw, 56px); max-width: 30em; padding: 26px 28px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.afterimage-frame .over p { margin: 0; color: var(--ink); }
.afterimage-after { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 6vw, 96px); margin-top: clamp(56px, 8vw, 110px); align-items: end; }
@media (max-width: 760px) { .afterimage-frame .over { position: relative; left: 0; bottom: 0; max-width: none; } .afterimage-after { grid-template-columns: 1fr; } }
.credit { font: 400 11px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; }
.credit a { color: var(--muted); text-decoration: none; }
.credit a:hover { color: var(--accent); }

/* ---------- 21:30 the unwritten: a catalogue of questions ---------- */
.catalogue { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); margin: clamp(48px, 7vw, 90px) 0; }
.card { margin: 0; }
.card:nth-child(2n) { margin-top: clamp(40px, 6vw, 90px); }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: grayscale(.35) contrast(1.05); transition: filter .8s; }
.card:hover img { filter: none; }
.card figcaption { margin-top: 14px; }
.card .n { font: 400 11px/1 var(--mono); letter-spacing: .16em; color: var(--accent); }
.card .q { font: italic 300 1.35rem/1.25 var(--serif); color: var(--ink); margin-top: 8px; display: block; }
@media (max-width: 860px) { .catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 22:45 the room: a reel ---------- */
.reel { display: flex; gap: clamp(14px, 2vw, 22px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 10px var(--gutter) 26px; margin-top: 44px; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; cursor: grab; }
.reel:active { cursor: grabbing; }
.reel > * { flex: 0 0 auto; scroll-snap-align: start; }
.reel figure { margin: 0; width: clamp(240px, 34vw, 460px); }
.reel figure img { width: 100%; height: clamp(300px, 52vh, 560px); object-fit: cover; user-select: none; -webkit-user-drag: none; }
.reel .say { width: clamp(220px, 26vw, 340px); display: flex; align-items: flex-end; padding-bottom: 8px; }
.reel .say p { font: 300 clamp(1.35rem, 2.1vw, 1.85rem)/1.25 var(--serif); color: var(--ink); margin: 0; }
.reel .say.last p { font-style: italic; color: var(--accent); }
.reel-hint { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- 00:00 midnight ---------- */
.midnight { padding: clamp(140px, 20vw, 260px) 0; text-align: center; overflow: hidden; }
.moon { position: absolute; inset: 0 0 auto; height: 70vh; opacity: .22; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent); }
.moon img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.4); }
.mid-line { margin: 0 auto clamp(70px, 12vw, 140px); max-width: 18em; position: relative; }
.mid-line.small-gap { margin-bottom: 34px; }
.mid-grid { width: min(260px, 60vw); margin: 0 auto clamp(70px, 12vw, 140px); }
.mid-grid rect { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .35); stroke-width: .4; }
.mid-grid .slide { animation: slide 6s cubic-bezier(.6, 0, .3, 1) infinite; }
.mid-grid .hole { fill: none; stroke: var(--accent); stroke-dasharray: 2 1.6; }
@keyframes slide { 0%, 30% { transform: translateX(0); } 45%, 80% { transform: translateX(25px); } 95%, 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .mid-grid .slide { animation: none; } }
.mid-line:has(.math) { max-width: none; }
.math { white-space: nowrap; font: 300 clamp(1rem, 3vw, 2.4rem)/1.2 var(--mono); color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.math .op { color: var(--muted); padding: 0 .2em; }
.contrasts { display: grid; gap: 14px; margin: 0 auto clamp(70px, 12vw, 140px); }
.contrasts p { margin: 0; font: 300 clamp(1.3rem, 2.4vw, 1.9rem)/1.25 var(--serif); color: var(--ink-2); }
.contrasts p em { color: var(--ink); }

/* ---------- 01:30 shared memory: rivers ---------- */
.memory { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 90px); align-items: center; }
.rivers { width: 100%; height: auto; overflow: visible; }
.rivers path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s cubic-bezier(.5, 0, .2, 1); }
.rivers .danube { stroke-width: 3.2; }
.rivers .trib { stroke-width: 1.6; opacity: .85; }
.rivers text { font: 400 10px var(--mono); letter-spacing: .14em; fill: var(--muted); opacity: 0; transition: opacity 1s 1.6s; }
.rivers circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.2; opacity: 0; transition: opacity .6s 2.4s; }
.rivers.drawn path { stroke-dashoffset: 0; }
.rivers.drawn text, .rivers.drawn circle { opacity: 1; }
.rivers.drawn .d1 { transition-delay: 0s; } .rivers.drawn .d2 { transition-delay: .7s; } .rivers.drawn .d3 { transition-delay: 1.4s; }
.inset { margin: 34px 0 0; width: min(320px, 70%); }
.inset img { width: 100%; }
.quote-q { font: italic 300 clamp(1.5rem, 2.6vw, 2.1rem)/1.25 var(--serif); color: var(--ink); margin: 34px 0 0; }
@media (max-width: 860px) { .memory { grid-template-columns: 1fr; } }

/* ---------- 03:20 the crossing ---------- */
.crossing { position: relative; }
.crossing-bg { position: sticky; top: 0; height: 100svh; overflow: hidden; z-index: 0; }
.crossing-bg img { width: 100%; height: 100%; object-fit: cover; }
.crossing-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 10, 14, .2), rgba(4, 10, 14, .55)); }
.crossing-panels { position: relative; z-index: 1; margin-top: -100svh; }
.panel { min-height: 90svh; display: grid; align-items: center; }
.panel .box { max-width: 30em; padding: clamp(22px, 3vw, 36px); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.panel:nth-child(2n) .box { margin-left: auto; }
.panel .box p:last-child { margin-bottom: 0; }
.panel.big .box { max-width: min(880px, 92%); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: 0 2px 30px rgba(0, 0, 0, .7); padding-left: 0; }
.panel.big h2 { color: #fff; }
.panel.big h2 em { color: #fff; }

/* ---------- 05:05 what remains ---------- */
.remains { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); align-items: start; }
.remains .r1 { grid-column: 1 / 8; margin: 0; }
.remains .r2 { grid-column: 9 / 13; margin: clamp(80px, 14vw, 220px) 0 0; }
.remains .r-text { grid-column: 2 / 9; margin-top: clamp(30px, 5vw, 70px); }
.remains img { width: 100%; }
@media (max-width: 760px) { .remains .r1, .remains .r2, .remains .r-text { grid-column: 1 / -1; margin-top: 18px; } }

/* ---------- 06:41 first light ---------- */
.dawn-frame { margin: 0 0 clamp(60px, 9vw, 120px); }
.dawn-frame img { width: 100%; height: min(78svh, 860px); object-fit: cover; }
.dawn-text { text-align: center; }
.dawn-text h2 { margin: 0 auto 26px; }
.dawn-text .lede { margin-inline: auto; max-width: 32em; }
.notify { margin: 44px auto 0; max-width: 520px; text-align: center; }
.notify label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.notify-row { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.notify-row:focus-within { border-color: var(--accent); }
.notify input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: 400 16px/1 var(--sans); padding: 0 16px; outline: none; }
.notify input::placeholder { color: var(--muted); }
.form-status { min-height: 1.6em; margin-top: 14px; font-size: 14px; color: var(--accent); }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(14px, 2vw, 24px); margin-top: clamp(80px, 12vw, 150px); }
.door { position: relative; display: grid; align-content: end; min-height: 380px; padding: 28px; text-decoration: none; overflow: hidden; isolation: isolate; color: #fff; }
.door img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.door::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .75)); }
.door:hover img { transform: scale(1.04); }
.door .mono { color: rgba(255, 255, 255, .75); }
.door h3 { color: #fff; font-size: clamp(2rem, 3.6vw, 3rem); margin: 10px 0 6px; }
.door p { color: rgba(255, 255, 255, .85); margin: 0; max-width: 26em; }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } .door { min-height: 300px; } }

/* ---------- inner pages ---------- */
.page-head { padding: clamp(140px, 18vw, 220px) 0 clamp(50px, 7vw, 90px); position: relative; }
.page-head .lede { margin-top: 26px; max-width: 34em; }
.page-head.with-image { min-height: 80svh; display: grid; align-items: end; isolation: isolate; overflow: hidden; color: #fff; }
.page-head.with-image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-head.with-image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .05) 40%, color-mix(in srgb, var(--bg) 96%, transparent)); }
.page-head .motto { font: italic 300 clamp(1.3rem, 2.2vw, 1.8rem)/1.3 var(--serif); color: var(--ink); max-width: 30em; margin-top: 20px; }
.crumbs { font: 400 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.room-line { font: italic 300 clamp(1.25rem, 2vw, 1.6rem)/1.4 var(--serif); color: var(--ink-2); max-width: 30em; margin: clamp(40px, 6vw, 70px) 0 0; }

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.room { position: relative; display: block; aspect-ratio: 5 / 6; overflow: hidden; text-decoration: none; isolation: isolate; color: #fff; }
.room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); filter: brightness(.85); }
.room::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .82)); }
.room:hover img { transform: scale(1.04); filter: brightness(1); }
.room-body { position: absolute; left: 22px; right: 22px; bottom: 20px; }
.room-num { font: 400 11px/1 var(--mono); letter-spacing: .16em; color: rgba(255, 255, 255, .7); text-transform: uppercase; }
.room-title { display: block; font: 300 2.2rem/1 var(--serif); margin: 10px 0 8px; }
.room-motto { display: block; font: italic 300 1.05rem/1.35 var(--serif); color: rgba(255, 255, 255, .85); margin-bottom: 8px; }
.room-meta { font: 400 11px/1 var(--mono); letter-spacing: .12em; color: rgba(255, 255, 255, .7); text-transform: uppercase; }

.group { padding: clamp(56px, 8vw, 100px) 0 0; }
.group-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 5vw, 72px); margin-bottom: 26px; align-items: end; }
.group-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.05; }
.group-head h2 .n { display: block; font: 400 11px/1 var(--mono); letter-spacing: .16em; color: var(--accent); margin-bottom: 12px; }
.group-head .prose p { font-size: 15px; color: var(--muted); margin-bottom: .6em; }
.group-head .prose a { color: var(--ink); }
@media (max-width: 760px) { .group-head { grid-template-columns: 1fr; } }
.jg { display: flex; flex-wrap: wrap; gap: 8px; }
.jg::after { content: ""; flex-grow: 1000000; }
.jg a { --ar: 1.5; position: relative; display: block; flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * 250px); aspect-ratio: var(--ar); overflow: hidden; background: rgba(127, 127, 127, .1); cursor: zoom-in; }
.jg a img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.jg a:hover img { transform: scale(1.03); }
.jg a .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; font: italic 300 15px/1.35 var(--serif); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); opacity: 0; transition: opacity .3s; }
.jg a:hover .cap, .jg a:focus-visible .cap { opacity: 1; }
@media (max-width: 560px) { .jg { gap: 6px; } .jg a { flex-basis: calc(var(--ar) * 150px); } }
.closing { padding: clamp(90px, 12vw, 160px) 0; text-align: center; }
.closing blockquote { margin: 0 auto; max-width: 22em; font: 300 clamp(1.8rem, 3.6vw, 3rem)/1.15 var(--serif); color: var(--ink); }
.closing cite { display: block; margin-top: 22px; font: 400 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-style: normal; }
.pager { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.pager a { padding: 40px var(--gutter); text-decoration: none; display: grid; gap: 10px; }
.pager a + a { border-left: 1px solid var(--line); text-align: right; }
.pager .t { font: 300 clamp(1.6rem, 3vw, 2.4rem)/1 var(--serif); color: var(--ink); }
.pager a:hover .t { color: var(--accent); }

/* lightbox */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(4, 6, 10, .97); color: #eef; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top, .lb-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--gutter); font: 400 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #9aa6c2; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 clamp(8px, 6vw, 96px); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; font-size: 18px; display: inline-grid; place-items: center; }
.lb-btn:hover { border-color: #fff; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: clamp(8px, 2vw, 28px); } .lb-next { right: clamp(8px, 2vw, 28px); }
.lb-caption { font: italic 300 1.2rem/1.35 var(--serif); letter-spacing: 0; text-transform: none; color: #eef; }
@media (max-width: 560px) { .lb-prev, .lb-next { top: auto; bottom: -62px; transform: none; } .lb-bottom { padding-right: 130px; flex-direction: column; align-items: flex-start; } }

/* puzzle */
dialog.sheet { width: min(760px, 100% - 24px); max-height: calc(100svh - 24px); padding: 0; border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; background: #07090f; color: #d6dbe8; overflow: auto; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.sheet h2 { color: #fff; }
dialog.sheet .btn { color: #eef; border-color: rgba(255, 255, 255, .22); }
dialog.sheet .btn.solid { background: #fff; color: #000; border-color: #fff; }
dialog.sheet .mono, dialog.sheet .muted { color: #8f98ad; }
.sheet-inner { padding: clamp(22px, 4vw, 40px); }
.sheet-close { position: sticky; float: right; top: 0; margin: 14px 14px 0 0; }
.puzzle-stats { display: flex; justify-content: space-between; font: 400 12px/1 var(--mono); color: #8f98ad; margin: 18px 0 10px; font-variant-numeric: tabular-nums; }
.puzzle-stats b { color: #fff; font-weight: 500; }
.board { position: relative; width: min(100%, 520px); aspect-ratio: 1; margin: 0 auto; background: #000; border: 1px solid rgba(255, 255, 255, .12); touch-action: manipulation; }
.board.solved { box-shadow: 0 0 60px rgba(255, 255, 255, .25); }
.tile { position: absolute; left: 0; top: 0; width: 25%; height: 25%; padding: 0; border: 0; background-size: 400% 400%; cursor: pointer; transition: transform .16s ease; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55); }
.tile span { position: absolute; left: 6px; top: 5px; font: 500 11px/1 var(--mono); color: #fff; background: rgba(0, 0, 0, .6); padding: 3px 5px; border-radius: 4px; }
.board.no-numbers .tile span { display: none; }
.tile[aria-disabled="true"] { cursor: default; }
.tile.movable:hover { filter: brightness(1.12); }
.board-ref { position: absolute; inset: 0; background-size: cover; }
.puzzle-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.puzzle-actions .btn { min-height: 40px; padding: 0 16px; font-size: 13px; }
.puzzle-feedback { color: #fff; }
.footnote { font-size: 13px; color: #8f98ad; margin: 16px 0 0; }
.footnote a { color: #fff; }
.reward { text-align: center; position: relative; overflow: hidden; }
.reward canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.reward h2 { margin: 10px 0 18px; }
.reward h2 em { color: #fff; }
.reward .notify-row { border-color: rgba(255, 255, 255, .2); }
.reward .notify input { color: #fff; }
.reward .form-status { color: #fff; }
.reward-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* the thread */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.split > .sticky { position: sticky; top: 110px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split > .sticky { position: static; } }
.section { padding: clamp(80px, 11vw, 150px) 0; border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; padding: 0 0 46px 28px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.timeline li:last-child::before { background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.timeline .when { font: 400 11px/1.7 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.timeline h3 { font: 300 1.75rem/1.1 var(--serif); margin: 0 0 10px; }
.timeline p { margin: 0 0 8px; }
.timeline .t-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 6px; } }
.list-plain { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.list-plain li { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.list-plain li span:last-child { font: 400 11px/1.8 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; }
.prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 18px; margin: 30px 0; }
.prints figure { margin: 0; }
.prints figcaption { font: italic 300 1.1rem/1.3 var(--serif); color: var(--ink); margin-top: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 26px 0; }
.facts div { background: var(--bg); padding: 16px 18px; transition: background-color 1.6s; }
.facts dt { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.facts dd { margin: 0; color: var(--ink); }
.portrait { margin: 0; }

/* forms */
.form { display: grid; gap: 26px; max-width: 640px; }
.field { display: grid; gap: 8px; }
.field label { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font: 400 17px/1.5 var(--sans); padding: 10px 0; border-radius: 0; }
.field select { appearance: none; }
.field select option { background: var(--bg); color: var(--ink); }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 72px 0 40px; }
body.home .site-footer { padding-bottom: 80px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-grid h2 { font: 400 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.foot-grid a:hover { color: var(--accent); }
.foot-line { font: italic 300 1.7rem/1.2 var(--serif); color: var(--ink); max-width: 16em; margin: 0 0 14px; }
.foot-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-base a { color: var(--muted); text-decoration: none; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* 404 */
.void { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter) 80px; }
.void .mid-grid { margin-bottom: 40px; width: 160px; }

/* ---------- writing ---------- */
.essays { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.essay { padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; max-width: 46em; }
.essay .mono { font: 400 11px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.essay .mono a { color: var(--accent); }
.essay h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.12; }
.essay h2 a { color: var(--ink); text-decoration: none; }
.essay h2 a:hover { color: var(--accent); }
.essay p { margin: 0; color: var(--ink-2); max-width: 40em; }
.essay-page .page-head { padding-bottom: clamp(30px, 4vw, 50px); }
.essay-meta { font: 400 11px/1.8 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 22px; }
.essay-meta a { color: var(--accent); }
.essay-body { font: 300 clamp(1.08rem, 1.5vw, 1.2rem)/1.75 var(--serif); color: var(--ink-2); padding-bottom: clamp(40px, 6vw, 80px); }
.essay-body p { margin: 0 0 1.25em; }
.essay-body h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin: 1.8em 0 .7em; color: var(--ink); }
.essay-body strong { color: var(--ink); font-weight: 500; }
.essay-body ul { margin: 0 0 1.4em; padding-left: 1.2em; }
.essay-body li { margin-bottom: .4em; }
.essay-body blockquote { margin: 1.8em 0; padding: 0 0 0 1.1em; border-left: 2px solid var(--accent); }
.essay-body blockquote p { font: italic 300 clamp(1.35rem, 2.4vw, 1.75rem)/1.35 var(--serif); color: var(--ink); margin: 0; }
.essay-sign { font-style: italic; color: var(--ink); margin-top: 2em !important; }
.essay-source { font: 400 12px/1.6 var(--mono); letter-spacing: .08em; color: var(--muted); }
.essay-more { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.essay-more a { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.essay-more .mono { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.essay-more .t { font: 300 1.3rem/1.25 var(--serif); color: var(--ink); }
.essay-more a:hover .t { color: var(--accent); }
.essay .go { justify-self: start; }

/* ---------- 22:45 the colleague: a vertical sequence ---------- */
.seq { margin-top: clamp(40px, 6vw, 80px); }
.seq-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; margin-bottom: clamp(60px, 9vw, 130px); }
.seq-row.flip figure { order: 2; }
.seq-row figure { margin: 0; }
.seq-row figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.seq-say { font: 300 clamp(1.45rem, 2.4vw, 2.1rem)/1.3 var(--serif); color: var(--ink); margin: 0; max-width: 18em; }
.seq-last { font: italic 300 clamp(1.8rem, 3.6vw, 3rem)/1.2 var(--serif); color: var(--accent); text-align: center; max-width: 16em; margin: 0 auto clamp(20px, 4vw, 40px); }
@media (max-width: 760px) {
  .seq-row { grid-template-columns: 1fr; gap: 18px; }
  .seq-row.flip figure { order: 0; }
}
