/* ATRIA — Rooms made of daylight. A self-initiated interaction study by MOTERA.
   Type: Tenor Sans (display and text), Instrument Serif Italic (editorial lines), JetBrains Mono (labels).
   All SIL OFL 1.1, self-hosted. Tenor Sans is the original font, repacked losslessly as WOFF. */

@font-face { font-family: 'Tenor Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/TenorSans-Regular.woff) format('woff'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/InstrumentSerif-italic-latin.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/JetBrainsMono-normal-latin.woff2) format('woff2'); }

:root {
  --paper: #f4efe6;
  --paper-deep: #ebe4d6;
  --chalk: #faf6ee;
  --stone: #d6c9b3;
  --umber: #261d16;
  --umber-soft: rgba(38, 29, 22, .72);
  --rule: rgba(38, 29, 22, .2);
  --olive: #5a672b;
  --olive-bright: #8a9a45;
  --sun: #ecd29c;
  --hud: var(--umber);                 /* the instruments stay in ink, on the page and in the rooms */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(20px, 4.6vw, 56px);
  --display: 'Tenor Sans', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --dial: min(320px, calc(100vw - 2 * var(--pad)));
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--umber); font-family: var(--display); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3, p, ol, figure { margin: 0; padding: 0; }
ol { list-style: none; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 4px; border-radius: 2px; }
.in-scene .bar, .in-scene .dial-read { text-shadow: 0 0 2px rgba(244, 239, 230, .9), 0 0 10px rgba(244, 239, 230, .85), 0 0 18px rgba(244, 239, 230, .6); }
.in-scene .dial-arc { filter: drop-shadow(0 0 2px rgba(244, 239, 230, .9)) drop-shadow(0 0 7px rgba(244, 239, 230, .6)); }
.skip { position: fixed; left: var(--pad); top: 12px; z-index: 70; padding: 10px 16px; background: var(--umber); color: var(--chalk); font-size: 14px; text-decoration: none; transform: translateY(-300%); }
.skip:focus { transform: none; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
.js #stage { opacity: 0; }                       /* main.js fades the stone in once its shader is ready */
main, .colophon { position: relative; z-index: 1; }
.scrim { position: fixed; z-index: 30; left: 0; right: 0; top: 0; height: min(270px, 40svh); pointer-events: none; opacity: 0; background: linear-gradient(rgba(244, 239, 230, .74), rgba(244, 239, 230, .64) 44%, rgba(244, 239, 230, .58) 67%, rgba(244, 239, 230, .2) 86%, rgba(244, 239, 230, 0)); }

/* ---------- shared type ---------- */
.eyebrow, .caption, .bar-meta, .hint, .dial-read { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow, .caption { color: var(--umber-soft); }
.caption { text-transform: none; letter-spacing: .02em; font-size: 11px; line-height: 1.5; text-wrap: pretty; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.022em; line-height: 1; text-wrap: balance; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-size: 1.14em; letter-spacing: -.012em; line-height: .85; color: var(--olive); }
.lede { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.24; color: var(--umber); max-width: 30ch; }

/* ---------- top bar ---------- */
.bar { position: fixed; z-index: 40; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(16px, env(safe-area-inset-top)) var(--pad) 12px; color: var(--hud); pointer-events: none; opacity: var(--a, 1); }
.bar > * { pointer-events: auto; }
/* --a is written by main.js: the instruments step back while the visitor rises through the oculus (and the dial while
   walking). Keyboard focus always brings them forward; while stepped back they cannot be clicked by accident. */
.bar:focus-within, .dial:focus-within { opacity: 1; }
.rising .bar > *, .rising .dial-input { pointer-events: none; }
.in-index .bar { background: var(--paper); box-shadow: 0 1px 0 var(--rule); }
.mark { font-size: 15px; letter-spacing: .44em; text-decoration: none; padding: 8px 0; margin-right: -.44em; }
.bar-nav { display: none; gap: 30px; font-size: 13px; letter-spacing: .04em; }
.bar-nav a { position: relative; text-decoration: none; padding: 10px 2px; opacity: .72; transition: opacity .3s var(--ease); }
.bar-nav a::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 5px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform .4s var(--ease); }
.bar-nav a:hover, .bar-nav a[aria-current] { opacity: 1; }
.bar-nav a[aria-current]::after { transform: none; }
.bar-meta { font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .bar-nav { display: flex; } }

/* ---------- the hour: a sun path, and a real range input lying over it ---------- */
.dial { position: fixed; z-index: 41; left: 50%; top: clamp(70px, 12.2svh, 96px); width: var(--dial); margin-left: calc(var(--dial) / -2); color: var(--hud); opacity: var(--a, 1); transition: visibility .4s; }
.dial[data-on="false"] { visibility: hidden; }
.dial-arc { display: block; width: 100%; height: auto; overflow: visible; }
.dial-arc * { fill: none; stroke: currentColor; vector-effect: non-scaling-stroke; }
.dial-horizon { stroke-width: 1; opacity: .34; }
.dial-path { stroke-width: 1; opacity: .8; stroke-dasharray: 1 4; stroke-linecap: round; }
.dial-ticks { stroke-width: 1; opacity: .7; }
.dial-drop { stroke-width: 1; opacity: .45; }
.dial-sun-disc { fill: var(--sun); stroke: currentColor; stroke-width: 1.25; transition: r .3s var(--ease); }
.dial-sun-focus { stroke: none; }
.dial-input { position: absolute; z-index: 2; left: 0; top: 0; width: 100%; height: calc(var(--dial) * .1875); margin: 0; padding: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; background: transparent; }
.dial-input::-webkit-slider-runnable-track { height: 100%; }
.dial-input::-webkit-slider-thumb { -webkit-appearance: none; width: calc(var(--dial) * .0875); height: calc(var(--dial) * .1875); }
.dial-input::-moz-range-thumb { width: calc(var(--dial) * .0875); height: calc(var(--dial) * .1875); border: 0; }
.dial-input:focus-visible ~ .dial-arc .dial-sun-focus { stroke: currentColor; stroke-width: 1.5; }
.dial-input:focus-visible ~ .dial-arc .dial-sun-disc, .dial-input:active ~ .dial-arc .dial-sun-disc, .dragging .dial-sun-disc { r: 8px; }
.dial-read { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dial-end { opacity: .72; }
.dial-now label { opacity: .72; margin-right: .5em; }
.dial-now output { letter-spacing: .1em; }
.in-scene .dial-end, .in-scene .dial-now label { opacity: 1; }   /* over stone the labels need all of their ink */
.dial-phase { font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0; text-transform: none; margin-left: .35em; }

/* ---------- acts: without JS they stack; with JS the first two pin and scrub ---------- */
.act { position: relative; }
.pin { position: relative; }
.js .act-model { height: 200svh; }
.js .act-rooms { height: 580svh; margin-top: -100svh; }   /* the walk begins the moment the descent ends */
.js .pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.act-model, .act-rooms { touch-action: pan-y; }

/* the opening page */
.act-model .pin { display: flex; flex-direction: column; min-height: 100svh; padding: clamp(152px, 25svh, 196px) var(--pad) max(22px, env(safe-area-inset-bottom)); }
.hero-copy { will-change: transform, opacity; }
.hero-copy h1 { font-size: clamp(40px, 11.2vw, 58px); margin-top: 10px; }
.model-slot { flex: 1 1 26svh; min-height: 150px; margin: 6px calc(var(--pad) * -0.5) 0; position: relative; }
.hero-foot { display: grid; gap: 12px; margin-top: 14px; }
.hint { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: var(--umber-soft); }
.hint span { padding: 7px 11px; border: 1px solid var(--rule); border-radius: 999px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .act-model .pin { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); grid-template-rows: 1fr auto auto; column-gap: 12px; padding: 21svh var(--pad) clamp(40px, 7svh, 72px); }
  .hero-copy { grid-column: 1; grid-row: 2; }
  .hero-copy h1 { font-size: clamp(56px, 6.5vw, 104px); margin-top: 16px; }
  .model-slot { grid-column: 2; grid-row: 1 / span 3; margin: 0 -2vw 3svh 0; min-height: 0; }
  .hero-foot { grid-column: 1; grid-row: 3; margin-top: 30px; max-width: 38ch; }
  .lede { font-size: 24px; }
}

/* rooms: each line is real text, laid on its wall by a matrix3d that main.js writes each frame */
.rooms-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rooms { position: absolute; inset: 0; pointer-events: none; }
.room { position: absolute; left: 0; top: 0; width: 720px; height: var(--ph, 300px); transform-origin: 0 0; opacity: 0; backface-visibility: hidden; outline: 0; display: grid; place-items: center; text-align: center; color: #21180f; }
.room-fig { display: none; }
.room-k { font-family: var(--mono); font-weight: 400; font-size: 20px; letter-spacing: .26em; text-transform: uppercase; }
.room-n { color: #303b10; margin-right: .5em; }
.room-line { font-family: var(--serif); font-style: italic; font-size: 76px; line-height: .96; letter-spacing: -.012em; max-width: 9.2em; margin: 16px auto 18px; text-wrap: balance; }
.room-d { font-family: var(--mono); font-size: 18px; letter-spacing: .12em; }

/* index */
.act-index { background: var(--paper); padding: clamp(104px, 15svh, 150px) var(--pad) 64px; min-height: 100svh; }
/* in the walk the index lies over its last screen and arrives as the sky turns to paper (main.js writes --arrive);
   the stage is paper by then, so the index needs none of its own. Until it has arrived the pointer passes to the stone. */
.js:not(.flat) .act-index { margin-top: -100svh; background: none; opacity: var(--arrive, 1); }
.js:not(.flat):not(.in-index) .act-index { pointer-events: none; }
.index-grid { display: grid; gap: 22px; max-width: 1240px; margin: 0 auto; }
.index-head h2 { font-size: clamp(38px, 10.4vw, 54px); margin-top: 10px; }
.index-head .lede { margin-top: 14px; }
.plan svg { display: block; width: 100%; height: auto; overflow: visible; }
.plan .caption { margin-top: 10px; max-width: 46ch; }
svg .poche { fill: var(--umber); }
svg .ground { fill: none; stroke: var(--umber); stroke-width: .6; opacity: .5; }
svg .beyond { fill: none; stroke: var(--umber); stroke-width: .5; opacity: .55; }
svg .above { fill: none; stroke: var(--olive); stroke-width: .8; stroke-dasharray: 2 1.6; }
svg .sun { fill: var(--sun); }
.plan-labels text, .compass text { font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; fill: var(--umber); text-anchor: middle; }
.compass text { text-anchor: start; font-size: 6.5px; }
.compass circle, .compass path { fill: none; stroke: var(--umber); stroke-width: .6; }
.compass .compass-sun { fill: var(--olive-bright); stroke: var(--umber); }
.index-list { border-top: 1px solid var(--rule); }
.index-list a { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; gap: 8px; min-height: 48px; padding: 12px 0 11px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: padding .4s var(--ease), color .3s var(--ease); }
.index-n, .index-d { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--umber-soft); font-variant-numeric: tabular-nums; }
.index-name { font-size: 19px; letter-spacing: -.005em; }
@media (hover: hover) { .index-list a:hover { padding-left: 10px; color: var(--olive); } }
.index-foot { display: grid; gap: 14px; justify-items: start; }
.left-at { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--umber-soft); }
.cta { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; font-size: 17px; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 9px) / 100% 1px no-repeat; transition: color .3s var(--ease), gap .4s var(--ease); }
.cta-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--sun); border: 1.25px solid var(--umber); transition: transform .5s var(--ease), background-color .3s var(--ease); }
@media (hover: hover) { .cta:hover { color: var(--olive); gap: 16px; } .cta:hover .cta-dot { transform: scale(1.35); background: var(--olive-bright); } }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .index-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); column-gap: clamp(40px, 6vw, 96px); row-gap: 30px; align-items: start; }
  .index-head { grid-column: 1; grid-row: 1; }
  .index-head h2 { font-size: clamp(54px, 5.4vw, 88px); }
  .plan { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .index-list { grid-column: 1; grid-row: 2; }
  .index-foot { grid-column: 1; grid-row: 3; }
}

.colophon { padding: 26px var(--pad) max(32px, env(safe-area-inset-bottom)); background: var(--paper-deep); color: var(--umber-soft); font-size: 13px; line-height: 1.5; display: grid; gap: 3px; border-top: 1px solid var(--rule); }
.colophon a { color: var(--umber); display: inline-block; padding: 5px 0; margin: -5px 0; }

/* ---------- pointer: a small sun on fine pointers, part of the drawing ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 60; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; opacity: 0; color: var(--hud); will-change: transform; transition: opacity .25s var(--ease); }
.cursor i { position: absolute; inset: 0; border: 1.25px solid currentColor; border-radius: 50%; box-shadow: 0 0 0 1px rgba(244, 239, 230, .55), inset 0 0 0 1px rgba(244, 239, 230, .4); transition: transform .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease); }
.cursor::before, .cursor::after { content: ''; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border: solid currentColor; border-width: 1.25px 0 0 1.25px; opacity: 0; transition: opacity .3s var(--ease), transform .35s var(--ease); }
.cursor::before { left: -4px; transform: translateX(8px) rotate(-45deg); }
.cursor::after { right: -4px; transform: translateX(-8px) rotate(135deg); }
.cursor i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: currentColor; transition: opacity .3s var(--ease); }
.cursor.on { opacity: 1; }
.cursor[data-mode="drag"] i { transform: scale(.46); background: var(--sun); }
.cursor[data-mode="drag"] i::after { opacity: 0; }
.cursor[data-mode="drag"]::before { opacity: 1; transform: translateX(-3px) rotate(-45deg); }
.cursor[data-mode="drag"]::after { opacity: 1; transform: translateX(3px) rotate(135deg); }
.cursor[data-mode="dial"] i { transform: scale(.3); background: currentColor; }
.cursor[data-mode="dial"]::before { opacity: 1; transform: translateX(2px) rotate(-45deg); }
.cursor[data-mode="dial"]::after { opacity: 1; transform: translateX(-2px) rotate(135deg); }
.cursor[data-mode="link"] i { transform: scale(1.5); border-color: var(--olive-bright); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
.js.fine-pointer:not(.flat), .js.fine-pointer:not(.flat) a, .js.fine-pointer:not(.flat) .dial-input { cursor: none; }

/* ---------- fallbacks ---------- */
.section-art { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
html:not(.js) .section-art, .no-webgl .section-art, .js:not(.gl-ready) .section-art { display: block; }
html:not(.js) #stage, .no-webgl #stage { display: none; }
html:not(.js) .dial, html:not(.js) .left-at, html:not(.js) .hint, html:not(.js) .cursor, .no-webgl .hint span:last-child, .flat .hint span:first-child { display: none; }
@media not ((min-width: 900px) and (min-aspect-ratio: 1/1)) { html:not(.js) .act-model .pin, .no-webgl .act-model .pin { padding-top: 104px; } }   /* no dial to leave room for */
/* a drawn monograph instead of a walk: no JS, no WebGL, or reduced motion */
.flat .act-model, .flat .act-rooms { height: auto; margin-top: 0; }
.flat .dial { position: absolute; }
.flat .bar, html:not(.js) .bar { background: var(--paper); box-shadow: 0 1px 0 var(--rule); }
.flat .pin { position: static; height: auto; overflow: visible; }
html:not(.js) .act-rooms, .flat .act-rooms { background: var(--paper); padding: 72px var(--pad) 40px; border-top: 1px solid var(--rule); }
html:not(.js) .rooms-title, .flat .rooms-title { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; font-size: clamp(30px, 7vw, 54px); max-width: 16ch; margin: 0 auto 28px; max-width: 1240px; }
html:not(.js) .rooms, .flat .rooms { position: static; display: grid; gap: 0; max-width: 1240px; margin: 0 auto; pointer-events: auto; }
html:not(.js) .room, .flat .room { position: static; width: auto; height: auto; transform: none !important; opacity: 1 !important; display: grid; grid-template-columns: clamp(92px, 26vw, 200px) 1fr; gap: clamp(16px, 4vw, 48px); place-items: end start; text-align: left; padding: 22px 0; border-top: 1px solid var(--rule); color: var(--umber); }
html:not(.js) .room-fig, .flat .room-fig { display: block; width: 100%; height: auto; }
html:not(.js) .room-k, .flat .room-k { font-size: 11px; letter-spacing: .12em; }
html:not(.js) .room-n, .flat .room-n { color: var(--olive); }
html:not(.js) .room-line, .flat .room-line { font-size: clamp(28px, 6.4vw, 52px); line-height: 1; max-width: 14em; margin: 10px 0 12px; }
html:not(.js) .room-d, .flat .room-d { font-size: 11px; letter-spacing: .06em; color: var(--umber-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .cursor { display: none; }
}
