:root {
  --snow: #E9EEF2;
  --snow-2: #DCE4EA;
  --basalt: #1C2230;
  --basalt-2: #4A5566;
  --red: #E84142;
  --red-deep: #B3122E;
  --glacier: #7FA8C9;
  --gold: #C9A227;
  --paper: #F7FAFC;
  --line: rgba(28, 34, 48, 0.14);
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --r-sm: 6px;
  --r-lg: 18px;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --snow: #1C2230; --snow-2: #252D3E; --basalt: #E9EEF2; --basalt-2: #A9B6C4;
    --paper: #222A3A; --line: rgba(233, 238, 242, 0.16); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --snow: #1C2230; --snow-2: #252D3E; --basalt: #E9EEF2; --basalt-2: #A9B6C4;
  --paper: #222A3A; --line: rgba(233, 238, 242, 0.16); color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--snow); color: var(--basalt);
  font-family: var(--body); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
img, canvas { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button {
  font: inherit; cursor: pointer; border: 0; border-radius: 999px;
  padding: 0.7em 1.3em; font-weight: 600; transition: transform 0.12s, background 0.2s;
}
button:active { transform: translateY(1px) scale(0.99); }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--basalt); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--basalt); }

/* ---------- bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 40px) 14px;
  display: flex; align-items: center; gap: 18px; pointer-events: none;
}
.bar > * { pointer-events: auto; }
.mark { font-family: var(--display); font-weight: 800; font-size: 26px; text-decoration: none; letter-spacing: 0.01em; }
.mark span, .home-copy h1 span { color: var(--red); }
.bar nav { display: flex; gap: 18px; margin-left: 12px; font-size: 15px; }
.bar nav a { text-decoration: none; opacity: 0.75; }
.bar nav a:hover { opacity: 1; }
.bar .spacer { flex: 1; }
.bar button { padding: 0.5em 1.1em; font-size: 15px; background: var(--paper); color: var(--basalt); box-shadow: inset 0 0 0 1.5px var(--line); }
#sound[aria-pressed="false"] { opacity: 0.55; }
.bar button { white-space: nowrap; }
.bar button[hidden] { display: none; }
@media (max-width: 640px) { .bar { gap: 8px; } .bar button { padding: 0.45em 0.8em; font-size: 14px; } }

/* ---------- reading ---------- */
.section { padding: clamp(56px, 8vw, 110px) clamp(18px, 5vw, 64px); max-width: 1320px; margin: 0 auto; }
.section h2 { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6vw, 76px); line-height: 0.95; margin: 0 0 14px; }
.section > p { max-width: 36em; color: var(--basalt-2); margin: 0 0 36px; }

.log { font-size: 15px; color: var(--basalt-2); margin: 0 0 30px; min-height: 1.5em; }
.log p { margin: 0 0 4px; }
.log p::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--red); margin-right: 10px; transform: translateY(-2px) rotate(45deg); }
.log p.done::before { background: var(--glacier); }

.result { display: grid; grid-template-columns: 220px minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: start; }

.read .season-name { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 7.5vw, 104px); line-height: 0.88; margin: 6px 0 12px; }
.read .first { font-size: 18px; margin: 0 0 26px; }
.read .first small { display: block; color: var(--basalt-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 0 0 22px; }
.stats div { background: var(--paper); padding: 14px 16px; }
.stats dt { font-size: 13px; color: var(--basalt-2); }
.stats dd { margin: 2px 0 0; font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; }
.stats div { min-width: 0; }
/* season names are words, not numbers: smaller and allowed to wrap so they never get clipped */
.stats dd.word { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.05; overflow-wrap: anywhere; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rank { background: var(--basalt); color: var(--snow); border-radius: var(--r-lg); padding: 18px 20px; }
.rank .tier { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.rank .pos { font-size: 15px; opacity: 0.8; }
.meter { height: 10px; border-radius: 99px; background: rgba(233, 238, 242, 0.15); margin: 14px 0 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); border-radius: 99px; transition: width 1.4s cubic-bezier(.2, .8, .2, 1); }
.parts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; opacity: 0.75; }
.note { font-size: 13px; color: var(--basalt-2); margin: 10px 0 0; }

.mint-box { background: var(--paper); border-radius: var(--r-lg); padding: 18px; box-shadow: 0 0 0 1.5px var(--line); }
#preview { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--snow-2); }
.price-line { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 12px; gap: 10px; }
.price-line b { font-family: var(--display); font-size: 48px; font-weight: 800; line-height: 1; }
.price-line s { color: var(--basalt-2); font-size: 15px; }
#mint-btn { width: 100%; font-size: 18px; padding: 0.85em; }
#mint-note { font-size: 14px; color: var(--basalt-2); margin: 10px 2px 0; }

/* ---------- leaderboard ---------- */
.board { list-style: none; margin: 0; padding: 0; counter-reset: b; max-width: 860px; }
.board li { counter-increment: b; display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.board li::before { content: counter(b); font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--basalt-2); }
.board li:nth-child(-n+3)::before { color: var(--red); }
.board li.me { background: var(--paper); border-radius: 10px; }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board .who small { display: block; font-weight: 400; color: var(--basalt-2); font-size: 13px; }
.board .chip { width: 14px; height: 14px; border-radius: 4px; background: var(--c); display: inline-block; margin-right: 6px; vertical-align: -1px; }
.board .sc { font-family: var(--display); font-size: 26px; font-weight: 700; }

footer { padding: 40px clamp(18px, 5vw, 64px) 60px; font-size: 14px; color: var(--basalt-2); max-width: 1320px; margin: 0 auto; }

/* ---------- reveal ---------- */
#reveal {
  position: fixed; inset: 0; z-index: 50; background: #1C2230; color: #E9EEF2;
  display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
}
#reveal[hidden] { display: none; }
.reveal-stage { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 320px); gap: 36px; align-items: center; width: min(960px, 100%); }
#reveal-canvas { aspect-ratio: 1; width: 100%; border-radius: 12px; overflow: hidden; background: #252D3E; box-shadow: 0 0 0 1px rgba(233, 238, 242, 0.18), 0 30px 80px -30px rgba(0, 0, 0, 0.6); }
#reveal-canvas.shake { animation: shake 0.28s infinite; }
#reveal-canvas.quake { animation: quake 0.6s 1; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-2px, 1px) rotate(-0.2deg); } 75% { transform: translate(2px, -1px) rotate(0.2deg); } }
@keyframes quake { 0% { transform: scale(1); } 15% { transform: translate(-10px, 6px) scale(1.02); } 30% { transform: translate(9px, -5px); } 45% { transform: translate(-6px, 3px); } 60% { transform: translate(4px, -2px); } 100% { transform: none; } }
.flash { position: fixed; inset: 0; background: #fff; z-index: 60; pointer-events: none; animation: flash 0.7s forwards; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }
.reveal-side h2 { font-family: var(--display); font-size: clamp(44px, 5vw, 64px); font-weight: 800; line-height: 0.95; margin: 0 0 10px; }
#reveal-status { font-size: 16px; opacity: 0.85; margin: 0 0 22px; min-height: 3em; }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.traits div { background: rgba(233, 238, 242, 0.07); border-radius: 10px; padding: 10px 12px; opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.traits div.in { opacity: 1; transform: none; }
.traits dt { font-size: 12px; opacity: 0.65; }
.traits dd { margin: 0; font-weight: 600; }
.reveal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reveal-actions .btn-ghost { color: #E9EEF2; box-shadow: inset 0 0 0 1.5px rgba(233, 238, 242, 0.3); }
.reveal-actions a { align-self: center; font-size: 15px; }

@media (max-width: 980px) {
  .result { grid-template-columns: minmax(0, 1fr); }
  .reveal-stage { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bar nav { display: none; }
  .hero-copy { padding-top: calc(96px + env(safe-area-inset-top, 0px)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board li { grid-template-columns: 40px 1fr auto; }
  .board li .tierc { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


.view[hidden] { display: none; }
.bar nav a[aria-current] { opacity: 1; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.btn-ghost.small { padding: 0.4em 0.9em; font-size: 14px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); max-width: 32em; margin: 18px 0 26px; color: var(--basalt-2); }
.scan { display: flex; gap: 8px; background: var(--paper); padding: 6px; border-radius: 999px; box-shadow: 0 0 0 1.5px var(--line); max-width: 520px; }
.scan input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--basalt); font: inherit; font-size: 16px; padding: 0 14px; }
.scan input:focus { outline: none; }
.scan:focus-within { box-shadow: 0 0 0 2px var(--red); }
.hint { font-size: 14px; color: var(--basalt-2); margin-top: 12px; min-height: 1.5em; }
.hint button { padding: 0; background: none; text-decoration: underline; font-weight: 500; color: inherit; border-radius: 0; }
.method-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; margin: 18px 0 0; }
.method-links a { text-decoration-color: var(--red); text-decoration-thickness: 1.5px; }
.method-links.small { font-size: 13.5px; margin-top: 12px; }
.method-links.light a { color: #E9EEF2; }

/* ---------- home ---------- */
.home-hero { position: relative; height: 100vh; min-height: 620px; overflow: hidden; }
#terra { position: absolute; inset: 0; }
.home-copy { position: relative; z-index: 2; max-width: 600px; padding: calc(120px + env(safe-area-inset-top, 0px)) clamp(18px, 5vw, 64px) 0; pointer-events: none; }
.home-copy > * { pointer-events: auto; }
.home-copy h1 { font-family: var(--display); font-weight: 800; margin: 0; font-size: clamp(96px, 17vw, 220px); line-height: 0.8; }
.live-card { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--paper); border-radius: 18px; padding: 14px 16px; box-shadow: 0 0 0 1.5px var(--line); max-width: 520px; line-height: 1.35; }
.live-card:hover { box-shadow: 0 0 0 2px var(--red); }
.live-card b { font-family: var(--display); font-size: 26px; font-weight: 800; }
.live-card .go { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 0.55em 1.1em; font-weight: 600; white-space: nowrap; font-size: 15px; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 0 rgba(232, 65, 66, 0.6); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(232, 65, 66, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 65, 66, 0); } }
.terra-hint { position: absolute; right: clamp(16px, 4vw, 40px); bottom: 20px; margin: 0; font-size: 13px; color: var(--basalt-2); }
.calendar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.drop-card, .drop-card > a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.drop-card { background: var(--paper); border-radius: 16px; padding: 12px; box-shadow: 0 0 0 1px var(--line); }
.drop-card.live { box-shadow: 0 0 0 2px var(--red); }
.drop-card .mini { aspect-ratio: 1; border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: var(--snow-2); }
.drop-card .mini.sealed { background: repeating-linear-gradient(135deg, var(--snow-2) 0 10px, transparent 10px 20px); display: grid; place-items: center; }
.drop-card .mini.sealed::after { content: '?'; font-family: var(--display); font-size: 88px; font-weight: 800; color: var(--basalt-2); opacity: 0.4; }
.drop-card .num { font-size: 13px; color: var(--basalt-2); }
.drop-card b { font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1; }
.drop-card .when, .drop-card .reads { font-size: 14px; color: var(--basalt-2); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.steps li { counter-increment: s; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(s); font-family: var(--display); font-size: 64px; font-weight: 800; line-height: 1; color: var(--red); }
.steps b { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }
.steps span { color: var(--basalt-2); }

/* ---------- drop ---------- */
.drop-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(24px, 4vw, 64px); align-items: center; padding-top: calc(110px + env(safe-area-inset-top, 0px)); }
.drop-meta { font-size: 15px; color: var(--basalt-2); margin: 0 0 6px; }
.drop-title { font-family: var(--display); font-weight: 800; font-size: clamp(80px, 12vw, 168px); line-height: 0.82; margin: 0; }
.sample { margin: 0; }
.sample-frame { aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(28, 34, 48, 0.35); }
.sample figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--basalt-2); margin-top: 10px; }
.peaks h3 { font-family: var(--display); font-size: 28px; margin: 0 0 10px; }
.peaks ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.peaks li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; font-size: 14.5px; }
.peaks li.more { display: block; color: var(--basalt-2); }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.peaks .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peaks .ct, .coll-grid .ct { font-weight: 600; font-variant-numeric: tabular-nums; }
.roast { font-size: 18px; max-width: 32em; margin: 0 0 22px; }
.price-why { font-size: 14px; color: var(--basalt-2); margin: -4px 2px 12px; }
.slider { background: var(--paper); border-radius: 18px; padding: 20px 22px; box-shadow: 0 0 0 1.5px var(--line); max-width: 760px; }
.slider label { font-size: 16px; }
.slider input { width: 100%; margin: 14px 0; accent-color: var(--red); height: 28px; }
.slider-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.slider-out b { font-family: var(--display); font-size: 56px; font-weight: 800; line-height: 1; }
.slider-out span { color: var(--basalt-2); }
.search { width: 100%; max-width: 520px; font: inherit; padding: 0.7em 1.1em; border-radius: 999px; border: 0; box-shadow: 0 0 0 1.5px var(--line); background: var(--paper); color: var(--basalt); margin-bottom: 18px; }
.search:focus { outline: none; box-shadow: 0 0 0 2px var(--red); }
.coll-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.coll-grid li { display: grid; grid-template-columns: 14px 30px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.coll-grid li.held { font-weight: 600; }
.coll-grid li.empty { display: block; color: var(--basalt-2); }
.coll-grid .rk { color: var(--basalt-2); font-size: 13px; }
.coll-grid .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- method ---------- */
.method { padding-top: calc(110px + env(safe-area-inset-top, 0px)); max-width: 980px; }
.method section { margin-top: 56px; }
.method h2 { font-family: var(--display); font-size: clamp(40px, 5vw, 60px); line-height: 0.95; margin: 0 0 14px; }
.method h3 { font-family: var(--display); font-size: 28px; margin: 28px 0 8px; }
.method p, .method li { max-width: 44em; }
.method li { margin-bottom: 8px; }
.method code { font-size: 0.88em; background: var(--paper); padding: 0.1em 0.35em; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); overflow-wrap: anywhere; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { text-decoration: none; background: var(--paper); border-radius: 999px; padding: 0.4em 1em; box-shadow: 0 0 0 1.5px var(--line); font-size: 15px; }
.toc a:hover { box-shadow: 0 0 0 2px var(--red); }
.table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.list-table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--paper); }
.list-table th, .list-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list-table th { position: sticky; top: 0; background: var(--paper); font-weight: 600; }
.list-table td.num { text-align: right; }
.list-table .sw { margin-right: 8px; vertical-align: -2px; }

@media (max-width: 980px) {
  .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop-hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .live-card { flex-wrap: wrap; }
  .live-card .go { margin-left: 0; }
  .terra-hint { display: none; }
}
.method section, #reading, #price, #list, #leaderboard, #drops { scroll-margin-top: 80px; }
.sample figcaption .btn-ghost { white-space: nowrap; flex: none; }

.pt { font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: var(--red); border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.slider label { display: block; margin-top: 6px; }
h3.sub { font-family: var(--display); font-size: 32px; margin: 40px 0 6px; }
.coll-grid.heavy { margin-top: 14px; }

.slider label.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 15px; }
.slider label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }

.rate { font-style: normal; font-size: 12px; color: var(--basalt-2); font-weight: 500; }
.rate.hi { color: #fff; background: var(--red); border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.btn-red.big { font-size: 18px; padding: 0.9em 1.6em; }
.allow { font-size: 14.5px; margin: -2px 2px 12px; font-weight: 600; }
#r-per { color: var(--basalt-2); font-size: 15px; }
.drop-card .mini.live-seal { background: repeating-linear-gradient(135deg, rgba(232, 65, 66, 0.12) 0 10px, transparent 10px 20px); }
.drop-card .mini.live-seal::after { content: 'Sealed until you mint'; font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--red); opacity: 1; }
.coll-grid li { grid-template-columns: 14px 1fr auto; }
.sample-note { font-size: 13.5px; color: var(--basalt-2); margin: 8px 0 0; }
.peaks .nm { white-space: normal; overflow: visible; line-height: 1.3; }
.peaks .nm .pt { white-space: nowrap; }

.window { display: flex; flex-direction: column; gap: 2px; margin: -8px 0 22px; padding: 12px 16px; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 1.5px var(--line); max-width: 520px; }
.window b { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.window span { font-size: 14px; color: var(--basalt-2); }
.window[data-phase="open"] { box-shadow: 0 0 0 2px var(--red); }
.window[data-phase="open"] b { color: var(--red); }
.window[data-phase="unknown"] { display: none; }
