:root {
  --ink: #08090B;
  --ink2: #0C0E11;
  --bone: #E8E2D6;
  --dim: rgba(232, 226, 214, 0.66);
  --dim2: rgba(232, 226, 214, 0.5);
  --line: rgba(232, 226, 214, 0.15);
  --cold: #8FC4D2;
  --warm: #E9DFC7;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: filter 1.4s var(--ease);
}

body[data-drift="1"] { filter: saturate(0.62) brightness(0.86); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.frame {
  position: fixed; inset: 13px; z-index: 60; pointer-events: none;
  border: 1px solid rgba(232, 226, 214, 0.07);
}

.grain {
  position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 900ms steps(2, end) infinite;
}
@keyframes grain {
  0% { background-position: 0 0; }
  50% { background-position: -22px 14px; }
  100% { background-position: 12px -18px; }
}

.beam {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 40%), rgba(232, 226, 214, 0.055), transparent 62%);
  transition: opacity 1.2s var(--ease);
}
body[data-drift="1"] .beam { opacity: 0.12; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 42px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--ink) 0%, var(--ink) 52%, rgba(8, 9, 11, 0.82) 76%, rgba(8, 9, 11, 0));
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 11.5px; letter-spacing: 0.28em; text-transform: uppercase; }
.mark { width: 7px; height: 16px; background: linear-gradient(to top, var(--warm) 42%, var(--cold) 42%, var(--cold) 58%, var(--warm) 58%); opacity: 0.85; }
.nav { display: flex; gap: 26px; align-items: center; }

.lnk {
  position: relative; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--dim); padding-bottom: 4px; transition: color 0.5s var(--ease);
}
.lnk::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
.lnk:hover { color: var(--bone); }
.lnk:hover::after, .lnk.is-on::after { transform: scaleX(1); }
.lnk.is-on { color: var(--bone); }

.sound { display: flex; align-items: center; gap: 8px; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 9px; }
.eq i { width: 1.5px; height: 3px; background: currentColor; }
.sound[aria-pressed="true"] { color: var(--bone); }
.sound[aria-pressed="true"] .eq i { animation: eq 1.1s ease-in-out infinite; }
.sound[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: 0.22s; }
.sound[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: 0.44s; }
@keyframes eq { 0%, 100% { height: 2px; } 50% { height: 9px; } }

main { position: relative; height: 100dvh; }

.view {
  position: absolute; inset: 0; padding: 96px 42px 42px;
  opacity: 0; pointer-events: none; transform: translateY(14px); filter: blur(7px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease), filter 0.85s var(--ease);
}
body[data-view="intro"] #view-intro,
body[data-view="stage"] #view-stage,
body[data-view="archive"] #view-archive {
  opacity: 1; pointer-events: auto; transform: none; filter: none;
}

.intro-grid {
  height: 100%; display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1fr);
  gap: 72px; max-width: 1360px; margin: 0 auto; align-items: center; overflow-y: auto;
}
.overline { font-size: 10.5px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--dim); }

h1 {
  font-family: var(--serif); font-weight: 300; font-size: clamp(56px, 8.2vw, 132px);
  line-height: 0.84; letter-spacing: -0.02em; margin: 26px 0 18px;
}
.latin { font-family: var(--serif); font-style: italic; font-size: 21px; letter-spacing: 0.1em; color: var(--dim); }

.tombstone { margin-top: 52px; display: grid; gap: 20px; border-top: 1px solid var(--line); padding-top: 24px; max-width: 320px; }
.tombstone dt { font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim2); margin-bottom: 6px; }
.tombstone dd { font-size: 12.5px; line-height: 1.6; color: rgba(232, 226, 214, 0.72); }

.statement { display: grid; gap: 15px; max-width: 620px; }
.statement p { font-family: var(--serif); font-size: clamp(16px, 1.25vw, 20px); line-height: 1.62; color: rgba(232, 226, 214, 0.8); }
.statement p:first-child em { font-size: 1.22em; color: var(--bone); font-style: italic; }

.legend { list-style: none; margin: 34px 0 22px; display: grid; gap: 11px; border-top: 1px solid var(--line); padding-top: 22px; }
.legend li { display: grid; grid-template-columns: 26px 168px 1fr; align-items: center; gap: 12px; font-size: 11px; letter-spacing: 0.1em; }
.legend b { font-weight: 400; text-transform: uppercase; letter-spacing: 0.2em; font-size: 10.5px; }
.legend i { font-style: normal; color: var(--dim); }
.sw { height: 12px; border-radius: 1px; }
.sw--focus { background: linear-gradient(to top, #A8966F, #E9DFC7); }
.sw--stone { background: linear-gradient(to top, #5E5C46, #A9A88A); }
.sw--drift { background: linear-gradient(to top, #1D2229, #3A4552); box-shadow: inset 0 1px 0 rgba(143, 196, 210, 0.6); }
.sw--haze { background: linear-gradient(to top, #3A4552, #E9DFC7); }

.fineprint { font-size: 11.5px; line-height: 2; color: var(--dim2); max-width: 600px; }

.starter { margin-top: 40px; display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.picks { display: flex; align-items: center; gap: 8px; }
.pick { width: 44px; height: 44px; border: 1px solid var(--line); font-size: 13px; color: var(--dim); transition: all 0.5s var(--ease); }
.pick:hover { border-color: var(--dim2); color: var(--bone); }
.pick.is-on { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.picks-unit { font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim2); margin-left: 6px; line-height: 1.5; }

.cta {
  position: relative; overflow: hidden; border: 1px solid rgba(232, 226, 214, 0.3);
  padding: 19px 38px; font-size: 11.5px; letter-spacing: 0.3em; text-transform: uppercase;
}
.cta span { position: relative; z-index: 2; transition: color 0.6s var(--ease); }
.cta em { position: absolute; inset: 0; background: var(--bone); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease); }
.cta:hover em { transform: scaleX(1); }
.cta:hover span { color: var(--ink); }

.view--stage { display: grid; grid-template-columns: 210px minmax(0, 1fr) 272px; gap: 34px; align-items: stretch; }
.rail { display: flex; flex-direction: column; min-height: 0; position: relative; }

.state { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 0 0 rgba(233, 223, 199, 0.5); animation: pulse 3.4s var(--ease) infinite; }
.state-name { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; }
body[data-drift="1"] .state .dot { background: var(--cold); animation-duration: 1.2s; }
body[data-drift="1"] .state-name { color: var(--cold); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(233, 223, 199, 0.35); } 70% { box-shadow: 0 0 0 13px rgba(233, 223, 199, 0); } 100% { box-shadow: 0 0 0 0 rgba(233, 223, 199, 0); } }

.readouts { display: grid; gap: 0; margin-top: 4px; }
.ro { padding: 15px 0; border-bottom: 1px solid var(--line); }
.ro dt { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim2); }
.ro dd { font-family: var(--serif); font-size: 30px; line-height: 1.05; margin-top: 5px; font-weight: 300; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.rail-note { margin-top: auto; padding-top: 24px; font-size: 12.5px; line-height: 1.8; color: var(--dim2); font-style: italic; font-family: var(--serif); }

.vessel-wrap { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
#vessel { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.tip {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -190%);
  border: 1px solid var(--line); background: rgba(8, 9, 11, 0.9); backdrop-filter: blur(6px);
  padding: 9px 13px; font-size: 10.5px; letter-spacing: 0.14em; white-space: nowrap;
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.tip.is-on { opacity: 1; }

.journal-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cap { font-size: 10.5px; letter-spacing: 0.16em; color: var(--dim2); }
.journal { list-style: none; overflow-y: auto; flex: 1; margin-top: 2px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.journal li {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line); position: relative;
  font-size: 11px; letter-spacing: 0.08em; color: rgba(232, 226, 214, 0.66);
  animation: rise 0.7s var(--ease) both;
}
.journal li::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--warm); opacity: 0.55; }
.journal li.drift::before { background: var(--cold); opacity: 0.95; }
.journal li.permitted::before { background: #A9A88A; opacity: 0.85; }
.journal li.permitted { color: #B8B69B; }
.journal li.drift { color: var(--cold); }
.journal li b { font-weight: 400; text-transform: uppercase; letter-spacing: 0.2em; font-size: 10px; }
.journal li span { color: var(--dim2); font-variant-numeric: tabular-nums; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stage-actions { padding-top: 18px; }
.ghost {
  border: 1px solid var(--line); padding: 11px 15px; font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dim); transition: all 0.5s var(--ease);
}
.ghost:hover { color: var(--ink); background: var(--bone); border-color: var(--bone); }

.wall-label {
  position: absolute; inset: 0; background: var(--ink); display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.9s var(--ease) 0.7s, transform 0.9s var(--ease) 0.7s;
  overflow-y: auto;
}
body[data-phase="result"] .wall-label { opacity: 1; pointer-events: auto; transform: none; }
body[data-phase="result"] .state .dot { animation: none; opacity: 0.4; }
body[data-phase="result"] .journal, body[data-phase="result"] .journal-head, body[data-phase="result"] .stage-actions { opacity: 0; transition: opacity 0.5s; }
body[data-phase="result"] .rail--left .readouts, body[data-phase="result"] .rail-note { opacity: 0.25; transition: opacity 0.9s; }

.wall-label h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 4vh, 40px); line-height: 1; margin: 12px 0 6px; }
.lab-sub { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--dim); margin-bottom: clamp(10px, 3vh, 24px); }
.lab-metrics { display: grid; gap: 0; border-top: 1px solid var(--line); }
.lab-metrics > div { display: flex; justify-content: space-between; align-items: baseline; padding: clamp(5px, 1.1vh, 10px) 0; border-bottom: 1px solid var(--line); }
.lab-metrics dt { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim2); }
.lab-metrics dd { font-size: 13px; font-variant-numeric: tabular-nums; }
.lab-read { margin-top: clamp(10px, 2.5vh, 20px); font-family: var(--serif); font-size: 15px; line-height: 1.6; color: rgba(232, 226, 214, 0.74); }
.lab-actions { margin-top: auto; padding-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }

.view--archive { display: flex; flex-direction: column; overflow: hidden; }
.arc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.arc-head h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(38px, 5vw, 70px); line-height: 1; margin-top: 10px; }
.arc-tools { display: flex; gap: 10px; align-items: center; }
.tabs { display: flex; border: 1px solid var(--line); }
.tab { padding: 11px 17px; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); transition: all 0.4s var(--ease); }
.tab.is-on { background: var(--bone); color: var(--ink); }
.arc-body { flex: 1; overflow-y: auto; margin-top: 1px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.arc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); border-left: 1px solid var(--line); }
.card { display: grid; grid-template-columns: 92px 1fr; gap: 18px; padding: 26px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background 0.6s var(--ease); }
.card:hover { background: rgba(232, 226, 214, 0.028); }
.card canvas { width: 92px; display: block; }
.card-info { display: flex; flex-direction: column; min-width: 0; }
.card-idx { font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim2); }
.card-title { font-family: var(--serif); font-size: 24px; font-weight: 300; margin: 6px 0 3px; }
.card-task { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--dim); margin-top: 7px; }
.card-date { font-size: 10.5px; letter-spacing: 0.14em; color: var(--dim); }
.card-rows { margin-top: 14px; display: grid; gap: 7px; font-size: 11px; letter-spacing: 0.08em; color: var(--dim); }
.card-rows span { display: flex; justify-content: space-between; gap: 10px; }
.card-rows b { font-weight: 400; color: rgba(232, 226, 214, 0.85); font-variant-numeric: tabular-nums; }
.card-kill { margin-top: auto; align-self: flex-start; padding-top: 14px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim2); opacity: 0; transition: opacity 0.4s; }
.card:hover .card-kill { opacity: 1; }
.card-kill:hover { color: var(--bone); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); }
.day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 340px; }
.day-name { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim2); }
.day-name.is-today { color: var(--bone); }
.day-stack { display: flex; gap: 7px; align-items: flex-end; flex: 1; position: relative; }
.day-stack::after { content: ""; position: absolute; left: -14px; right: -14px; bottom: -1px; height: 1px; background: var(--line); }
.day-sum { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }

.empty { padding: 90px 20px; text-align: center; }
.empty p { font-family: var(--serif); font-size: 21px; color: var(--dim); font-style: italic; }

.toast {
  position: fixed; left: 50%; bottom: 46px; transform: translate(-50%, 16px); z-index: 70;
  border: 1px solid var(--line); background: rgba(8, 9, 11, 0.92); backdrop-filter: blur(8px);
  padding: 12px 20px; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim);
  opacity: 0; pointer-events: none; transition: all 0.6s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


body[data-view="ritual"] #view-ritual,
body[data-view="method"] #view-method,
body[data-view="room"] #view-room { opacity: 1; pointer-events: auto; transform: none; filter: none; }

.method { margin: 30px 0 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.refs { list-style: none; counter-reset: r; margin: 16px 0 18px; display: grid; gap: 12px; }
.refs li { counter-increment: r; position: relative; padding-left: 30px; font-size: 12.5px; line-height: 1.8; color: rgba(232,226,214,0.62); }
.refs li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 0; font-size: 10px; letter-spacing: 0.1em; color: var(--dim2); }
.refs b { font-weight: 400; color: var(--bone); }
.refs i, .fineprint i { font-style: italic; color: var(--dim2); font-family: var(--serif); font-size: 1.18em; letter-spacing: 0.01em; }

.view--ritual, .view--method { display: grid; place-items: center; padding-top: 74px; }
.method-body { border-top: 1px solid var(--line); padding-top: 26px; }
.method-body .refs { margin-top: 0; }
.ritual { width: min(760px, 100%); max-height: 100%; overflow-y: auto; }
.ritual-h { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 4.4vw, 52px); line-height: 1; margin: 10px 0 20px; }
.vow { display: grid; gap: 17px; }
.field { display: block; }
.lbl { display: block; font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim2); margin-bottom: 11px; }
.lbl i { font-style: normal; letter-spacing: 0.08em; text-transform: none; opacity: 0.7; }
.vow input {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--bone); font-family: var(--serif); font-size: 23px; font-weight: 300;
  padding: 6px 0 12px; outline: none; transition: border-color 0.5s var(--ease);
}
.vow input::placeholder { color: rgba(232,226,214,0.18); }
.vow input:focus { border-color: var(--dim2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  padding: 9px 13px; font-size: 11px; letter-spacing: 0.12em; color: var(--dim);
  transition: all 0.45s var(--ease);
}
.chip.is-on { border-color: rgba(169,168,138,0.6); color: var(--bone); background: rgba(169,168,138,0.09); }
.chip b { font-weight: 400; cursor: pointer; }
.chip span { opacity: 0.4; cursor: pointer; font-size: 12.5px; line-height: 1; }
.chip span:hover { opacity: 1; }
.chip-add { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.chip-add input { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; }
.chip-add .ghost { padding: 9px 14px; }

.rule { margin-top: 12px; max-width: 640px; }
.oath {
  font-family: var(--serif); font-style: italic; font-size: clamp(17px, 2vw, 23px);
  line-height: 1.5; color: rgba(232,226,214,0.78); border-left: 1px solid var(--line);
  padding: 4px 0 4px 20px;
}

.switch { display: flex; align-items: flex-start; gap: 13px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sw-box { width: 15px; height: 15px; border: 1px solid var(--dim2); flex: none; margin-top: 2px; position: relative; transition: all 0.4s var(--ease); }
.sw-box::after { content: ""; position: absolute; inset: 3px; background: var(--bone); opacity: 0; transition: opacity 0.4s var(--ease); }
.switch input:checked + .sw-box { border-color: var(--bone); }
.switch input:checked + .sw-box::after { opacity: 1; }
.sw-txt { font-size: 11.5px; letter-spacing: 0.14em; color: rgba(232,226,214,0.74); }
.sw-txt i { display: block; font-style: normal; font-size: 10.5px; color: var(--dim2); margin-top: 5px; letter-spacing: 0.08em; }

.ritual-go { display: flex; align-items: center; gap: 26px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }

.task-line {
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--dim);
  padding: 14px 0 2px; min-height: 22px;
}
.ro--big dd { font-size: 44px; }
.witness-badge {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim2);
  opacity: 0; transition: opacity 0.6s var(--ease); pointer-events: none;
}
.witness-badge.is-on { opacity: 1; }

.ask { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8,9,11,0.72); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease); }
.ask.is-on { opacity: 1; pointer-events: auto; }
.ask-box { width: min(520px, calc(100vw - 48px)); border: 1px solid var(--line); background: var(--ink2); padding: 34px; }
.ask-box h3 { font-family: var(--serif); font-weight: 300; font-size: 36px; margin: 12px 0 8px; }
.ask-sub { font-size: 12.5px; line-height: 1.75; color: var(--dim); margin-bottom: 22px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chips .chip { cursor: pointer; }
.ask-chips .chip:hover { border-color: var(--bone); color: var(--bone); }
.ask-actions { display: flex; gap: 8px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }

.view--room { display: flex; flex-direction: column; overflow: hidden; }
.net-state { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim2); }
.net-state.is-live { color: var(--bone); }
.room-body { flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; overflow: hidden; padding-top: 24px; }
.room-main { display: flex; flex-direction: column; min-height: 0; }
.room-note { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: rgba(232,226,214,0.7); max-width: 620px; margin-bottom: 26px; }
.wall { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 1px; align-content: start; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.peer { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.peer.is-me { background: rgba(232,226,214,0.04); }
.peer canvas { display: block; }
.peer-name { font-size: 10px; letter-spacing: 0.14em; color: var(--dim); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-state { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim2); }
.peer.drift .peer-state { color: var(--cold); }
.wall-empty { grid-column: 1 / -1; padding: 60px 16px; text-align: center; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--dim2); }

.room-side { overflow-y: auto; display: grid; gap: 34px; align-content: start; }
.side-block { display: grid; gap: 12px; }
.side-note { font-size: 11.5px; line-height: 1.9; color: var(--dim2); }
.ex-row { display: flex; gap: 8px; }
.ex-row input { flex: 1; min-width: 0; background: none; border: 1px solid var(--line); color: var(--bone); font-family: var(--mono); font-size: 11.5px; padding: 10px 12px; outline: none; }
.ex-row input:focus { border-color: var(--dim2); }
.ghost.wide { width: 100%; text-align: center; }
.guests { display: grid; gap: 1px; }
.guest { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.08em; color: var(--dim); }
.guest b { font-weight: 400; color: var(--bone); }
.guest button { margin-left: auto; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim2); }
.guest button:hover { color: var(--bone); }
.coll-wrap { border: 1px solid var(--line); padding: 10px; display: grid; place-items: center; }
#coll { display: block; }

.experiment { font-size: 12px; letter-spacing: 0.06em; line-height: 1.9; color: var(--dim); padding: 16px 0 4px; border-bottom: 1px solid var(--line); }
.experiment b { font-weight: 400; color: var(--bone); }


.live-dot { display: none; width: 5px; height: 5px; border-radius: 50%; background: var(--warm); margin-left: 7px; vertical-align: middle; }
.live-dot.is-on { display: inline-block; animation: pulse 3s var(--ease) infinite; }

.feed-block { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.feed-live { color: var(--dim2); letter-spacing: 0.1em; text-transform: none; }
.feed { list-style: none; max-height: 190px; overflow-y: auto; margin-top: 10px; display: grid; gap: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--dim); animation: rise 0.6s var(--ease) both; }
.feed li b { font-weight: 400; color: rgba(232, 226, 214, 0.9); }
.feed li i { font-style: normal; color: var(--dim2); }
.feed li time { color: var(--dim2); font-variant-numeric: tabular-nums; }
.feed li.rupture b { color: var(--cold); }
.feed li.core b { color: var(--warm); }
.feed-empty { padding: 18px 0; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--dim2); }

.side-count { color: var(--dim2); letter-spacing: 0.1em; }
.shared { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.shared figure { margin: 0; display: grid; gap: 5px; justify-items: center; animation: rise 0.6s var(--ease) both; }
.shared canvas { display: block; }
.shared figcaption { font-size: 9.5px; color: var(--dim2); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.t-short { display: none; }
#journal-toggle { display: none; }

@media (max-width: 1180px) {
  .view--stage { grid-template-columns: 200px minmax(0, 1fr) 250px; gap: 26px; }
  .ro dd { font-size: 24px; }
}
@media (max-width: 980px) {
  .view { padding: 86px 20px calc(26px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }

  .topbar { padding: 6px 20px; }
  .lnk { padding: 14px 0; }
  .chip-add .ghost { padding: 14px 18px; }
  .switch { padding: 6px 0; }
  .ghost { padding: 14px 16px; }
  .tab { padding: 14px 17px; }
  .chip { padding: 12px 14px; }
  .card-kill { padding: 14px 0 4px; }
  .ex-row input, .chip-add input { padding: 13px 12px; }
  .cta { padding: 18px 30px; }

  .intro-grid { display: flex; flex-direction: column; align-items: stretch; height: auto; overflow: visible; gap: 0; padding-bottom: 0; max-width: none; }
  .intro-left, .intro-right { display: contents; }
  .overline { order: 1; letter-spacing: 0.2em; font-size: 10px; }
  h1 { order: 2; margin: 20px 0 14px; }
  .latin { order: 3; }
  .statement { order: 4; margin-top: 30px; }
  .legend { order: 5; }
  .starter { order: 6; width: 100%; flex-direction: column; align-items: stretch; gap: 16px; }
  .starter .cta { width: 100%; }
  .starter .lnk { align-self: flex-start; }
  .tombstone { order: 7; margin-top: 36px; max-width: none; }

  .ritual { max-height: none; overflow: visible; width: 100%; }
  .ritual-go {
    position: sticky; bottom: calc(-26px - env(safe-area-inset-bottom));
    margin: 4px 0 0; padding: 14px 0 calc(30px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--ink) 62%, rgba(8, 9, 11, 0.92) 85%, rgba(8, 9, 11, 0));
    flex-wrap: wrap; gap: 12px 14px; border-top: 1px solid var(--line);
  }
  .ritual-go .picks { width: 100%; justify-content: space-between; }
  .ritual-go .cta { flex: 1; }
  .picks-unit { margin-left: auto; text-align: right; }
  .view--ritual, .view--method { display: block; padding-top: 86px; }
  .method-body { padding-top: 20px; }

  .view--stage {
    display: grid; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(140px, 1fr) auto auto;
    gap: 14px; overflow: hidden;
    padding: 64px 20px calc(16px + env(safe-area-inset-bottom));
  }
  .vessel-wrap { grid-row: 1; height: auto; min-height: 0; flex: none; }
  .rail--left { grid-row: 2; display: grid; gap: 0; }
  .state { padding-bottom: 10px; }
  .task-line { display: none; }
  .readouts { display: flex; gap: 14px; border-bottom: 1px solid var(--line); align-items: baseline; }
  .ro { padding: 8px 0 10px; border-bottom: 0; flex: 1; min-width: 0; }
  .ro dt { white-space: nowrap; letter-spacing: 0.04em; font-size: 9px; }
  .ro dd { font-size: 23px; margin-top: 3px; }
  .ro--big { flex: 1.15; }
  .ro--big dd { font-size: 23px; }
  .ro--hide { display: none; }
  .rail-note { display: none; }
  .rail--right { grid-row: 3; display: block; }
  .journal-head, .journal { display: none; }
  .stage-actions { padding-top: 0; display: flex; gap: 8px; }
  .stage-actions .ghost { flex: 1; text-align: center; padding: 15px 10px; }
  .t-full { display: none; }
  .t-short { display: inline; }
  #journal-toggle { display: block; flex: 0 0 34%; }

  body[data-sheet="1"] .rail--right {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--ink2); border-top: 1px solid var(--line);
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    max-height: 72vh; display: flex; flex-direction: column;
    box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.6);
  }
  body[data-sheet="1"] .journal-head { display: flex; }
  body[data-sheet="1"] .journal { display: block; max-height: 48vh; flex: none; }

  body[data-phase="result"] .view--stage { grid-template-rows: minmax(250px, 46vh) auto; overflow-y: auto; }
  body[data-phase="result"] .rail--left { display: none; }
  .wall-label { position: static; opacity: 1; transform: none; pointer-events: auto; display: none; }
  body[data-phase="result"] .wall-label { display: flex; }
  body[data-phase="result"] .stage-actions { display: none; }
  .lab-actions { gap: 8px; padding-top: 18px; }
  .wall-label h2 { font-size: 34px; }
  .lab-actions .ghost { flex: 1 1 45%; text-align: center; }

  .arc-head { gap: 16px; }
  .arc-tools { width: 100%; }
  .room-body { grid-template-columns: 1fr; gap: 28px; overflow: visible; padding-top: 18px; }
  .room-main, .room-side { overflow: visible; }
  .wall { max-height: none; }
  .arc-body { overflow: visible; }
  .view--room, .view--archive { overflow-y: auto; }
  .week {
    display: flex; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line);
    margin: 0 -20px; padding-left: 20px; border-left: 0;
  }
  .day { flex: 0 0 86px; min-height: 230px; scroll-snap-align: start; padding: 18px 10px; }
  .day-stack { gap: 5px; }
  .day-stack::after { left: -10px; right: -10px; }

  .toast { bottom: auto; top: 62px; max-width: calc(100vw - 40px); text-align: center; }
  .toast.is-on { transform: translate(-50%, 0); }
}

@media (max-width: 680px) {
  .topbar { padding: 18px 16px; }
  .brand .txt { display: none; }
  .nav { gap: 14px; }
  .lnk { font-size: 10px; letter-spacing: 0.16em; }
  .sound .txt { display: none; }
  .view { padding: 74px 18px 24px; }
  h1 { font-size: clamp(44px, 14vw, 68px); }
  .intro-grid { gap: 34px; }
  .legend li { grid-template-columns: 22px 1fr; row-gap: 2px; }
  .legend i { grid-column: 2; }
  .starter { gap: 18px; }
  .arc-grid { grid-template-columns: 1fr; }
  .ritual-go { flex-wrap: wrap; }
  .ask-box { padding: 24px; }
  .arc-tools { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.12s !important; }
}
