:root {
  --bg: #16130F;
  --paper: #FBFAF6;
  --label-ink: #23201C;
  --muted: #6E675E;
  --soft: #B9B0A2;
  --gold: #C9A24A;
  --gold-hi: #E8C873;
  --bar: 56px;
  --tabs: 60px;
  --stage: calc(100dvh - var(--bar) - var(--tabs));
  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --wall: #2B211C;
  --ink: #F3E9DA;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: #EFE8DC; font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
main:focus { outline: none; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.kicker { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 .5em; }
.kicker a { text-decoration: none; }
.lede { color: var(--soft); max-width: 36em; }
.fine { font-size: .85rem; color: var(--soft); }
.lock { width: .9em; height: .9em; vertical-align: -.1em; margin-left: .35em; }

/* bars */
.bar { position: fixed; inset: 0 0 auto; height: var(--bar); z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(22, 19, 15, .94); backdrop-filter: blur(8px); border-bottom: 1px solid #2C2721; }
.brand { font: italic 600 1.35rem var(--display); text-decoration: none; color: var(--gold-hi); }
.sos { font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid var(--gold); color: var(--gold-hi); border-radius: 999px; padding: 6px 12px; }
.tabs { position: fixed; inset: auto 0 0; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); z-index: 50; display: flex; background: rgba(22, 19, 15, .96); border-top: 1px solid #2C2721; }
.tabs a { flex: 1; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 500; text-decoration: none; color: var(--soft); border-top: 2px solid transparent; }
.tabs a[aria-current] { color: var(--gold-hi); border-color: var(--gold); }
main { padding: var(--bar) 0 calc(var(--tabs) + env(safe-area-inset-bottom)); min-height: 100dvh; }
body[data-view="intro"] .bar, body[data-view="intro"] .tabs { display: none; }
body[data-view="intro"] main { padding: 0; }

.btn { display: inline-block; background: var(--paper); color: var(--label-ink); border: 1px solid var(--paper); border-radius: 999px; padding: 12px 24px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1A140A; }

/* intro: the gold bowl */
.intro { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 16px; text-align: center; background: radial-gradient(ellipse at 50% 40%, #2A231B, var(--bg) 70%); }
.bowl { width: min(300px, 78vw); height: auto; overflow: visible; }
.bowl-body { fill: #3A332B; stroke: #4C443A; stroke-width: 1.5; }
.bowl-rim { fill: #231E18; stroke: #4C443A; stroke-width: 1.5; }
.crack { fill: none; stroke: var(--gold-hi); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 3px rgba(232, 200, 115, .6)); animation: gild 2.6s ease-in-out .4s forwards; }
.crack:nth-of-type(2) { animation-delay: 1.4s; animation-duration: 1.2s; }
.crack:nth-of-type(3) { animation-delay: .9s; }
.crack:nth-of-type(4) { animation-delay: 2.1s; animation-duration: 1s; }
@keyframes gild { to { stroke-dashoffset: 0; } }
.intro-line { font: italic 1.3rem/1.5 var(--display); max-width: 22em; margin: 0; opacity: 0; animation: fade 1.6s ease 1.2s forwards; }
.intro-go { opacity: 0; transition: opacity 1s; pointer-events: none; }
.intro-go.show { opacity: 1; pointer-events: auto; }
@keyframes fade { to { opacity: 1; } }

/* home */
.home, .page { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.home-head { margin-bottom: 22px; }
.sec { margin: 34px 0 14px; }
.today-card { display: flex; flex-direction: column; gap: 0; text-decoration: none; background: var(--wall); color: var(--ink); padding: 24px 16px 18px; border-radius: 4px; }
.tc-frame { align-self: center; background: #F4EDDF; padding: 7px; box-shadow: 0 16px 36px rgba(0, 0, 0, .4); }
.tc-frame img { max-height: 46vh; max-width: 100%; width: auto; height: auto; }
.tc-label { margin-top: 18px; background: var(--paper); color: var(--label-ink); padding: 12px 14px; display: flex; flex-direction: column; font-size: .92rem; line-height: 1.4; }
.tc-label b { font: 600 1.2rem var(--display); }
.tc-hook { font-style: italic; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--wall); color: var(--ink); text-decoration: none; padding: 10px 16px; border-radius: 999px; font-weight: 500; }
.chip.locked { opacity: .62; }
.jlist { display: grid; gap: 10px; }
.jcard, .plain-card, .roomcard { display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: var(--wall, #2A241D); color: var(--ink, #EFE8DC); padding: 14px 16px; border-radius: 4px; }
.plain-card { background: #241F19; }
.jcard b, .plain-card b, .roomcard b { font: 500 1.2rem var(--display); }
.jcard span, .plain-card span, .roomcard span { font-size: .9rem; opacity: .85; }
.jtag { margin-top: 4px; font-weight: 600; color: var(--gold-hi); opacity: 1 !important; }
.foot { margin-top: 44px; border-top: 1px solid #2C2721; padding-top: 18px; font-size: .92rem; color: var(--soft); }
.foot p { margin: 0 0 .5em; }

/* dive (camera engine from Learn to Look) */
body[data-view="dive"] { background: var(--wall); }
.dive { position: relative; background: var(--wall); color: var(--ink); }
.stage { position: sticky; top: var(--bar); height: var(--stage); overflow: hidden; }
.frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 1; transition: transform 1.6s cubic-bezier(.6, .05, .2, 1), opacity .3s ease; box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.frame.swap { opacity: 0; }
.frame img { width: 100%; height: 100%; }
.steps { position: relative; margin-top: calc(-1 * var(--stage)); z-index: 2; pointer-events: none; }
.step { min-height: var(--stage); display: flex; align-items: flex-end; padding: 0 16px 20px; }
.label { pointer-events: auto; width: 100%; max-width: 380px; max-height: 40dvh; overflow: auto; background: var(--paper); color: var(--label-ink); padding: 16px 18px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); font-size: 1rem; }
.label h1 { font-size: 1.7rem; }
.label p { margin: 0 0 .6em; }
.label p:last-child { margin-bottom: 0; }
.label .kicker { color: #8A6A22; }
.meta { font-size: .88rem; color: var(--muted); }
.hook { font: italic 1.1rem/1.4 var(--display); }
.hint { font-size: .88rem; color: var(--muted); }
.rail { position: fixed; right: 6px; top: calc(var(--bar) + 26dvh); list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; z-index: 3; }
.rail li { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink); opacity: .7; }
.rail li.on { background: var(--ink); opacity: 1; }
body:not([data-view="dive"]) .rail { display: none; }
@media (min-width: 860px) {
  .step { align-items: center; padding: 0 24px 0 32px; }
  .label { width: 370px; max-height: none; padding: 22px 24px; }
  .rail { right: 18px; top: 50%; transform: translateY(-50%); }
}

/* after the walk */
.after { background: var(--wall); color: var(--ink); padding: 8px 16px 40px; }
.after-inner { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.story, .journal { background: var(--paper); color: var(--label-ink); padding: 20px 18px; }
.player { display: flex; align-items: center; gap: 14px; background: #EFE9DD; padding: 12px; border-radius: 6px; }
.play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--label-ink); color: var(--gold-hi); display: grid; place-items: center; cursor: pointer; }
.play svg { width: 24px; height: 24px; }
.play:disabled { opacity: .4; cursor: default; }
.pl-body { flex: 1; display: flex; flex-direction: column; font-size: .9rem; min-width: 0; }
.pl-body b { font-family: var(--display); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-time { color: var(--muted); }
.pl-bar { height: 4px; background: #D8D0C1; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.pl-bar span { display: block; height: 100%; width: 0; background: var(--gold); }
.pl-note { font-size: .9rem; color: var(--muted); }
.script { margin-top: 12px; }
.script summary { cursor: pointer; font-weight: 600; }
.script p { font-family: var(--display); font-size: 1.08rem; line-height: 1.6; }
.journal label { display: block; font: italic 1.2rem/1.4 var(--display); margin-bottom: 10px; }
textarea { width: 100%; font: 1rem/1.5 var(--sans); padding: 12px; border: 1px solid #CFC6B6; border-radius: 4px; background: #fff; color: var(--label-ink); resize: vertical; }
.saved { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; }
.pager a { font-weight: 600; }

/* journal list */
.entry { border-top: 1px solid #2C2721; padding: 16px 0; }
.entry .q { font: italic 1.05rem var(--display); color: var(--soft); margin: 0 0 .4em; }

/* rooms */
.roomgrid { display: grid; gap: 10px; }
.roomcard.locked { opacity: .66; }
.room { background: var(--wall); color: var(--ink); min-height: calc(100dvh - var(--bar) - var(--tabs)); padding: 28px 16px 40px; }
.room > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.room .lede { color: inherit; opacity: .85; }
.room .kicker { color: inherit; opacity: .8; }
.wall { display: grid; gap: 34px; margin-top: 24px; }
.hung { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.hung-frame { align-self: flex-start; background: #F4EDDF; padding: 7px; box-shadow: 0 16px 36px rgba(0, 0, 0, .35); max-width: 100%; }
.hung-frame img { max-height: 52vh; max-width: 100%; width: auto; height: auto; }
.hung-label { align-self: flex-start; background: var(--paper); color: var(--label-ink); padding: 9px 12px; font-size: .88rem; line-height: 1.4; display: flex; flex-direction: column; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.hung-label b { font: 600 1.05rem var(--display); }
.note { margin: 0; font-size: .98rem; opacity: .9; }
.quote { margin: 0; }
.quote blockquote { margin: 0 0 8px; font: italic 1.35rem/1.45 var(--display); border-left: 3px solid var(--gold); padding-left: 14px; }
.quote.big blockquote { font-size: 1.55rem; }
.quote figcaption { font-size: .88rem; opacity: .8; margin-bottom: 6px; }
.through { margin-top: 38px; border: 1px solid var(--gold); padding: 16px 18px; border-radius: 4px; }
.through p:last-child { margin: 0; font: 1.12rem/1.5 var(--display); }
.room-care { font-size: .9rem; opacity: .8; margin-top: 22px; }
.room .journal { margin-top: 26px; }
.room .pager { margin-top: 18px; }
.days { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 22px; }
.days li a, .days li span { display: block; text-align: center; padding: 10px 4px; border: 1px solid currentColor; border-radius: 4px; text-decoration: none; }
.days li { display: flex; align-items: center; }
.days li > * { flex: 1; }
.days li.locked { opacity: .5; position: relative; }
.days li.locked .lock { position: absolute; top: 4px; right: 4px; width: .7em; }
.plus { margin-top: 24px; background: rgba(0, 0, 0, .18); padding: 18px; border-radius: 4px; }

/* guide */
.guide { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 20px; }
.guide li { display: flex; gap: 14px; }
.gnum { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-hi); display: grid; place-items: center; font: 600 1rem var(--display); }
.guide h2 { font-size: 1.25rem; margin-bottom: .2em; }
.guide p { margin: 0; color: var(--soft); }

/* help */
.help .call { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--paper); color: var(--label-ink); text-decoration: none; padding: 16px 18px; border-radius: 6px; margin: 12px 0; border-left: 5px solid var(--gold); }
.help .call span { font-size: .92rem; }
.help .call b { font: 600 1.8rem var(--display); }

/* legal */
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.3rem; margin-top: 1.4em; }
.legal p, .legal li { color: #DDD5C8; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame { transition: none; }
  .crack { animation: none; stroke-dashoffset: 0; }
  .intro-line { animation: none; opacity: 1; }
}
