/* Cards.mp coming-soon page. Colour values follow the prototype's proposed tokens (Classic light from the original
   grey handheld, Advance dark from the indigo Advance); they are reviewable proposals, not approved brand assets.
   System is the default: the page follows prefers-color-scheme until a theme is chosen (theme.js sets data-theme). */

@font-face {
  font-family: "cardsmp Pixel";
  src: url("/fonts/cardsmp-pixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-display: "cardsmp Pixel", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --bg: #EFEAE0;
  --surface: #FBF8F1;
  --surface-2: #E6E0D3;
  --text: #23222B;
  --text-muted: #5A5664;
  --line: #2E2C38;
  --line-soft: #CFC7B7;
  --accent: #3B3F99;
  --focus: #3B3F99;
  --focus-halo: #FFFFFF;
  --chosen: #8B2252;
  --chosen-text: #FFF7EE;
  --lcd-bg: #B4BC86;
  --lcd-text: #2A3317;
  --lcd-line: #4F5A2C;

  --art-sky: #E4DEC9;
  --art-sun: #F2D16B;
  --art-spark: #FBF8F1;
  --art-ground: #B4BC86;
  --art-ground2: #8E9862;
  --art-shadow: #9AA272;
  --art-line: #2E2C38;
  --art-card: #FBF8F1;
  --art-frame: #3B3F99;
  --art-window: #B4BC86;
  --art-gold: #D9A62E;
  --art-seal: #E6E0D3;
  --art-seal2: #AFA690;
  --art-pack: #8B2252;
  --art-stripe: #C2507F;
  --art-vault: #5A5664;
  --art-vault2: #8C8798;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="classic"]) {
    color-scheme: dark;
    --bg: #15122B;
    --surface: #231E48;
    --surface-2: #1B1739;
    --text: #ECEAF4;
    --text-muted: #B3AECB;
    --line: #0A0918;
    --line-soft: #3A3470;
    --accent: #B9A7FF;
    --focus: #CDBEFF;
    --focus-halo: #0A0918;
    --chosen: #C9BCFF;
    --chosen-text: #17132E;
    --lcd-bg: #26243A;
    --lcd-text: #DCD6FF;
    --lcd-line: #8C84C8;

    --art-sky: #1B1740;
    --art-sun: #DCD6FF;
    --art-spark: #B9A7FF;
    --art-ground: #26243A;
    --art-ground2: #3A3470;
    --art-shadow: #0D0B1C;
    --art-line: #0A0918;
    --art-card: #ECEAF4;
    --art-frame: #8E7FD6;
    --art-window: #3A3470;
    --art-gold: #F2CF6B;
    --art-seal: #D9D7E3;
    --art-seal2: #9893AE;
    --art-pack: #8E7FD6;
    --art-stripe: #C9BCFF;
    --art-vault: #3A3470;
    --art-vault2: #5A519A;
  }
}

:root[data-theme="advance"] {
  color-scheme: dark;
  --bg: #15122B;
  --surface: #231E48;
  --surface-2: #1B1739;
  --text: #ECEAF4;
  --text-muted: #B3AECB;
  --line: #0A0918;
  --line-soft: #3A3470;
  --accent: #B9A7FF;
  --focus: #CDBEFF;
  --focus-halo: #0A0918;
  --chosen: #C9BCFF;
  --chosen-text: #17132E;
  --lcd-bg: #26243A;
  --lcd-text: #DCD6FF;
  --lcd-line: #8C84C8;

  --art-sky: #1B1740;
  --art-sun: #DCD6FF;
  --art-spark: #B9A7FF;
  --art-ground: #26243A;
  --art-ground2: #3A3470;
  --art-shadow: #0D0B1C;
  --art-line: #0A0918;
  --art-card: #ECEAF4;
  --art-frame: #8E7FD6;
  --art-window: #3A3470;
  --art-gold: #F2CF6B;
  --art-seal: #D9D7E3;
  --art-seal2: #9893AE;
  --art-pack: #8E7FD6;
  --art-stripe: #C9BCFF;
  --art-vault: #3A3470;
  --art-vault2: #5A519A;
}

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

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-halo);
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* header */
.top, main, .foot {
  width: min(1040px, 100% - 32px);
  margin-inline: auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 20px 8px;
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text);
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 2px solid var(--line);
  background: var(--surface-2);
}
.theme-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.theme-switch label {
  display: block;
  padding: 6px 12px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  border: 2px solid transparent;
  user-select: none;
}
.theme-switch input:checked + label {
  background: var(--chosen);
  color: var(--chosen-text);
  border-color: var(--line);
}
.theme-switch input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}

/* hero */
.hero {
  display: grid;
  gap: 24px;
  align-items: center;
  padding-block: 24px 32px;
}
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
}
.lcd {
  display: inline-block;
  padding: 6px 10px 4px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1;
  color: var(--lcd-text);
  background: var(--lcd-bg);
  border: 2px solid var(--lcd-line);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.12);
}
.status-note { color: var(--text-muted); font-size: 0.9375rem; }

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 25ch;
}
.lead { margin: 0; max-width: 56ch; font-size: 1.125rem; }

.scene-frame {
  justify-self: center;
  padding: 8px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line-soft);
}
.scene { display: block; width: 256px; height: 144px; }

/* panels */
.panel {
  margin-block: 0 24px;
  padding: 20px 20px 4px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--line-soft);
}
.panel p { max-width: 68ch; }
h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 400;
}
h3 { margin: 4px 0 4px; font-size: 1.125rem; line-height: 1.3; }

.areas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.areas li {
  padding: 12px;
  background: var(--surface-2);
  border: 2px solid var(--line-soft);
}
.areas p { margin: 0 0 4px; }
.icon { display: block; width: 36px; height: 36px; color: var(--text); }
.note { color: var(--text-muted); }
.notice { border-style: dashed; }

.foot {
  padding-block: 8px 40px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.foot p { margin: 0 0 6px; max-width: 80ch; }

/* pixel art colours */
.p-ink { fill: currentColor; }
.p-sky { fill: var(--art-sky); }
.p-sun { fill: var(--art-sun); }
.p-spark { fill: var(--art-spark); }
.p-ground { fill: var(--art-ground); }
.p-ground2 { fill: var(--art-ground2); }
.p-shadow { fill: var(--art-shadow); }
.p-line { fill: var(--art-line); }
.p-card { fill: var(--art-card); }
.p-frame { fill: var(--art-frame); }
.p-window { fill: var(--art-window); }
.p-gold { fill: var(--art-gold); }
.p-seal { fill: var(--art-seal); }
.p-seal2 { fill: var(--art-seal2); }
.p-pack { fill: var(--art-pack); }
.p-stripe { fill: var(--art-stripe); }
.p-vault { fill: var(--art-vault); }
.p-vault2 { fill: var(--art-vault2); }

/* restrained motion: a one-pixel bob and a slow twinkle, stepped like a sprite */
.bob { animation: bob 2.4s steps(1, end) infinite; }
.twinkle { animation: twinkle 3.2s steps(1, end) infinite; }
.twinkle-late { animation-delay: 1.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .bob, .twinkle { animation: none; }
}

@media (min-width: 720px) {
  .areas { grid-template-columns: repeat(3, 1fr); }
  .panel { padding: 24px 28px 8px; }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr auto; gap: 40px; padding-block: 40px 48px; }
  .scene { width: 320px; height: 180px; }
}

@media (forced-colors: active) {
  .theme-switch input:checked + label { outline: 2px solid CanvasText; }
}
