/* Brace: the title screen's look (FrontKit, the title flow spec) on the web.
   Day tokens on every clip; walnut plates in a gold collar with beads and
   rivets; gold and walnut pills with the round keycap; the game's cursors. */
:root {
  --sea: #070d18;
  --sea-2: #0d1828;
  --navy: #13223a;
  --ink: #f1e6cf;
  --muted: #cdb48a;
  --dim: #8c7a5c;
  --gold: #f4d58a;
  --lamp: #f0b85a;
  --brass: #c9932f;
  --brass-deep: #7a5218;
  --glyph: #2a1a0a;
  --rule: rgba(217, 168, 68, 0.28);
  --red: #e0705a;
  --green: #9fd3a8;
  --sc: "Alegreya SC", Georgia, serif;
  --sans: "Alegreya Sans", system-ui, sans-serif;
  --italic: "Alegreya", Georgia, serif;
  --pointer: url("img/ui/pointer-48.png") 1 1, auto;
  --select: url("img/ui/select-48.png") 1 1, pointer;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--sea);
  color: var(--ink);
  font: 500 18px/1.55 var(--sans);
  cursor: var(--pointer);
  -webkit-font-smoothing: antialiased;
}
a, button, summary, label, [data-act] { cursor: var(--select); }
input, textarea { cursor: text; }
img, video { max-width: 100%; display: block; }
a { color: var(--gold); }
h2, h3 { font-family: var(--sc); font-weight: 700; letter-spacing: 0.02em; margin: 0; color: var(--gold); }
h2 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.06; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7); }
h3 { font-size: 24px; line-height: 1.2; }
p { margin: 0; }
.wrap { width: min(1140px, 100% - 32px); margin: 0 auto; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 8px; }

/* A domed bead (the prompt's and the caption's), lit or not. */
.bead {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #fff0be 0 18%, #e3b458 45%, #8e5e1a 100%);
}
.bead.off { background: radial-gradient(circle at 35% 35%, #8e6a30 0 30%, #4a2e0c 100%); }
.kicker { display: flex; align-items: center; gap: 12px; font: 800 13px/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--lamp); margin-bottom: 14px; }

/* The bar along the top: a navy band with a brass rule. */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 26px;
  height: 62px; padding: 0 24px;
  background: linear-gradient(rgba(10, 17, 30, 0.9), rgba(10, 17, 30, 0.7));
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(201, 147, 47, 0.45), 0 6px 20px rgba(0, 0, 0, 0.35);
}
.bar-brand img { width: 104px; height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.bar-nav { display: flex; gap: 24px; margin-right: auto; }
.bar-nav a { color: var(--ink); text-decoration: none; font: 700 16px/1 var(--sc); letter-spacing: 0.04em; opacity: 0.88; }
.bar-nav a:hover { opacity: 1; color: var(--gold); }
.bar-account { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.bar-account .who { color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons (SPEC §6.2): a gold pill or a walnut pill, the round keycap at left. */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 26px 0 8px; border-radius: 999px; border: 0;
  font: 800 18px/1 var(--sans); text-decoration: none;
  transition: filter 0.25s, transform 0.11s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px) scale(0.98); }
.btn:disabled { filter: saturate(0.25) brightness(0.65); }
.btn .key {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 37px; background: url("img/ui/keycap.png") center / contain no-repeat;
  color: var(--glyph); font: 800 17px/1 var(--sans);
}
.btn-gold {
  color: var(--glyph);
  background: radial-gradient(120% 160% at 30% 0%, #fbe3a0 0%, #e3b458 36%, #b9832b 76%, #7a5218 100%);
  box-shadow: 0 2px 0 #5a3a10, 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 244, 214, 0.65);
}
.btn-walnut {
  color: var(--ink);
  background: url("img/ui/walnut.webp") center / 240px, #2b170b;
  box-shadow: inset 0 0 0 2px var(--brass), inset 0 0 0 4px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.5);
}
.btn-small { min-height: 38px; padding: 0 18px; font-size: 15px; }
.btn-small .key { display: none; }
.btn-github { width: 100%; justify-content: center; padding: 0 22px; color: var(--ink); background: #161a21; box-shadow: inset 0 0 0 2px #3b4250, 0 6px 16px rgba(0, 0, 0, 0.4); }
.btn-github svg { width: 22px; height: 22px; fill: currentColor; }
.link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* The plate (FrontPlate): walnut in a gold collar, a row of beads inside it
   top and bottom, a brass rivet at each corner. */
.plate {
  position: relative; padding: 38px 36px; border-radius: 22px; border: 5px solid transparent;
  background:
    radial-gradient(130% 120% at 20% 0%, rgba(255, 210, 150, 0.1), rgba(0, 0, 0, 0.38) 75%) padding-box,
    url("img/ui/walnut.webp") center / 420px padding-box,
    linear-gradient(140deg, #fbe3a0, #c9932f 30%, #7a5218 55%, #e3b458 80%, #8e5e1a) border-box;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45), inset 0 0 26px rgba(0, 0, 0, 0.55), 0 26px 60px rgba(0, 0, 0, 0.6);
  display: grid; gap: 16px; align-content: start;
}
.plate::before {
  content: ""; position: absolute; inset: 9px 24px; pointer-events: none;
  background:
    radial-gradient(circle at 40% 40%, #fff0be 0 1.2px, #e3b458 2.2px, #8e5e1a 3.6px, transparent 4.2px) 0 0 / 15px 10px repeat-x,
    radial-gradient(circle at 40% 40%, #fff0be 0 1.2px, #e3b458 2.2px, #8e5e1a 3.6px, transparent 4.2px) 0 100% / 15px 10px repeat-x;
  opacity: 0.9;
}
.plate::after {
  content: ""; position: absolute; inset: -11px; pointer-events: none;
  --rivet: radial-gradient(circle at 38% 36%, #fff6d6 0 2px, #f2cf6b 5px, #b9832b 8.5px, #5a3a10 10.5px, transparent 11px);
  background: var(--rivet) 0 0 / 22px 22px no-repeat, var(--rivet) 100% 0 / 22px 22px no-repeat,
    var(--rivet) 0 100% / 22px 22px no-repeat, var(--rivet) 100% 100% / 22px 22px no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}
.plate.small { padding: 30px 26px; }
.plate.small::before { inset: 8px 20px; }
.plate h3 { color: var(--gold); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.plate .sub, .plate.small p { color: var(--muted); font-size: 16.5px; }

/* The hero: the title reel behind the wordmark. */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; text-align: center; background: #04070b; }
.reel, .reel-clip { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel-clip { object-fit: cover; object-position: 50% 40%; opacity: 0; transition: opacity 1.6s ease-in-out; }
.reel-clip.on { opacity: 1; }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 42%, rgba(19, 34, 58, 0.45), rgba(4, 7, 11, 0.1) 60%, rgba(4, 7, 11, 0.6)), linear-gradient(transparent 62%, var(--sea)); }
.hero-body { position: relative; padding: 120px 16px 110px; display: grid; justify-items: center; gap: 24px; }
.hero-mark { width: min(640px, 86vw); height: auto; filter: drop-shadow(0 0 40px rgba(19, 34, 58, 0.9)) drop-shadow(0 10px 26px rgba(0, 0, 0, 0.7)); }
.hero-line { font-size: clamp(18px, 2.2vw, 23px); max-width: 660px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 6px; }
.prompt { display: flex; align-items: center; gap: 12px; font: 800 14px/1 var(--sans); letter-spacing: 0.12em; color: var(--ink); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); }
.prompt .rule { width: 70px; height: 2px; background: linear-gradient(90deg, transparent, #e3b458); }
.prompt .rule:last-child { background: linear-gradient(270deg, transparent, #e3b458); }
.reel-caption { position: absolute; right: max(24px, 4vw); bottom: 28px; display: grid; justify-items: end; gap: 8px; font: 700 clamp(15px, 1.7vw, 21px)/1 var(--sc); letter-spacing: 0.04em; color: var(--ink); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); transition: opacity 0.45s; }
.reel-caption.out { opacity: 0; }
.reel-caption .beads { display: flex; gap: 6px; }
.reel-caption .bead { width: 9px; height: 9px; }
.reel-caption .bead:not(.off) { box-shadow: 0 0 8px rgba(240, 184, 90, 0.8); }

/* About the game: each feature its own clip, framed in brass. */
.game { padding: 110px 0 90px; background: radial-gradient(80% 50% at 50% 0%, var(--navy), var(--sea) 70%); }
.intro { text-align: center; display: grid; justify-items: center; }
.lede { font-size: 21px; color: var(--muted); max-width: 760px; margin-top: 20px; }
.feature-list { display: grid; gap: 72px; margin-top: 76px; }
.feature { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.feature.flip .frame { order: 2; }
.frame {
  border-radius: 16px; padding: 6px; overflow: hidden;
  background: linear-gradient(140deg, #fbe3a0, #c9932f 30%, #7a5218 55%, #e3b458 80%, #8e5e1a);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.frame video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; background: #04070b; }
.feature-text { display: grid; gap: 14px; }
.feature-text h3 { font-size: 30px; }
.feature-text p { color: var(--muted); font-size: 19px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin-top: 96px; }
.facts h3 { font-size: 21px; }

/* Download and feedback: plates over the fog bank at dawn. */
.play { position: relative; padding: 96px 0 120px; overflow: hidden; }
.play-sea { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play-shade { position: absolute; inset: 0; background: linear-gradient(var(--sea), rgba(7, 13, 24, 0.45) 22%, rgba(7, 13, 24, 0.55) 70%, var(--sea)); }
.play-body { position: relative; text-align: center; display: grid; justify-items: center; }
.crew { margin-top: 40px; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; text-align: left; }
.crew.single { grid-template-columns: minmax(0, 480px); justify-content: center; }
.plate label { display: grid; gap: 7px; font: 800 14px/1 var(--sans); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.plate input, .plate textarea {
  width: 100%; border-radius: 12px; border: 2px solid #7a5218; color: #2b170b; text-transform: none; letter-spacing: 0;
  background: linear-gradient(#e2d3b2, #f6eedb 30%); box-shadow: inset 0 2px 4px rgba(60, 40, 10, 0.4);
  font: 500 17px/1.4 var(--sans); padding: 12px 14px;
}
.plate textarea { min-height: 150px; resize: vertical; }
.plate input:focus, .plate textarea:focus { outline: 2px solid var(--lamp); outline-offset: 1px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.say { min-height: 1.4em; font-size: 15px; color: var(--muted); }
.say.ok { color: var(--green); }
.say.error { color: var(--red); }
.fine { font-size: 14.5px; color: var(--dim); }
.fine b { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.spread { justify-content: space-between; }
.notice { font: italic 500 17px/1.45 var(--italic); color: var(--gold); }

.release-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 15px; }
.release-meta strong { color: var(--gold); font-weight: 800; }
.notes { border-top: 1px solid var(--rule); padding-top: 14px; display: grid; gap: 6px; font-size: 16px; color: var(--ink); }
.notes h4 { margin: 8px 0 0; font: 800 14px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--lamp); }
.notes ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); font-size: 16px; }
.steps b { color: var(--ink); }
details.more summary { color: var(--gold); font-weight: 800; font-size: 15px; }
details.more[open] summary { margin-bottom: 10px; }

.posts { display: grid; gap: 12px; border-top: 1px solid var(--rule); padding-top: 16px; }
.posts h4 { margin: 0; font: 800 13px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--lamp); }
.post { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(201, 147, 47, 0.25); display: grid; gap: 4px; }
.post p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.post time { font-size: 13px; color: var(--dim); }

/* The sign-in pop-up: a plate over the page dimmed. */
dialog.sheet { padding: 14px; border: 0; background: transparent; width: min(500px, 100% - 16px); max-width: none; overflow: visible; color: var(--ink); }
dialog.sheet::backdrop { background: rgba(4, 7, 11, 0.72); backdrop-filter: blur(4px); }
dialog.sheet[open] { animation: sheet-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.sheet-close {
  position: absolute; top: 14px; right: 16px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.35); color: var(--gold); font: 700 22px/1 var(--sans); box-shadow: inset 0 0 0 1.5px var(--brass);
}
.sheet-close:hover { background: rgba(0, 0, 0, 0.55); }
.invite-only { text-align: left; }

/* /welcome: an invite or reset link lands on a page of its own. */
.welcome-page { min-height: 100svh; }
.welcome-sea { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.welcome-shade { position: fixed; inset: 0; background: radial-gradient(60% 60% at 50% 40%, rgba(19, 34, 58, 0.35), rgba(4, 7, 11, 0.78)); }
.welcome { position: relative; min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 26px; padding: 40px 16px; }
.welcome-mark { width: min(340px, 70vw); height: auto; filter: drop-shadow(0 0 30px rgba(19, 34, 58, 0.9)) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.7)); }
#welcome { width: min(500px, calc(100vw - 32px)); }

.foot { border-top: 1px solid var(--rule); padding: 28px 0; color: var(--dim); font-size: 15px; background: var(--sea); }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 22px; }
  .feature.flip .frame { order: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .crew { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .bar { padding: 0 16px; gap: 14px; }
  .bar-nav { display: none; }
  .bar-brand { margin-right: auto; }
  .bar-account .who { display: none; }
  .facts { grid-template-columns: 1fr; }
  .plate { padding: 30px 22px; }
  .prompt .rule { width: 28px; }
  .prompt { font-size: 12px; letter-spacing: 0.08em; }
  .reel-caption { right: 16px; bottom: 18px; }
  .game { padding-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reel-clip { transition: none; }
}
