:root {
  --soot: #15110d;
  --soot-2: #211a14;
  --paper: #f4ead7;
  --paper-2: #eadcc1;
  --ink: #16130f;
  --ink-soft: #5b4b3d;
  --orange: #ff5a14;
  --orange-ink: #b53a00;
  --yellow: #ffc53d;
  --cream: #fff4e0;
  --cream-soft: #d8c4aa;
  --bot: #7dffb4;
  --line-dark: rgba(255, 244, 224, .14);
  --shadow: 5px 5px 0 var(--ink);
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --sign: 'Archivo Narrow', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --body: 'Archivo', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 50% 115%, rgba(255, 90, 20, .35) 0%, rgba(255, 90, 20, 0) 70%) fixed,
    var(--soot);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
main, .nav, footer { position: relative; z-index: 1; }
a { color: var(--yellow); text-underline-offset: 3px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hazard {
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, var(--ink) 16px 32px);
}

/* Nav */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; }
.logo { font-family: var(--display); font-size: 21px; color: var(--cream); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--orange); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--cream-soft); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 14px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.nav-links a:hover { color: var(--cream); }
.nav-links a[aria-current] { color: var(--ink); background: var(--cream); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 10px;
  font: 700 17px/1.1 var(--body); text-decoration: none; cursor: pointer;
  background: var(--orange); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.btn:hover { background: var(--yellow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn.secondary { background: var(--paper); }
.btn.secondary:hover { background: #fff; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.btn.dark-ghost { background: transparent; color: var(--cream); border-color: var(--line-dark); box-shadow: none; }
.btn.dark-ghost:hover { border-color: var(--cream); background: transparent; }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.paper :focus-visible { outline-color: var(--ink); }

/* Paper surfaces */
.paper { background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; position: relative; }
.paper a { color: var(--orange-ink); }
.kicker { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border: 2px solid currentColor; border-radius: 999px;
}

/* Hero */
.hero { display: grid; gap: 22px; margin-top: 12px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); grid-template-rows: auto 1fr; align-items: start; }
  .board { grid-column: 1; grid-row: 1; }
  .ticket { grid-column: 1; grid-row: 2; }
  .scene { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
}

.board { overflow: hidden; box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); }
.board-head { background: var(--ink); color: var(--orange); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 20px; }
.board-head strong { font-family: var(--sign); font-size: clamp(18px, 3.4vw, 26px); letter-spacing: .03em; text-transform: uppercase; }
.board-head span { font-family: var(--mono); font-size: 12px; color: var(--cream-soft); white-space: nowrap; }
.board-body { padding: 24px 20px 26px; text-align: center; }
.screw { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #b9ab96; border: 2px solid var(--ink); }
.screw::after { content: ''; position: absolute; left: 1px; right: 1px; top: 3px; height: 2px; background: var(--ink); transform: rotate(35deg); }
.screw.bl { left: 10px; bottom: 10px; } .screw.br { right: 10px; bottom: 10px; }
.board-line { font-family: var(--sign); font-weight: 700; text-transform: uppercase; font-size: clamp(20px, 3.6vw, 30px); line-height: 1.1; letter-spacing: .02em; margin: 0; }
.digits { display: inline-flex; gap: 8px; margin: 16px 0 14px; }
.digit {
  position: relative; display: inline-block; min-width: .72em;
  font-family: var(--display); font-size: clamp(96px, 19vw, 168px); line-height: 1;
  padding: 10px 12px 14px; border-radius: 12px;
  background: linear-gradient(var(--soot-2) 50%, var(--ink) 50%); color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.digit::after { content: ''; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 3px; background: rgba(0, 0, 0, .55); }
.board-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 16px 0 0; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.board-meta b { color: var(--ink); font-weight: 600; }
.record { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(31, 157, 85, .2); }

.ticket { padding: 22px 22px 24px; background: var(--paper-2); }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ticket-top .chip { color: var(--orange-ink); }
.ticket h1, .ticket h2 { font-family: var(--display); font-size: clamp(26px, 4vw, 36px); line-height: 1.08; margin: 0 0 10px; letter-spacing: -.01em; }
.source { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }
.source cite { font-style: normal; font-weight: 700; color: var(--ink); }
.quip { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px; background: var(--paper); border: 2px dashed var(--ink-soft); border-radius: 10px; font-weight: 600; }
.quip svg { flex: 0 0 34px; height: 36px; }
.quip small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.scene {
  background: linear-gradient(#1a120d, #0f0b08); border: 4px solid var(--ink); border-radius: 14px;
  overflow: hidden; position: relative; aspect-ratio: 4 / 4.2; max-height: 560px; margin: 0 auto; width: 100%;
}
@media (max-width: 899px) { .scene { aspect-ratio: auto; height: 250px; } }
.scene canvas { position: absolute; left: 0; bottom: 0; width: 100%; height: 62%; }
.scene .bot { position: absolute; left: 50%; bottom: 2%; width: 66%; max-width: 330px; transform: translateX(-38%); }
@media (max-width: 899px) { .scene .bot { width: auto; height: 94%; } .scene .bot svg { height: 100%; width: auto; } }
.scene .bot svg { display: block; width: 100%; height: auto; }
.scene .bubble {
  position: absolute; left: 7%; top: 9%;
  background: var(--cream); color: var(--ink); font-weight: 700; font-size: clamp(16px, 2.2vw, 20px);
  padding: 8px 14px; border-radius: 14px; border: 4px solid var(--ink);
}
.scene .bubble::after { content: ''; position: absolute; right: 16px; bottom: -16px; border: 9px solid transparent; border-top-color: var(--ink); }
.scene .pause {
  position: absolute; right: 10px; top: 10px; z-index: 3; min-height: 44px; padding: 8px 12px;
  font: 600 13px var(--mono); color: var(--cream); background: rgba(21, 17, 13, .7); border: 2px solid var(--line-dark); border-radius: 8px; cursor: pointer;
}
.scene .pause:hover { border-color: var(--cream); }

/* Sections */
section { margin-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--display); font-size: clamp(30px, 4.6vw, 44px); line-height: 1.05; margin: 0; letter-spacing: -.01em; }
.section-head p { margin: 0; color: var(--cream-soft); max-width: 460px; font-size: 15px; }

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.log-item { display: grid; grid-template-columns: 1fr; gap: 6px 22px; padding: 18px 20px; }
@media (min-width: 720px) { .log-item { grid-template-columns: 130px 1fr; } }
.log-date { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink-soft); padding-top: 4px; }
.log-date .chip { margin-top: 8px; color: var(--orange-ink); }
.log-item h3 { font-family: var(--display); font-size: 22px; line-height: 1.15; margin: 0 0 6px; }
.log-item .source { font-size: 15px; margin-bottom: 8px; }
.log-item .quip { margin-bottom: 12px; padding: 8px 12px; font-size: 15px; }
.log-item .quip svg { flex-basis: 26px; height: 28px; }
.log-more { margin-top: 18px; text-align: center; }
.log-note { margin-top: 16px; color: var(--cream-soft); font-size: 14px; text-align: center; }

.cta-band { padding: 30px 24px; text-align: center; background: var(--orange); color: var(--ink); }
.cta-band h2 { font-family: var(--display); font-size: clamp(28px, 4.4vw, 42px); line-height: 1.05; margin: 0 0 8px; }
.cta-band p { margin: 0 0 18px; font-weight: 600; }
.cta-band .btn { background: var(--paper); }

footer { margin-top: 90px; padding: 26px 0 40px; border-top: 1px solid var(--line-dark); color: var(--cream-soft); font-size: 14px; text-align: center; }

/* Dialog */
dialog.share {
  width: min(560px, calc(100% - 32px)); padding: 0; border: 4px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink);
}
dialog.share::backdrop { background: rgba(10, 7, 5, .75); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; background: var(--ink); color: var(--orange); }
.dialog-head strong { font-family: var(--sign); text-transform: uppercase; font-size: 20px; letter-spacing: .03em; }
.close { min-width: 44px; min-height: 44px; background: none; border: 2px solid var(--line-dark); border-radius: 8px; color: var(--cream); font-size: 22px; cursor: pointer; }
.dialog-body { padding: 18px; }
.dialog-body canvas { display: block; width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper-2); aspect-ratio: 1; }
.status { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; font-size: 15px; }

/* Maker */
.maker { display: grid; gap: 26px; margin-top: 12px; align-items: start; }
@media (min-width: 900px) { .maker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .preview { position: sticky; top: 16px; } }
.form { padding: 0; overflow: hidden; }
.form .board-head { padding: 12px 20px; }
.form-body { padding: 22px 20px 24px; }
.form h1 { font-family: var(--display); font-size: clamp(32px, 5vw, 48px); line-height: 1.02; margin: 0 0 8px; letter-spacing: -.01em; }
.form .intro { margin: 0 0 20px; color: var(--ink-soft); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 600 15px var(--body); background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
}
.chip-btn:hover { background: #fff; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hint { font-size: 13px; color: var(--ink-soft); margin: 6px 0 16px; }
label.field { display: block; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
textarea {
  width: 100%; min-height: 110px; resize: vertical; padding: 14px 16px; border-radius: 10px;
  border: 3px solid var(--ink); background: #fffaf0; color: var(--ink);
  font: 600 20px/1.35 var(--body);
}
.count-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
details.customize { margin-top: 18px; border-top: 2px dashed var(--ink-soft); padding-top: 12px; }
details.customize summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.opt { margin: 12px 0 0; border: 0; padding: 0; }
.opt legend { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; background: var(--paper); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.form .actions { margin-top: 22px; }
.privacy { font-size: 13px; color: var(--ink-soft); margin: 14px 0 0; }
.preview canvas { display: block; width: 100%; height: auto; border: 4px solid var(--ink); border-radius: 14px; box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); background: var(--soot-2); }
.preview .preview-note { margin: 12px 0 0; font-size: 13px; color: var(--cream-soft); text-align: center; }
@media (max-width: 899px) { .preview { order: -1; max-width: 420px; margin: 0 auto; width: 100%; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.paper a.btn { color: var(--ink); }
.nav-links a { white-space: nowrap; }
@media (max-width: 420px) {
  .logo { font-size: 18px; }
  .nav-links a { padding: 10px 10px; font-size: 14px; }
}
@media (max-width: 899px) { .preview { max-width: 320px; } .preview .preview-note { display: none; } }
.preview canvas { max-height: 72vh; width: auto; max-width: 100%; margin: 0 auto; }
