/* =====================================================================
   Run of Show — charity ad auction

   Colour strategy: COMMITTED. One saturated signal red carries the page;
   the rundown is a physical sheet of paper lying on it. Marker yellow is
   the only accent, and it means exactly one thing: this slot is for sale.
   ===================================================================== */

:root {
  --signal:  #a52d18;  /* the ground — tally lamp / on-air red        */
  --sheet:   #f5f1ef;  /* paper, tinted toward the signal hue          */
  --ink:     #17100e;
  --ink-2:   #6a5852;  /* 5.98:1 on sheet                             */
  --bone:    #fcefe9;  /* 6.24:1 on signal                            */
  --bone-2:  #f0d0c5;  /* 4.86:1 on signal                            */
  --rule:    #d3ccc7;
  --marker:  #f5e04a;  /* 14.0:1 under ink, ~5.0:1 on signal          */

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --max: 60rem;

  --z-base: 0;
  --z-sticky: 10;
  --z-skip: 60;
}

*, *::before, *::after { box-sizing: border-box; }

/* must beat .btn { display: inline-block } */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
em { font-style: normal; text-decoration: underline; text-underline-offset: 2px; }
a { color: inherit; }

.wrap {
  width: min(100% - (var(--gut) * 2), var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--bone);
  padding: .75rem 1rem; font-family: var(--mono); font-size: .8rem;
  z-index: var(--z-skip);
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.hero :focus-visible, .foot :focus-visible { outline-color: var(--marker); }

/* ------------------------------- highlighter ------------------------------
   The signature: available inventory is swiped with a marker.              */

.mark {
  padding: 0 .18em;
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-position: -.18em center;
  background-size: 0 .95em;
  animation: swipe .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes swipe { to { background-size: calc(100% + .36em) .95em; } }

.line:nth-of-type(3) .mark { animation-delay: .10s; }
.line:nth-of-type(5) .mark { animation-delay: .18s; }
.line:nth-of-type(7) .mark { animation-delay: .26s; }
.line:nth-of-type(9) .mark { animation-delay: .34s; }

.line.is-ended .mark { background-image: none; }

/* ------------------------------- doc header ------------------------------- */

.docbar { background: var(--ink); color: var(--bone); }
.docbar__in {
  display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
  padding: .55rem 0;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.docbar__in > span[aria-hidden] { opacity: .35; }
.docbar__status { color: var(--marker); }

/* separators read as orphans once the bar wraps */
@media (max-width: 34rem) {
  .docbar__in > span[aria-hidden] { display: none; }
  .docbar__in { gap: .35rem 1rem; }
}

/* ---------------------------------- hero ---------------------------------
   Sits directly on the signal ground. No metric tiles, no eyebrow.        */

.hero {
  color: var(--bone);
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(3rem, 8vw, 5.5rem);
}

.hero__title {
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.03em;
  font-size: clamp(2.75rem, 11vw, 6rem);
  line-height: .92;
  margin-bottom: 1.5rem;
}

.hero__sub {
  font-family: var(--mono);
  font-size: clamp(.78rem, 2.2vw, .92rem);
  color: var(--bone-2);
  padding-top: 1rem;
  border-top: 2px solid currentColor;
  margin-bottom: 1.75rem;
}

.hero__pitch {
  font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem);
  line-height: 1.4;
  max-width: 34ch;
  margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

/* Two hero phases. Default (and no-JS) is pre-open, which is the truthful
   state until the listings publish; app.js flips [data-phase] once any
   listing reports live. */
.ledger__preopen {
  font-family: var(--mono);
  font-size: clamp(.95rem, .88rem + .4vw, 1.2rem);
  line-height: 1.55;
  max-width: 44ch;
  color: var(--bone);
}
.ledger__preopen strong { color: var(--marker); font-weight: 700; }

.hero:not([data-phase="live"]) .ledger,
.hero:not([data-phase="live"]) .ledger__meta,
.hero:not([data-phase="live"]) .ledger__note { display: none; }
.hero[data-phase="live"] .ledger__preopen { display: none; }

/* the running total, set as typed lines — not metric tiles */
.ledger {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 .5rem;
  font-family: var(--mono);
}
.ledger__sum {
  color: var(--marker);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.ledger__lbl {
  font-size: clamp(.95rem, .88rem + .35vw, 1.15rem);
  color: var(--bone);
}
.ledger__meta {
  margin-top: .55rem;
  font-family: var(--mono);
  font-size: clamp(.85rem, .8rem + .3vw, 1rem);
  color: var(--bone);
}
.ledger__clock {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ledger__note {
  margin-top: .7rem;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .03em;
  color: var(--bone-2);
  display: flex; flex-wrap: wrap; gap: .2rem 1rem;
}

/* ----------------------------- the paper sheet ---------------------------- */

.sheet-panel {
  background: var(--sheet);
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
  padding-block: clamp(.5rem, 1.5vw, 1rem);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, .22),
    0 26px 64px -28px rgba(0, 0, 0, .55);
  /* ruled stock */
  background-image: linear-gradient(
    to bottom, rgba(23, 16, 14, .05) 1px, transparent 1px);
  background-size: 100% 2.25rem;
}

/* ------------------------------ section titles ---------------------------
   Sentence case at a real size. No tracked all-caps kicker.               */

.section-title {
  font-family: var(--mono);
  font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -.015em;
  padding-bottom: .55rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.75rem;
}
.section-title--tight { margin-bottom: 1rem; }

/* -------------------------------- explainer ------------------------------- */

.explain { padding: clamp(2rem, 5vw, 3.25rem) 0; }
.explain__body {
  display: grid;
  gap: 1.1rem;
  max-width: 62ch;
  font-size: clamp(1rem, .97rem + .25vw, 1.12rem);
}

/* --------------------------------- rundown -------------------------------- */

.rundown { padding: clamp(2rem, 5vw, 3rem) 0 clamp(2.5rem, 6vw, 3.5rem); }
.rundown__head { margin-bottom: 1.5rem; }
.rundown__note {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-2);
  margin-top: -1.25rem;
}

.log {
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.line {
  display: grid;
  grid-template-columns: 4rem 1fr minmax(8.5rem, auto) auto;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: 1.15rem 1.25rem 1.15rem 1rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.line--filler {
  display: block;
  padding-block: .7rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: repeating-linear-gradient(
    -45deg, transparent 0 6px, rgba(23, 16, 14, .045) 6px 12px);
}

.line--sponsor {
  background: rgba(165, 45, 24, .05);
  border-bottom-width: 2px;
  border-bottom-color: var(--ink);
  padding-block: 1.6rem;
}

/* bracket ticks: the title sponsor wraps the whole show */
.line[data-bracket]::before {
  content: "";
  position: absolute;
  left: -2px; top: 0;
  width: .85rem; height: 2px;
  background: var(--ink);
}
.line[data-bracket="close"]::before { top: auto; bottom: 0; }

.line__code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink-2);
  padding-top: .15rem;
}
.line--sponsor .line__code { color: var(--signal); }

.line__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 1rem + .5vw, 1.35rem);
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.line--sponsor .line__name { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.7rem); }

.line__pos {
  margin-top: .4rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.line__gets {
  display: grid;
  gap: .3rem;
  margin-top: .9rem;
  max-width: 42ch;
  font-size: .92rem;
}
.line__gets li { padding-left: 1rem; position: relative; }
.line__gets li::before {
  content: "+";
  position: absolute; left: 0;
  font-family: var(--mono);
  color: var(--signal);
}

.line__stat { text-align: right; }

.price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.1rem + .9vw, 1.75rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.bids, .left {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--ink-2);
  margin-top: .4rem;
}
.left[data-urgent] { color: var(--signal); font-weight: 600; }
.line.is-ended .price { color: var(--ink-2); }

/* buttons ----------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .7rem 1.1rem;
  border: 2px solid var(--ink);
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1),
              box-shadow .18s cubic-bezier(.16, 1, .3, 1),
              background-color .18s ease, color .18s ease;
}
.btn--lg { padding: .9rem 1.5rem; font-size: .8rem; }

a.btn:hover, a.btn:focus-visible {
  background: var(--marker);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
a.btn:active { transform: none; box-shadow: none; }

.btn--off {
  background: transparent;
  color: var(--ink-2);
  border-style: dashed;
  border-color: var(--rule);
  cursor: default;
}

.log__foot {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-2);
}

/* --------------------------------- what buys ------------------------------ */

.buys { padding: clamp(2rem, 5vw, 3.25rem) 0; }
/* Fixed counts, not auto-fit: 4 items must never orphan an empty cell. */
.buys__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 60rem) { .buys__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 30rem) { .buys__grid { grid-template-columns: 1fr; } }
.buys__item { background: var(--sheet); padding: 1.4rem 1.35rem 1.6rem; }
.buys__item h3 {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: -.01em;
  margin-bottom: .6rem;
}
.buys__item p { font-size: .95rem; }

/* --------------------------------- deadline ------------------------------- */

.deadline { padding: clamp(2rem, 5vw, 3.25rem) 0; }
.deadline__in {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.deadline__body { display: grid; gap: .9rem; max-width: 62ch; }

.stamp {
  display: grid;
  justify-items: center;
  gap: .1rem;
  padding: 1rem 1.35rem;
  border: 3px double var(--signal);
  color: var(--signal);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .65rem;
  transform: rotate(-4deg);
}
.stamp strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }

/* ----------------------------------- terms -------------------------------- */

.terms { padding: clamp(2rem, 5vw, 3.25rem) 0; }
.terms__list { display: grid; margin: 0; }
.terms__row {
  display: grid;
  grid-template-columns: minmax(11rem, 16rem) 1fr;
  gap: 1rem 2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.terms__row dt {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.terms__row dd { margin: 0; font-size: .93rem; max-width: 66ch; }

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

.foot {
  background: var(--ink);
  color: var(--bone);
  padding: clamp(2rem, 5vw, 3rem) 0;
}
.foot__in { display: grid; gap: .6rem; }
.foot__in p { max-width: 62ch; font-size: .95rem; }
.foot__meta {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--bone-2);
}

/* ==========================  responsive  ================================= */

@media (max-width: 56rem) {
  .terms__row { grid-template-columns: 1fr; gap: .4rem; }
  .deadline__in { grid-template-columns: 1fr; justify-items: start; }
}

@media (max-width: 44rem) {
  .line { grid-template-columns: 3rem 1fr; gap: .5rem .9rem; }
  .line__stat {
    grid-column: 2;
    text-align: left;
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: .25rem .9rem;
    margin-top: .5rem;
  }
  .bids, .left { margin-top: 0; }
  .line__act { grid-column: 2; margin-top: .75rem; }
  .btn { display: block; text-align: center; }
  .sheet-panel { width: 100%; }
}

/* ==========================  reduced motion  ============================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .mark { background-size: calc(100% + .36em) .95em; }
}
