/* TreasureBX — live loot box reveals for streamers
   Direction: broadcast gallery + prize vault. Teal-black vault interior,
   brass for prize metal, broadcast red used only for genuine live state,
   ticket stock for anything a viewer would "hold". */

:root {
  --vault:      #0C1A1D;
  --vault-2:    #12262A;
  --vault-3:    #1B383D;
  --brass:      #C8963E;
  --brass-lo:   #8A6528;
  --brass-hi:   #EFD08F;
  --live:       #FF3B30;
  --stock:      #F1EDE1;
  --stock-dim:  #A9AFA8;

  --edge: 1px solid color-mix(in srgb, var(--brass) 22%, transparent);

  --display: 'Archivo', system-ui, sans-serif;
  --data:    'Space Mono', ui-monospace, monospace;

  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --stack: clamp(4rem, 9vw, 7.5rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--vault);
  color: var(--stock);
  font-family: var(--display);
  font-variation-settings: 'wdth' 100, 'wght' 400;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient vault light. Static — the page's motion budget belongs to the reveal. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 72% -10%, color-mix(in srgb, var(--brass) 13%, transparent), transparent 70%),
    radial-gradient(700px 420px at 8% 8%, color-mix(in srgb, var(--vault-3) 55%, transparent), transparent 72%);
  z-index: 0;
}

.wrap { width: min(1180px, 100% - (var(--gut) * 2)); margin-inline: auto; position: relative; z-index: 1; }

/* Grid/flex children default to min-width:auto and refuse to shrink below their
   content, which blows the layout out horizontally on narrow screens. */
.hero > *, .steps > *, .split > *, .status > *, .masthead > * { min-width: 0; }
.t-hero, .t-sec, .step__t, .prize__name, .card h3 { overflow-wrap: break-word; }
.stamp b { overflow-wrap: anywhere; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 2px; }

/* ---------- type ---------- */

h1, h2, h3 { margin: 0; font-variation-settings: 'wdth' 118, 'wght' 800; line-height: 0.98; letter-spacing: -0.02em; }

.t-hero { font-size: clamp(2.6rem, 7.4vw, 5.6rem); text-transform: uppercase; }
.t-sec  { font-size: clamp(1.9rem, 4vw, 3rem); text-transform: uppercase; }
.t-sub  { font-size: clamp(1.05rem, 2vw, 1.35rem); font-variation-settings: 'wdth' 100, 'wght' 600; line-height: 1.35; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--data);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.1rem;
}

.lede { font-size: clamp(1.05rem, 1.9vw, 1.25rem); line-height: 1.55; color: color-mix(in srgb, var(--stock) 82%, transparent); max-width: min(54ch, 100%); }
.body-dim { color: color-mix(in srgb, var(--stock) 70%, transparent); }

/* ---------- masthead ---------- */

.masthead {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
  padding: 1.4rem 0;
  border-bottom: var(--edge);
}
.brand { display: flex; align-items: baseline; gap: 0.55rem; text-decoration: none; }
.brand__mark { font-variation-settings: 'wdth' 125, 'wght' 900; font-size: 1.32rem; letter-spacing: -0.03em; text-transform: uppercase; }
.brand__bx { color: var(--brass); }
.brand__tag { font-family: var(--data); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stock-dim); }

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.9rem); }
.nav a { font-family: var(--data); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: color-mix(in srgb, var(--stock) 72%, transparent); transition: color 0.18s; }
.nav a:hover { color: var(--brass-hi); }
.nav a.is-archive { color: var(--brass); border: var(--edge); padding: 0.42rem 0.7rem; border-radius: 2px; }
.nav a.is-archive:hover { background: color-mix(in srgb, var(--brass) 12%, transparent); }
@media (max-width: 720px) { .nav .nav__hide { display: none; } }

/* ---------- hero ---------- */

.hero { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 5vw, 4rem); padding: clamp(3rem, 7vw, 5.5rem) 0 var(--stack); align-items: center; }
@media (min-width: 940px) { .hero { grid-template-columns: 1.02fr 1fr; } }

.hero__claim { max-width: min(20ch, 100%); }
.hero__claim em { font-style: normal; color: var(--brass); }
.hero .lede { margin: 1.5rem 0 2rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  font-family: var(--data); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none; padding: 0.85rem 1.4rem; border-radius: 2px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn--solid { background: var(--brass); color: var(--vault); font-weight: 700; }
.btn--solid:hover { background: var(--brass-hi); }
.btn--ghost { border-color: color-mix(in srgb, var(--brass) 35%, transparent); color: var(--stock); }
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-hi); }

/* ---------- signature: the reveal panel ---------- */

.reveal {
  position: relative;
  background: linear-gradient(180deg, var(--vault-2), var(--vault));
  border: var(--edge);
  border-radius: 3px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.85);
}
/* camera framing marks — this is a broadcast feed, not a card */
.reveal::before, .reveal::after {
  content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--brass); opacity: 0.5;
}
.reveal::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.reveal::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.reveal__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: var(--edge); font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.live { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--live); font-weight: 700; }
.live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.9s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.reveal__watch { color: var(--stock-dim); }
.reveal__watch b { color: var(--stock); font-weight: 700; font-variant-numeric: tabular-nums; }

.reveal__stage { position: relative; height: clamp(220px, 32vw, 268px); display: grid; place-items: center; overflow: hidden; }

/* light thrown by an opened box — only present once it's open */
.reveal__stage::after {
  content: ''; position: absolute; left: 50%; bottom: 12%; width: 300px; height: 190px;
  transform: translateX(-50%); pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brass) 26%, transparent), transparent 78%);
  transition: opacity 0.5s 0.3s;
}
.is-open .reveal__stage::after, .reveal__stage.is-open::after { opacity: 1; }

.box { width: clamp(88px, 15vw, 112px); aspect-ratio: 1; position: relative; transition: transform 0.5s cubic-bezier(.25,.8,.4,1); z-index: 1; }
.box__lid, .box__base {
  position: absolute; left: 0; right: 0;
  background: linear-gradient(160deg, var(--brass-hi), var(--brass) 45%, var(--brass-lo));
  border-radius: 3px;
}
.box__lid  { top: 0; height: 30%; transform-origin: 50% 100%; }
.box__base { bottom: 0; height: 66%; box-shadow: inset 0 -10px 22px -12px rgba(0,0,0,0.6); }
/* interior — reads as an open container once the lid is gone, not a brass slab */
.box__base::before {
  content: ''; position: absolute; left: 7%; right: 7%; top: 0; height: 34%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--vault) 92%, #000) 30%, transparent);
  border-radius: 50% / 46%;
  opacity: 0; transition: opacity 0.35s 0.25s;
}
.is-open .box__base::before { opacity: 1; }
.box__seam { position: absolute; inset: 34% 0 0; border-top: 2px solid color-mix(in srgb, var(--vault) 45%, transparent); }
.is-open .box__seam { opacity: 0; transition: opacity 0.3s; }

.is-armed .box { animation: shake 0.5s ease-in-out 2; }
@keyframes shake {
  0%,100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-3px) rotate(-1.4deg); }
  75% { transform: translateX(3px) rotate(1.4deg); }
}
/* The lid leaves; the base stays open on the stage and the prize rises out of it. */
.is-open .box { transform: translateY(42px) scale(0.88); }
.is-open .box__lid { transform: translateY(-64px) rotate(-19deg); opacity: 0; transition: transform 0.55s cubic-bezier(.3,-0.4,.4,1.4), opacity 0.5s; }

.prize { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0.5rem; opacity: 0; transform: translateY(8px); pointer-events: none; padding: 1rem; z-index: 2; }
.is-open .prize { opacity: 1; transform: translateY(-22px); transition: opacity 0.4s 0.3s, transform 0.55s 0.3s cubic-bezier(.25,.8,.4,1); }
.prize__tier { font-family: var(--data); font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.prize__name { font-variation-settings: 'wdth' 118, 'wght' 800; font-size: clamp(1.35rem, 3.4vw, 1.9rem); text-transform: uppercase; line-height: 1.02; }
.prize__val  { font-family: var(--data); font-size: 0.78rem; color: var(--stock-dim); }

.reveal__foot { border-top: var(--edge); padding: 0.85rem 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.stamp { font-family: var(--data); font-size: 0.63rem; line-height: 1.7; color: var(--stock-dim); }
.stamp b { color: color-mix(in srgb, var(--stock) 85%, transparent); font-weight: 400; }
.reveal__btn { font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; background: transparent; color: var(--brass); border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); border-radius: 2px; padding: 0.6rem 1rem; cursor: pointer; transition: background 0.18s, color 0.18s; }
.reveal__btn:hover:not(:disabled) { background: var(--brass); color: var(--vault); }
.reveal__btn:disabled { opacity: 0.4; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .live__dot { animation: none; }
  .is-armed .box { animation: none; }
  .is-open .box__lid, .is-open .box__base, .is-open .prize { transition-duration: 0.01ms; }
}

/* ---------- sections ---------- */

.sec { padding-block: var(--stack); border-top: var(--edge); }
.sec__head { max-width: 62ch; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.sec__head .lede { margin-top: 1.1rem; }

/* sequence — a drop genuinely happens in this order, so the numbering carries information */
.steps { display: grid; gap: 1px; background: color-mix(in srgb, var(--brass) 18%, transparent); border: var(--edge); border-radius: 3px; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.steps > li::marker { content: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--vault); padding: clamp(1.5rem, 2.6vw, 2.1rem); }
.step__n { font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.2em; color: var(--brass); display: block; margin-bottom: 1rem; }
.step__t { font-variation-settings: 'wdth' 112, 'wght' 700; font-size: 1.08rem; text-transform: uppercase; letter-spacing: -0.01em; margin: 0 0 0.6rem; }
.step p { margin: 0; font-size: 0.94rem; color: color-mix(in srgb, var(--stock) 68%, transparent); }

.split { display: grid; gap: clamp(1.5rem, 3vw, 2rem); }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.card { border: var(--edge); border-radius: 3px; padding: clamp(1.6rem, 3vw, 2.4rem); background: color-mix(in srgb, var(--vault-2) 55%, transparent); }
.card h3 { font-size: 1.3rem; text-transform: uppercase; font-variation-settings: 'wdth' 115, 'wght' 800; margin-bottom: 1.2rem; }
.card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.85rem; }
.card li { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; font-size: 0.96rem; color: color-mix(in srgb, var(--stock) 76%, transparent); }
.card li::before { content: '▪'; color: var(--brass); line-height: 1.5; }

/* status — honest about what exists today */
.status { display: grid; gap: 1px; background: color-mix(in srgb, var(--brass) 18%, transparent); border: var(--edge); border-radius: 3px; overflow: hidden; }
@media (min-width: 760px) { .status { grid-template-columns: repeat(3, 1fr); } }
.status__row { background: var(--vault); padding: clamp(1.4rem, 2.4vw, 1.9rem); display: grid; gap: 0.55rem; }
.status__state { font-family: var(--data); font-size: 0.63rem; letter-spacing: 0.18em; text-transform: uppercase; }
.status__state.is-now  { color: var(--brass); }
.status__state.is-next { color: var(--stock-dim); }
.status__what { font-variation-settings: 'wdth' 112, 'wght' 700; font-size: 1.02rem; text-transform: uppercase; }
.status__row p { margin: 0; font-size: 0.92rem; color: color-mix(in srgb, var(--stock) 65%, transparent); }

.note { margin-top: 1.75rem; padding: 1.1rem 1.3rem; border-left: 2px solid var(--brass); background: color-mix(in srgb, var(--vault-2) 60%, transparent); font-size: 0.95rem; color: color-mix(in srgb, var(--stock) 78%, transparent); border-radius: 0 3px 3px 0; }
.note a { color: var(--brass-hi); }

/* ---------- footer ---------- */

.foot { border-top: var(--edge); padding: 2.5rem 0 3.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; }
.foot p { margin: 0; font-family: var(--data); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--stock-dim); }
.foot a { color: var(--brass); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
