/* Layout: one dark glass. The doorway fills the screen (sky, ring, one input); an island is one long scroll of three stamped bands. */
:root {
  color-scheme: dark;
  --night: #05070d;       /* the glass behind everything */
  --ink: #0b0f19;         /* bands and sheets */
  --ink-2: #121828;       /* raised surfaces */
  --rule: #232b3d;        /* hairlines */
  --text: #e6e3da;        /* starlight white, warm */
  --muted: #8d93a3;       /* quiet text */
  --halo: #f2dfb2;        /* the ring's glow, warm gold */
  --stamp: #c9a65f;       /* band stamps, kept marks */
  --sky-line: rgba(160, 182, 230, 0.32);
  --silhouette: #0a0d14;
  --paper: #ffffff;
  --paper-ink: #1a1a1a;
  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --f-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, "Roboto Mono", monospace;
  --f-glyph: "Segoe UI Historic", "Noto Sans Egyptian Hieroglyphs", "Noto Sans", sans-serif;
}
html, body { height: 100%; }
body { background: var(--night); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--halo); outline-offset: 3px; }
a { color: var(--halo); }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Screen 1: the doorway ---------- */
#door { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
#doorSky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(120px, 24vh, 280px); pointer-events: none; }
.skyline svg { width: 100%; height: 100%; display: block; }
.skyline path:not([fill="none"]), .skyline circle { fill: var(--silhouette); }
.skyline circle { fill: #3b3222; }
.door-center { position: absolute; left: 0; right: 0; top: 34%; transform: translateY(-50%); display: grid; justify-items: center; gap: 26px; }
.ring { width: 140px; height: 140px; border-radius: 50%; position: relative; border: 1.5px solid rgba(242, 223, 178, 0.55);
  box-shadow: 0 0 22px rgba(242, 223, 178, 0.22), inset 0 0 22px rgba(242, 223, 178, 0.12); transition: box-shadow .6s, border-color .6s; }
.ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid rgba(242, 223, 178, 0.12); }
.ring.bright { border-color: rgba(242, 223, 178, 0.9); box-shadow: 0 0 40px rgba(242, 223, 178, 0.42), 0 0 90px rgba(242, 223, 178, 0.14), inset 0 0 30px rgba(242, 223, 178, 0.22); }
.ring.flick { animation: flick .7s ease; }
@keyframes flick { 40% { opacity: .35; } }
@media (prefers-reduced-motion: no-preference) { .ring { animation: breathe 7s ease-in-out infinite; } }
@keyframes breathe { 50% { box-shadow: 0 0 30px rgba(242, 223, 178, 0.3), inset 0 0 26px rgba(242, 223, 178, 0.16); } }
#say { box-sizing: border-box; width: min(340px, calc(100vw - 32px)); background: rgba(5, 7, 13, 0.55); border: 1px solid var(--rule); border-radius: 999px; padding: 12px 22px;
  text-align: center; font-family: var(--f-display); font-size: 21px; letter-spacing: .01em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#say::placeholder { color: rgba(230, 227, 218, 0.55); font-style: italic; }
#say:focus { outline: none; border-color: rgba(242, 223, 178, 0.55); }
.signin-line { position: absolute; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); text-align: center; z-index: 3; }
.quiet { background: none; border: 0; color: rgba(230, 227, 218, 0.5); font-size: 13px; letter-spacing: .04em; padding: 6px 10px; }
.quiet:hover { color: var(--text); }
.seat { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 3;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--halo); border: 1px solid rgba(242, 223, 178, 0.35); border-radius: 999px; padding: 4px 11px 4px 9px; display: flex; gap: 7px; align-items: center; background: rgba(5,7,13,.5); }
.seat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--halo); box-shadow: 0 0 8px var(--halo); }

/* ---------- sheets (sign-in, what night?) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(3, 4, 8, 0.72); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sheet-card { width: min(380px, 100%); background: var(--ink); border: 1px solid var(--rule); border-radius: 14px; padding: 26px 24px 20px; display: grid; gap: 16px; }
.sheet-card h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 26px; }
.sheet-card p { margin: 0; color: var(--muted); font-size: 14px; }
.btn { background: var(--halo); color: #15120a; border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 15px; justify-self: start; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--rule); font-weight: 400; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field input { background: var(--ink-2); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; min-width: 0; width: 100%; box-sizing: border-box; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- views over the door (island, date sky, dogstar room) ---------- */
.view { position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: hidden; background: var(--night); }
.back { position: fixed; z-index: 12; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px));
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule); background: rgba(5, 7, 13, 0.7); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.kept { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stamp); border: 1px solid var(--stamp); border-radius: 4px; padding: 3px 8px; transform: rotate(-3deg); display: inline-block; }

/* island bands */
.band { position: relative; border-top: 1px solid var(--rule); }
.band-inner { max-width: 1080px; margin: 0 auto; padding-block: 56px 64px; padding-left: max(56px, calc(env(safe-area-inset-left, 0px) + 40px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); box-sizing: border-box; }
.stamp { position: absolute; left: max(10px, env(safe-area-inset-left, 0px)); top: 56px; writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--stamp); border: 1px solid rgba(201, 166, 95, 0.55); border-radius: 3px; padding: 10px 4px; z-index: 2; background: rgba(5,7,13,.55); }
h1.island-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(36px, 7vw, 68px); line-height: 1.02; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2.band-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 4.4vw, 38px); margin: 0 0 14px; text-wrap: balance; }
.note { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.prose { max-width: 62ch; }
.prose p { margin: 0 0 14px; }

/* reality: photo with sky */
.photo-wrap { position: relative; width: 100%; aspect-ratio: 1280 / 851; max-height: 78vh; background: #000; overflow: hidden; }
.photo-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.photo-head { position: absolute; left: 0; right: 0; top: 0; padding-bottom: 28px; background: linear-gradient(rgba(3,5,10,.55), rgba(3,5,10,.25) 70%, rgba(3,5,10,0)); padding-top: calc(70px + env(safe-area-inset-top, 0px)); padding-left: max(56px, calc(env(safe-area-inset-left, 0px) + 40px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 8px; z-index: 2; text-shadow: 0 1px 12px rgba(0,0,0,.7); }
.sky-say { font-size: 15px; color: var(--text); max-width: 46ch; }
.toggle { display: inline-flex; border: 1px solid rgba(230,227,218,.3); border-radius: 999px; overflow: hidden; background: rgba(5,7,13,.55); justify-self: start; }
.toggle button { background: none; border: 0; padding: 5px 13px; font-size: 13px; color: var(--muted); }
.toggle button[aria-pressed="true"] { background: rgba(242,223,178,.16); color: var(--text); }
.credit { position: absolute; right: 8px; bottom: 6px; z-index: 2; font-size: 10.5px; color: rgba(255,255,255,.8); background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 3px; max-width: calc(100% - 16px); }
.credit a { color: inherit; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin-top: 8px; }
.fact { padding: 18px 18px 18px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.fact .k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-family: var(--f-display); font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fact .s { font-size: 13.5px; color: var(--muted); }
.keep-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }

/* theory: two shaft skies */
.shafts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.shaft { min-width: 0; }
.shaft canvas { width: 100%; aspect-ratio: 4 / 3; display: block; border-radius: 6px; background: #04060b; border: 1px solid var(--rule); }
.shaft .cap { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.ramps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 8px; }
.ramp { border-top: 1px solid var(--rule); padding-top: 10px; min-width: 0; }
.ramp svg { width: 100%; height: 70px; display: block; }
.ramp b { font-family: var(--f-display); font-weight: 600; font-size: 17px; }
.ramp p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* creative: the make table */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.card { background: var(--ink); border: 1px solid var(--rule); border-radius: 10px; padding: 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 20px; }
.card .sub { margin: 0; color: var(--muted); font-size: 14px; }
.hgt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cartouche { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 2.5px solid var(--halo); border-radius: 999px; padding: 6px 26px 6px 20px; position: relative;
  font-family: var(--f-glyph); font-size: 34px; line-height: 1.2; color: var(--halo); overflow-wrap: anywhere; word-break: break-all; }
.cartouche::after { content: ""; position: absolute; right: -10px; top: 18%; bottom: 18%; width: 3px; background: var(--halo); border-radius: 2px; }
.key { font-size: 12px; color: var(--muted); font-family: var(--f-mono), var(--f-glyph); overflow-wrap: anywhere; }
.net svg { width: 100%; height: auto; display: block; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; }
.palette button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.palette button[aria-pressed="true"] { border-color: var(--text); }

.sources { border-top: 1px solid var(--rule); }
.sources ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.sources li { color: var(--muted); }
.island-foot { text-align: center; padding-block: 26px 40px; display: grid; gap: 8px; justify-items: center; }
.island-foot .tiny { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* date sky + dogstar room */
.room { max-width: 980px; margin: 0 auto; padding-block: calc(76px + env(safe-area-inset-top, 0px)) 60px; box-sizing: border-box; }
.dome { width: min(560px, 100%); aspect-ratio: 1; display: block; margin: 0 auto; }
.dome-label { text-align: center; font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; color: var(--text); margin-top: 10px; }
.dome-moon { text-align: center; color: var(--muted); font-size: 14px; margin-top: 4px; }
.room h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(32px, 6vw, 52px); margin: 0 0 6px; }
.room-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.room-card { background: var(--ink); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; color: var(--text); text-decoration: none; }
.room-card .art { aspect-ratio: 4 / 3; background: #04060b; display: grid; place-items: center; overflow: hidden; position: relative; }
.room-card .art canvas, .room-card .art svg { width: 100%; height: 100%; display: block; }
.room-card .body { padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
.room-card b { font-family: var(--f-display); font-size: 20px; font-weight: 600; }
.room-card span { color: var(--muted); font-size: 14px; }
a.room-card:hover { border-color: rgba(242,223,178,.45); }
.poster-art { background: linear-gradient(#0c1426, #04060b); }
.poster-art svg { width: 86%; height: auto; }

/* print-ready view */
#printView { position: fixed; inset: 0; z-index: 30; overflow-y: auto; background: #2a2d33; }
.pv-bar { position: sticky; top: 0; z-index: 2; background: #17191d; color: #e8e6e1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 14px; }
.pv-bar b { font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.pv-bar .pv-note { color: #a9adb6; font-size: 12.5px; flex: 1 1 260px; }
.pv-pages { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 22px 16px 50px; }
.page { width: 8.5in; height: 11in; background: var(--paper); color: var(--paper-ink); box-sizing: border-box; padding: 0.25in; position: relative; flex: none; zoom: var(--pz, 0.42); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.page svg { width: 8in; height: 10.5in; display: block; }
.page .plabel { position: absolute; top: 0.06in; left: 0.3in; font: 9pt var(--f-mono); color: #555; }
.pv-pages.assembled { display: grid; justify-content: center; gap: 4px; }
@page { size: letter; margin: 0; }
@media print {
  body > *:not(#printView) { display: none !important; }
  #printView { position: static; background: none; overflow: visible; }
  .pv-bar { display: none; }
  .pv-pages, .pv-pages.assembled { display: block; padding: 0; }
  .page { zoom: 1 !important; box-shadow: none; page-break-after: always; break-after: page; }
}

@media (max-width: 760px) {
  .cards, .room-cards { grid-template-columns: 1fr; }
  .shafts { grid-template-columns: 1fr; }
  .ramps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact .v { font-size: 24px; }
  .photo-wrap { aspect-ratio: auto; height: clamp(540px, 82vh, 760px); max-height: none; }
  .photo-head { padding-left: max(52px, calc(env(safe-area-inset-left, 0px) + 40px)); }
}
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; } }
/* ---------- ALPHA 2 additions: real sign-in, the pane line, the room, the link code ---------- */
html, body { margin: 0; }
[hidden] { display: none !important; }
.pane-line { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: rgba(230,227,218,.62); text-align: center; min-height: 1.4em; }
.said { font-size: 14px; color: var(--muted); text-align: center; max-width: min(420px, calc(100vw - 32px)); min-height: 1.5em; }
.seat { cursor: pointer; font: inherit; font-family: var(--f-mono); font-size: 12px; }
.seat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat-btn { background: var(--ink-2); border: 1px solid var(--rule); border-radius: 10px; padding: 12px; text-align: left; display: grid; gap: 2px; min-width: 0; }
.seat-btn:hover { border-color: rgba(242,223,178,.45); }
.seat-btn b { font-family: var(--f-display); font-size: 19px; font-weight: 600; }
.seat-btn span { font-size: 12.5px; color: var(--muted); }
.seat-btn .suit { font-size: 18px; color: var(--halo); }
.pin { font-family: var(--f-mono); font-size: 26px; letter-spacing: .5em; text-align: center; }
.msg { color: var(--halo) !important; min-height: 1.2em; }
.divider { border: 0; border-top: 1px solid var(--rule); margin: 2px 0; width: 100%; }
.link-box { display: grid; gap: 10px; justify-items: center; text-align: center; }
.link-box img { width: 200px; height: 200px; image-rendering: pixelated; border-radius: 8px; background: var(--night); }
.link-code { font-family: var(--f-mono); font-size: 30px; letter-spacing: .14em; color: var(--halo); }
.link-url { font-family: var(--f-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.room-card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.room-card .acts .btn { font-size: 13.5px; padding: 7px 14px; }
.room-card .line { font-size: 13.5px; color: var(--muted); }
.room-card .line b { font-family: var(--f-body); font-size: 13.5px; font-weight: 700; color: var(--text); }
.room-card .art .placeholder { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding: 18px; text-align: center; line-height: 1.5; }
.room-section { margin-top: 34px; }
.room-section h2 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 0; }
.stampchip { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--stamp); border: 1px solid rgba(201,166,95,.5); border-radius: 3px; padding: 1px 6px; justify-self: start; }
.room-empty { color: var(--muted); font-size: 14.5px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(54px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px; font-size: 14px; max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; }
