/*
 * Lasertoast Studios — lasertoast.css
 * The component layer of the Lasertoast design system. Load tokens.css first.
 *
 *   <link rel="stylesheet" href="https://lasertoast.io/system/tokens.css">
 *   <link rel="stylesheet" href="https://lasertoast.io/system/lasertoast.css">
 *
 * Every Lasertoast web surface (lasertoast.io, the title sites) reads this one
 * file. Rules: crumb ground, flat full-strength fields, Anton at billboard
 * scale, mono HUD readouts, hard offset shadows. No gradients, no blur, no glow.
 * Motion is TV-native (hard cuts, a crawl, a laser) and everything holds still
 * under prefers-reduced-motion or html[data-motion="off"].
 *
 * Sections: base · type · buttons · chips · hud strip · fields · stickers ·
 * facts card · stamp · mixer · meter · listing (TV guide) · crawl · tape · OSD
 * · boing.
 */

/* ================= base ================= */

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

html {
  background: var(--crumb);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--crumb);
  color: var(--ink);
  font: var(--text-body);
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}


/* two-tone so it reads on crumb and on every colored field */
:focus-visible {
  outline: 3px solid var(--crumb);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--ink);
}

main:focus {
  outline: none;
  box-shadow: none;
}

::selection {
  background: var(--laser);
  color: var(--crumb);
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--butter);
  color: var(--crumb);
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}
.skip:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ================= type ================= */

.label,
.hud {
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hud--muted {
  color: var(--ink-muted);
}

.yell {
  font: var(--text-yell);
  font-size: clamp(32px, 5vw, 56px);
  margin: 0;
}

/* size with --shout-size (or set font-size); the token default is 72px */
.shout {
  font-size: var(--shout-size, 72px);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.wrap {
  width: min(1280px, 100% - 2 * var(--space-6));
  margin-inline: auto;
}

@media (max-width: 560px) {
  .wrap {
    width: calc(100% - 2 * var(--space-4));
  }
}

/* ================= buttons: big, squishy, pressable, stuck on ================= */

.btn {
  --btn-bg: var(--butter);
  --btn-fg: var(--crumb);
  --btn-shadow: var(--laser);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 24px;
  border: 3px solid var(--crumb);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: var(--text-label);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--btn-shadow);
  transition: transform var(--motion-press), box-shadow var(--motion-press);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  --btn-bg: var(--crust);
  --btn-fg: var(--ink-muted);
  border-color: var(--crust);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.btn:not(:disabled, [aria-disabled='true']):hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--btn-shadow);
}
.btn:not(:disabled, [aria-disabled='true']):active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--btn-shadow);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}
.btn--ghost:hover {
  box-shadow: 5px 5px 0 var(--laser);
}
/* on a colored channel field */
.btn--crumb {
  --btn-bg: var(--crumb);
  --btn-fg: var(--ink);
  --btn-shadow: var(--ink);
}
.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--crumb);
  box-shadow: none;
}
.btn--outline:hover {
  box-shadow: 5px 5px 0 var(--crumb);
}
.btn .arrow {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1;
}

/* ================= chips ================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 2px solid currentColor;
  border-radius: var(--radius-sm);
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ================= OSD: the old-TV channel readout ================= */

.osd {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 2px;
  pointer-events: none;
  opacity: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slime);
}
.osd.is-on {
  opacity: 1;
}
.osd-ch {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  padding: 4px 10px;
  background: var(--crumb);
}
.osd-name {
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--crumb);
}
/* in-flow readout for docs and previews: sits in its parent, always visible */
.osd--inline {
  position: absolute;
  opacity: 1;
}

/* ================= crawl: the ticker ================= */

.crawl {
  overflow: hidden;
  background: var(--butter);
  color: var(--crumb);
  border-block: 3px solid var(--crumb);
}
.crawl-track {
  display: flex;
  width: max-content;
  animation: crawl var(--crawl-duration) linear infinite;
}
.crawl-track > ul {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crawl li {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  white-space: nowrap;
  font: var(--text-label);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.crawl li::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--laser);
  margin-left: 18px;
}
@keyframes crawl {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crawl-track {
    animation: none;
    width: auto;
  }
  .crawl-track > ul {
    flex-wrap: wrap;
  }
  .crawl-track > ul[aria-hidden='true'] {
    display: none;
  }
}

/* "Pause motion" in the hero bar: everything holds still */
html[data-motion='off'] *,
html[data-motion='off'] *::before,
html[data-motion='off'] *::after {
  animation-play-state: paused !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* ================= stickers: media stuck onto a field ================= */

.sticker {
  border: 4px solid var(--crumb);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--crumb);
  box-shadow: var(--shadow-sticker);
}

.phone {
  border-radius: 36px;
  border-width: 8px;
}

/* ================= hud strip: the channel readout row ================= */
/* <p class="hud hud-strip"><span>CH 01</span><span>8:00</span><span>App</span></p> */

.hud-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}
.hud-strip > span {
  padding: 4px 10px;
  background: var(--crumb);
  color: var(--field, var(--butter));
  border-radius: var(--radius-sm);
}
.hud-strip > span:first-child {
  background: var(--ink);
  color: var(--crumb);
}
/* on crumb ground: outlined in the field color */
.hud-strip--outline > span,
.hud-strip--outline > span:first-child {
  background: transparent;
  border: 2px solid var(--field, var(--butter));
  color: var(--field, var(--butter));
}

/* ================= fields: a whole band owned by one hue ================= */
/* <section class="field field--laser">…</section>. Text on a field is crumb. */

.field {
  --field: var(--butter);
  background: var(--field);
  color: var(--crumb);
  border-top: 4px solid var(--crumb);
}
/* a field inside a card or panel: no cut line on top */
.field--flush {
  border-top: 0;
}
.field--butter {
  --field: var(--butter);
}
.field--laser {
  --field: var(--laser);
}
.field--slime {
  --field: var(--slime);
}
.field--zap {
  --field: var(--zap);
}
.field--toast {
  --field: var(--toast);
}

/* ================= facts card: "Previously on …" ================= */

.facts {
  padding: var(--space-6);
  background: var(--crumb);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.facts-head {
  margin: 0 0 var(--space-4);
  color: var(--field, var(--butter));
}
.facts ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-4);
}
.facts li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--space-4);
  align-items: baseline;
}
.facts li::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--field, var(--butter));
  transform: translateY(-1px);
}

/* ================= stamp: redacted, classified, not yet ================= */

.stamp {
  --stamp: var(--laser);
  display: inline-block;
  padding: 2px 8px;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

/* on a field the laser stamp disappears: use crumb */
.stamp--crumb {
  --stamp: var(--crumb);
}

/* ================= mixer: a segmented toggle borrowed from Gruvato ================= */
/* buttons carry aria-pressed; .is-on marks the live one */

.mixer {
  display: inline-flex;
  justify-self: start;
  gap: 6px;
  padding: 6px;
  background: var(--crumb);
  border-radius: 14px;
}
.mixer-key {
  min-height: var(--tap);
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--crust);
  color: var(--ink);
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.mixer-key.is-on,
.mixer-key[aria-pressed='true'] {
  background: var(--slime);
  color: var(--crumb);
}

/* ================= meter: Squishy < Chewy < Crunchy < Charcoal ================= */

.meter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.meter li {
  padding: 6px 10px;
  border: 2px solid var(--crust);
  border-radius: var(--radius-sm);
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.meter li.is-on {
  background: var(--butter);
  border-color: var(--butter);
  color: var(--crumb);
}
.meter li.is-on:nth-child(2) {
  background: var(--toast);
  border-color: var(--toast);
}
.meter li.is-on:nth-child(3) {
  background: var(--toast-dark);
  border-color: var(--toast-dark);
}
.meter li.is-on:nth-child(4) {
  background: var(--laser);
  border-color: var(--laser);
}

/* ================= listing: the TV guide ================= */
/* <ol class="listing"><li class="row row--laser"><a class="row-link">
     time · CH · name + logline · chips · arrow </a></li></ol> */

.listing {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 3px solid var(--ink);
}
.listing .row {
  border-bottom: 3px solid var(--ink);
}
.listing .row-link {
  --hot: var(--butter);
  display: grid;
  grid-template-columns: minmax(clamp(110px, 10vw, 150px), max-content) 6ch minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
  text-decoration: none;
  color: var(--ink);
}
.listing .row--butter .row-link {
  --hot: var(--butter);
}
.listing .row--laser .row-link {
  --hot: var(--laser);
}
.listing .row--zap .row-link {
  --hot: var(--zap);
}
.listing .row--slime .row-link {
  --hot: var(--slime);
}
.listing .row--toast .row-link {
  --hot: var(--toast);
}
/* a channel flip is a hard cut, never a fade */
.listing .row-link:hover,
.listing .row-link:focus-visible {
  background: var(--hot);
  color: var(--crumb);
  box-shadow: inset 12px 0 0 var(--crumb);
}
.listing .row-link:hover :is(.row-log, .row-ch),
.listing .row-link:focus-visible :is(.row-log, .row-ch) {
  color: var(--crumb);
}
.listing .row-link:hover .stamp,
.listing .row-link:focus-visible .stamp {
  background: var(--crumb);
  border-color: var(--crumb);
}
.listing .row-time {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
}
.listing .row-ch {
  color: var(--ink-muted);
}
.listing .row-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.listing .row-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1;
  text-transform: uppercase;
}
.listing .row-log {
  color: var(--ink-muted);
  max-width: 60ch;
}
.listing .row-redact {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.listing .row-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: end;
}
.listing .row-go {
  font-size: 28px;
  text-align: right;
}
@media (max-width: 860px) {
  .listing .row-link {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      'time ch go'
      'main main main'
      'meta meta meta';
    gap: var(--space-2) var(--space-4);
    padding: var(--space-4) var(--space-2);
  }
  .listing .row-link:hover,
  .listing .row-link:focus-visible {
    box-shadow: inset 6px 0 0 var(--crumb);
  }
  .listing .row-time {
    grid-area: time;
  }
  .listing .row-ch {
    grid-area: ch;
  }
  .listing .row-main {
    grid-area: main;
  }
  .listing .row-meta {
    grid-area: meta;
    justify-content: start;
  }
  .listing .row-go {
    grid-area: go;
  }
}

/* ================= tape: "We interrupt this broadcast" ================= */
/* <div class="tape" aria-hidden="true"><div class="crawl-track"><span>…</span>×8</div></div> */

/* the tape tilts past its box: put it in a .tape-frame (or any overflow-clipped parent) */
.tape-frame {
  overflow: clip;
}
.tape {
  overflow: hidden;
  background: var(--butter);
  color: var(--crumb);
  transform: rotate(-1.2deg) scale(1.04);
  border-block: 3px solid var(--crumb);
}
.tape .crawl-track {
  animation-duration: 22s;
}
.tape span {
  flex: 0 0 auto;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px);
  text-transform: uppercase;
  white-space: nowrap;
}
.tape span:nth-child(even) {
  background: var(--crumb);
  color: var(--butter);
}

/* ================= boing: a sticker you can poke ================= */
/* <button class="boing" style="--i:2" aria-label="Poke: …"><img alt=""></button>
   Add .is-boing on click; remove it on animationend. */

.boing {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(5px 5px 0 var(--crumb));
  transform: rotate(calc((var(--i, 2) - 2) * 7deg));
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.7s);
}
.boing img {
  width: 100%;
  height: auto;
}
.boing.is-boing {
  animation: boing var(--motion-boing);
}
@keyframes bob {
  50% {
    translate: 0 -8px;
  }
}
@keyframes boing {
  0% {
    scale: 1;
  }
  30% {
    scale: 1.25 0.8;
  }
  60% {
    scale: 0.9 1.15;
  }
  100% {
    scale: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .boing,
  .boing.is-boing,
  .tape .crawl-track {
    animation: none;
  }
}
