/* cdnd.sh, the CLI's own site: cdnd as a thing in a box. The hero is a pixel
   cardboard box the demon pops out of; the features are the items in the box,
   shown as a game inventory; the waitlist is a shipping label. Pixel art is
   drawn on canvases by cli.js; app.css gives the fonts and the reset. */

:root {
  --bg: #15100e; --bg-dot: #241b17; --panel: #1f1714; --panel-2: #2a201c; --edge: #3d2c25; --edge-hi: #5a4238;
  --text: #f6e9df; --mute: #b49c8e; --faint: #7a6155;
  --clay: #e2795a; --clay-hi: #f6b08f; --clay-lo: #b9533a; --green: #7cf58a; --gold: #ffd66b; --red: #ff4d40;
  --card: #f3e6d3; --card-ink: #2b1d18;
  --legendary: #ff9a4d; --epic: #c792ea; --rare: #8fb8ff; --uncommon: #7cf58a;
}
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body.box-site {
  max-width: none; padding: 0; color: var(--text); font-size: 15px; line-height: 1.6;
  background-color: var(--bg); background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.2px); background-size: 10px 10px;
}
code { font-family: var(--mono); font-size: 0.88em; color: var(--clay-hi); background: var(--panel-2); padding: 0 5px; }
a { color: var(--clay-hi); }
section { scroll-margin-top: 80px; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 500; }

/* Pixel buttons: a hard shadow, press to sink */
.px-btn {
  display: inline-block; font-family: var(--pixel); font-size: 18px; color: var(--text); text-decoration: none; cursor: pointer;
  background: var(--panel-2); border: 3px solid #000; padding: 9px 20px 8px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.08), 5px 5px 0 #000;
}
.px-btn:hover { background: var(--edge); color: var(--text); }
.px-btn:active { transform: translate(5px, 5px); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.08); }
.px-btn.primary { background: var(--clay); color: #1a0f0b; }
.px-btn.primary:hover { background: var(--clay-hi); }

/* Top */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; margin: 0; padding: 14px clamp(20px, 4vw, 56px); background: rgba(21, 16, 14, 0.92); border-bottom: 3px solid #000; }
.top-brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 24px; color: var(--text); text-decoration: none; }
.top-brand img { image-rendering: pixelated; }
.top-brand i { font-style: normal; color: var(--clay); animation: blink 1s steps(1) infinite; }
.top-links { display: flex; gap: 26px; margin-left: auto; }
.top-links a { font-family: var(--crt); font-size: 21px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mute); text-decoration: none; }
.top-links a:hover { color: var(--text); }

/* ── 1 · The box ── */
.hero { max-width: 1280px; margin: 0 auto; min-height: calc(100vh - 70px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: 40px clamp(20px, 4vw, 56px) 60px; }
.tag { font-family: var(--crt); font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); margin-bottom: 16px; }
.blink { display: inline-block; width: 10px; height: 10px; background: var(--green); margin-right: 10px; vertical-align: 1px; animation: blink 1.4s steps(1) infinite; }
.hero h1 { font-size: clamp(40px, 4.4vw, 66px); line-height: 1.02; margin-bottom: 22px; text-shadow: 4px 4px 0 #000; }
.hero h1 em { font-style: normal; color: var(--clay); }
.lede { font-size: 17px; color: var(--mute); max-width: 500px; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }

.stage { position: relative; container-type: inline-size; aspect-ratio: 128 / 122; }
.stage::before { content: ""; position: absolute; inset: 6% 8% 0; background: radial-gradient(ellipse at 52% 62%, rgba(226, 121, 90, 0.22), transparent 62%); pointer-events: none; }
.stage canvas { position: relative; display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; }
/* Print on the box front, placed from scene coordinates by cli.js (1 scene px = 0.78cqw) */
.label { position: absolute; pointer-events: none; font-family: var(--crt); text-transform: uppercase; color: #5a3a1e; line-height: 1; }
.stamp { font-family: var(--pixel); font-size: 5.6cqw; color: rgba(178, 60, 40, 0.9); border: 0.6cqw solid rgba(178, 60, 40, 0.85); padding: 0.2cqw 1.1cqw 0.5cqw; rotate: -7deg; letter-spacing: 0.04em; }
.contents { font-size: 2.6cqw; line-height: 1.05; letter-spacing: 0.04em; }
.upright { font-size: 4cqw; }
.noasm { font-size: 2.45cqw; letter-spacing: 0.06em; background: rgba(90, 58, 30, 0.14); padding: 0.4cqw 0.8cqw; }
.stage.shake .label { translate: var(--sx, 0) 0; }
.bubble {
  position: absolute; left: 72%; top: 1%; max-width: 30%; font-family: var(--mono); font-size: clamp(12px, 1.9cqw, 16px); line-height: 1.45; color: var(--text);
  background: var(--panel); border: 3px solid #000; box-shadow: 4px 4px 0 #000; padding: 8px 12px; z-index: 2;
}
.bubble::after { content: ""; position: absolute; left: -12px; bottom: 10px; width: 12px; height: 12px; background: var(--panel); border-left: 3px solid #000; border-bottom: 3px solid #000; clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.bubble .g { color: var(--green); }
.hint { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: var(--crt); font-size: clamp(16px, 2.4cqw, 22px); letter-spacing: 0.06em; color: var(--faint); animation: blink 2.2s steps(1) infinite; }

/* Section heads */
.section-head { margin-bottom: 34px; }
.section-head h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.05; text-shadow: 3px 3px 0 #000; margin-bottom: 6px; }
.section-head p { color: var(--mute); font-size: 16px; }

/* ── 2 · Inventory ── */
.inside { max-width: 1280px; margin: 0 auto; padding: 80px clamp(20px, 4vw, 56px); }
.inv-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start; }
.inventory { background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--edge), 8px 8px 0 #000; padding: 16px 18px 20px; }
.inv-title { display: flex; justify-content: space-between; gap: 20px; font-family: var(--crt); font-size: 20px; letter-spacing: 0.08em; color: var(--mute); margin-bottom: 10px; }
.inv-title span { color: var(--faint); }
.inv-title.missing { margin-top: 20px; }
.slots { display: grid; grid-template-columns: repeat(4, 76px); gap: 8px; }
.slot {
  position: relative; width: 76px; height: 76px; padding: 0; background: #120d0b; border: 3px solid #000; cursor: pointer;
  box-shadow: inset 3px 3px 0 #0a0706, inset -3px -3px 0 var(--edge);
}
.slot canvas { display: block; width: 48px; height: 48px; margin: 11px auto; image-rendering: pixelated; }
.slot:hover { background: #1c1411; }
.slot.sel { outline: 3px solid var(--r, var(--clay)); outline-offset: 0; box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.06), 0 0 16px var(--r, var(--clay)); }
.slot .q { position: absolute; right: 4px; bottom: 2px; font-family: var(--crt); font-size: 16px; color: var(--text); }
.slots.off .slot { cursor: help; }
.slots.off canvas { opacity: 0.45; filter: grayscale(1); }
.slots.off .slot::after { content: ""; position: absolute; inset: 14px; background: linear-gradient(45deg, transparent 46%, var(--red) 46%, var(--red) 54%, transparent 54%); opacity: 0.8; }

.card-item { position: relative; min-height: 100%; background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--r, var(--edge)), 8px 8px 0 #000; padding: 26px 28px; }
.ci-top { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.ci-top canvas { width: 96px; height: 96px; image-rendering: pixelated; background: #120d0b; border: 3px solid #000; box-shadow: inset -3px -3px 0 var(--edge); padding: 8px; box-sizing: content-box; flex: none; }
.ci-name { font-family: var(--pixel); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.05; color: var(--r, var(--text)); text-shadow: 3px 3px 0 #000; }
.ci-type { font-family: var(--crt); font-size: 20px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
.ci-desc { font-size: 16px; color: var(--text); margin-bottom: 16px; max-width: 620px; }
.ci-stats { list-style: none; display: grid; gap: 4px; font-family: var(--mono); font-size: 13px; color: var(--green); margin-bottom: 16px; }
.ci-stats li::before { content: "+ "; color: var(--faint); }
.ci-stats.neg { color: var(--red); }
.ci-stats.neg li::before { content: "− "; }
.ci-flavor { font-family: var(--crt); font-size: 20px; color: var(--gold); letter-spacing: 0.02em; }

/* ── 3 · Shipping label ── */
.ship { max-width: 1280px; margin: 0 auto; padding: 80px clamp(20px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.label-card {
  position: relative; background: var(--card); color: var(--card-ink); padding: 22px 26px 18px; transform: rotate(-1.2deg);
  border: 3px solid #000; box-shadow: 10px 10px 0 #000; font-family: var(--mono);
}
.label-card::before { content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(43, 29, 24, 0.35); pointer-events: none; }
.lc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 3px solid var(--card-ink); margin-bottom: 14px; }
.lc-head img { image-rendering: pixelated; }
.lc-head b { display: block; font-family: var(--pixel); font-size: 26px; font-weight: 500; line-height: 1; }
.lc-head span { font-family: var(--crt); font-size: 18px; text-transform: uppercase; letter-spacing: 0.06em; color: #6d5548; }
.lc-no { margin-left: auto; font-family: var(--crt); font-size: 20px; color: #6d5548; }
.lc-no b { font-family: var(--crt); font-size: 20px; color: var(--card-ink); display: inline; }
.lc-row { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.lc-row label, .lc-grid span { font-family: var(--crt); font-size: 18px; text-transform: uppercase; letter-spacing: 0.08em; color: #6d5548; white-space: nowrap; }
.ship-to input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 20px; color: var(--card-ink); background: transparent; border: none; border-bottom: 3px solid var(--card-ink); padding: 4px 2px; box-shadow: none; }
.ship-to input:focus { box-shadow: none; border-color: var(--clay-lo); }
.ship-to input::placeholder { color: #b49c8e; }
.lc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid rgba(43, 29, 24, 0.25); }
.lc-grid div { padding: 8px 0; border-bottom: 2px solid rgba(43, 29, 24, 0.25); }
.lc-grid div:nth-child(odd) { padding-right: 12px; border-right: 2px solid rgba(43, 29, 24, 0.25); }
.lc-grid div:nth-child(even) { padding-left: 14px; }
.lc-grid b { display: block; font-size: 15px; }
.lc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 16px; }
.lc-foot canvas { width: 220px; height: 40px; image-rendering: pixelated; }
.lc-note { min-height: 1.5em; margin-top: 10px; font-size: 12px; color: #6d5548; }
.lc-note.bad { color: #c0362c; }
.lc-note.good { color: #2f8f45; }
.label-card.done .ship-to input { border-bottom-style: dotted; }
.rubber {
  position: absolute; right: 8%; top: 30%; font-family: var(--pixel); font-size: clamp(34px, 4.6vw, 58px); letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(200, 40, 30, 0.85); border: 6px solid rgba(200, 40, 30, 0.85); padding: 2px 18px 6px; transform: rotate(-14deg); pointer-events: none; mix-blend-mode: multiply;
  animation: slam 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes slam { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }

/* ── 4 · FAQ ── */
.faq { max-width: 1280px; margin: 0 auto; padding: 80px clamp(20px, 4vw, 56px) 100px; }
.faq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.faq-grid > div { background: var(--panel); border: 3px solid #000; box-shadow: inset 0 0 0 3px var(--edge), 6px 6px 0 #000; padding: 18px 18px 20px; }
.faq h3 { font-size: 19px; color: var(--clay); margin-bottom: 8px; }
.faq p { color: var(--mute); font-size: 14px; }
.link-btn { padding: 0; font: inherit; color: var(--clay-hi); text-decoration: underline; }
.link-btn:hover { background: none; color: var(--text); }

/* Footer */
.end { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin: 0; padding: 26px clamp(20px, 4vw, 56px) 34px; border-top: 3px solid #000; background: #0f0b0a; color: var(--faint); font-size: 12px; }
.end-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 16px; color: var(--mute); }
.end-brand img { image-rendering: pixelated; }

/* Film */
.film { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, 0.88); }
.film[hidden] { display: none; }
.film-box { position: relative; width: min(1100px, 100%); border: 3px solid #000; box-shadow: 0 0 0 3px var(--clay); }
.film-box video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.film-close { position: absolute; right: 0; top: -40px; font-family: var(--crt); font-size: 20px; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .hint, .blink { animation: none; }
}
@media (max-width: 1040px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .inv-wrap, .ship { grid-template-columns: minmax(0, 1fr); }
  .inventory { justify-self: start; }
  .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .top-links a:not(:last-child) { display: none; }
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot { width: auto; height: auto; aspect-ratio: 1; }
  .slot canvas { width: 70%; height: auto; aspect-ratio: 1; margin: 15% auto; }
  .inventory { justify-self: stretch; padding: 12px; }
  .ci-top canvas { width: 64px; height: 64px; }
  .label-card { padding: 18px 16px 14px; }
  .lc-grid { grid-template-columns: minmax(0, 1fr); }
  .lc-grid div:nth-child(odd) { border-right: none; padding-right: 0; }
  .lc-grid div:nth-child(even) { padding-left: 0; }
  .lc-foot { flex-direction: column; align-items: stretch; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); }
}
