:root {
  --bg: #050707;
  --ink: #e7e5da;
  --muted: #959b93;
  --dim: #5d645e;
  --line: rgba(231, 229, 218, .14);
  --sky: #dfe6dd;
  --lamp: #f1d295;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(18px, 3.2vw, 44px);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.mono { font-family: var(--mono); font-weight: 300; font-size: 12px; letter-spacing: .08em; text-transform: lowercase; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--lamp); outline-offset: 4px; border-radius: 2px; }

#well { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; touch-action: pan-y; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(var(--pad) * .7) var(--pad);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark { font-style: italic; font-size: 34px; line-height: 1; text-decoration: none; letter-spacing: -.01em; }
.top nav { display: flex; gap: 22px; font-family: var(--mono); font-weight: 300; font-size: 12px; letter-spacing: .08em; }
.top nav a { text-decoration: none; color: var(--muted); transition: color .3s; }
.top nav a:hover { color: var(--ink); }
.mini {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 7, 7, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .4s;
  margin-right: auto; margin-left: 18px; max-width: 46vw;
}
.mini.on { opacity: 1; transform: none; }
.mini-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-time { color: var(--muted); }
.mini-glyph, .glyph { width: 10px; height: 12px; flex: none; position: relative; }
.mini-glyph::before, .glyph::before { /* play triangle */
  content: ""; position: absolute; inset: 0;
  background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.is-playing .mini-glyph::before, .is-playing .glyph::before { clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }

/* ---------- the mouth (first screen) ---------- */
main { position: relative; z-index: 2; pointer-events: none; }
main > .strata, main > .about, main > .foot { pointer-events: auto; }
.mouth { position: relative; height: 100vh; height: 100svh; min-height: 560px; pointer-events: none; }
.mouth > * { pointer-events: auto; }
.hint {
  position: absolute; right: var(--pad); bottom: var(--pad); margin: 0; max-width: 260px;
  text-align: right; color: var(--muted); transition: opacity .8s;
}
.descend {
  position: absolute; left: 50%; bottom: calc(var(--pad) * .8); transform: translateX(-50%);
  color: var(--dim); text-decoration: none; padding: 8px 4px; transition: color .3s, opacity .6s;
}
.descend::after { content: ""; display: block; width: 1px; height: 26px; margin: 8px auto 0; background: currentColor; animation: plumb 3.4s ease-in-out infinite; transform-origin: top; }
.descend:hover { color: var(--ink); }
@keyframes plumb { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.now {
  position: absolute; left: var(--pad); bottom: var(--pad);
  width: min(360px, calc(100vw - 2 * var(--pad)));
  opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s ease;
}
.now.on { opacity: 1; transform: none; }
.now-meta { margin: 0 0 6px; color: var(--muted); }
.now-meta .dot, .now-time .slash { margin: 0 .6em; color: var(--dim); }
.now-title { margin: 0; font-weight: 400; font-size: clamp(38px, 4.4vw, 58px); line-height: .98; letter-spacing: -.015em; text-wrap: balance; }
.now-note { margin: 10px 0 0; color: var(--muted); font-size: 18px; line-height: 1.35; max-width: 32ch; }
.now-note:empty { display: none; }
.now-time { margin: 14px 0 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.now-time .state { margin-left: 1em; color: var(--lamp); }
.controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.controls-quiet { gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.ctl { min-height: 44px; border-radius: 999px; transition: background .3s, border-color .3s, color .3s; }
.ctl-small { min-width: 52px; border: 1px solid var(--line); color: var(--muted); }
.ctl-small:hover { color: var(--ink); border-color: rgba(231, 229, 218, .35); }
.play {
  display: inline-flex; align-items: center; gap: 12px; padding: 0 22px 0 20px;
  background: var(--ink); color: var(--bg); font-size: 20px;
}
.play:hover { background: var(--lamp); }
.ctl-text { min-height: 32px; color: var(--muted); transition: color .3s; }
.ctl-text:hover, .ctl-text.on { color: var(--lamp); }
.vol { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.vol input { width: 74px; accent-color: var(--ink); }
@media (pointer: coarse) { .vol { display: none; } }

/* close your eyes */
.eyes-note { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); margin: 0; color: var(--dim); opacity: 0; pointer-events: none; transition: opacity 1.5s; z-index: 6; }
body.eyes-closed .top, body.eyes-closed .now, body.eyes-closed .hint, body.eyes-closed .descend { opacity: 0 !important; pointer-events: none; transition: opacity 2.4s; }
body.eyes-closed { cursor: none; overflow: hidden; }
body.eyes-closed .eyes-note { opacity: 1; }
body.eyes-closed .eyes-note.gone { opacity: 0; }

/* ---------- strata ---------- */
.strata, .about { position: relative; padding: 18vh var(--pad) 10vh; }
.strata { min-height: 80vh; }
.strata-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: end; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-weight: 400; font-style: italic; font-size: clamp(56px, 9vw, 132px); line-height: .9; letter-spacing: -.02em; }
.strata-head p { margin: 0; max-width: 34ch; color: var(--muted); justify-self: end; text-align: right; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.layer {
  width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px 24px; align-items: baseline;
  padding: 30px 0 28px; text-align: left; transition: padding .5s ease;
}
.layer:hover { padding-left: 12px; }
.layer-depth { color: var(--dim); }
.layer-title { font-size: clamp(30px, 3.6vw, 48px); line-height: 1; letter-spacing: -.01em; }
.layer-title em { font-style: italic; }
.layer-meta { color: var(--muted); text-align: right; white-space: nowrap; }
.layer-note { grid-column: 2 / 3; color: var(--muted); font-size: 18px; max-width: 60ch; margin: 4px 0 0; }
.layer-bar { grid-column: 2 / 4; height: 1px; background: var(--line); position: relative; margin-top: 10px; }
.layer-bar i { position: absolute; inset: 0 auto 0 0; background: var(--lamp); width: 0; }
.layer.current .layer-depth, .layer.current .layer-meta .playing { color: var(--lamp); }
.list .empty { padding: 34px 0; color: var(--muted); }

/* ---------- about ---------- */
.about { padding-bottom: 14vh; }
.about-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.about-lede { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -.01em; text-wrap: pretty; }
.how { margin: 0; display: grid; gap: 22px; }
.how div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: baseline; }
.how dt { color: var(--lamp); }
.how dd { margin: 0; color: var(--muted); font-size: 19px; }
.foot { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 22px var(--pad) calc(22px + env(safe-area-inset-bottom)); color: var(--dim); border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  body { font-size: 18px; }
  .top nav { gap: 16px; }
  .mini { position: fixed; left: 50%; transform: translate(-50%, -6px); top: calc(var(--pad) * .55); margin: 0; max-width: 52vw; }
  .mini.on { transform: translate(-50%, 0); }
  .mini-time { display: none; }
  .hint { left: var(--pad); right: auto; bottom: auto; top: 64vh; text-align: left; max-width: none; }
  .now { bottom: calc(var(--pad) + 6px); }
  .now-title { font-size: 40px; }
  .now-note { display: none; }
  .descend { display: none; }
  .strata-head, .about-cols { grid-template-columns: 1fr; }
  .strata-head p { justify-self: start; text-align: left; }
  .layer { grid-template-columns: 44px minmax(0, 1fr); }
  .layer-meta { grid-column: 2; text-align: left; }
  .layer-note, .layer-bar { grid-column: 2; }
  .how div { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .descend::after { animation: none; }
}
