/* Gadget Match marketing pages (/, /about, /join not-found).
   Self-contained "Indigo Studio" stylesheet — this IS the approved landing
   mock-up's CSS (documentation/gadgetmatch-v5.0-landing-overhaul-spec.md),
   adapted for server-rendered Jinja + the served transparent logo. The
   marketing pages do NOT load console.css: everything they need (buttons,
   chips, layout, tokens) is defined here, so there is no cross-stylesheet
   `.btn`/`.chip` conflict. Category colours match the game SPA reskin so the
   palette reads as one system across game, console, and marketing. */

:root {
  --brand: #3d337c;
  --brand-deep: #332a68;
  --sky: #73c3eb;
  --canvas: #eef0f4;
  --surface: #ffffff;
  --panel: #f7f8fb;
  --ink: #211f2e;
  --ink-soft: #4a4757;
  --muted: #7c7989;
  --line: #e2e3ea;
  --line-soft: #edeef2;
  --hero-ground: #efeaf7;
  --logo-plate: transparent;

  /* Six technology/scenario category colours (identical values to the game
     SPA reskin, so the palette is one system across the whole app). */
  --cat-health: #c15a6a;
  --cat-independence: #2f8f72;
  --cat-mobility: #3f77b5;
  --cat-memory: #8a63ad;
  --cat-social: #cd8a3b;
  --cat-sustainability: #59923f;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(30, 28, 60, .07);
  --shadow-card: 0 14px 40px rgba(40, 34, 86, .14);
  --maxw: 1140px;
}

/* Dark theme — OS-driven only (the marketing pages are zero-JS, so there is
   no in-page toggle). Category colours stay constant; they are saturated
   enough to read on either canvas. */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9a8ee0;
    --brand-deep: #b4abe9;
    --sky: #8ed0f0;
    --canvas: #141220;
    --surface: #1f1c2c;
    --panel: #191725;
    --ink: #efedf7;
    --ink-soft: #c7c3d6;
    --muted: #928ea3;
    --line: #332f43;
    --line-soft: #272338;
    --hero-ground: #1b1830;
    --logo-plate: #f3f3f7;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-card: 0 16px 44px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

body.mkt {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* Base link colour is element-level (0,0,1) on purpose: this stylesheet only
   loads on the marketing pages, and keeping it low-specificity lets every
   component class (.btn--primary, .navlink, .foot a) set its own colour. A
   higher-specificity `body.mkt a` here would override .btn--primary's white
   text and make "Create an account" render brand-on-brand (invisible). */
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
body.mkt :focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Masthead ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Solid fallback first: iOS 15 / 16.0–16.1 Safari don't parse color-mix()
     and would otherwise leave the sticky masthead transparent. */
  background: var(--canvas);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.top__in { display: flex; align-items: center; gap: 18px; min-height: 74px; }
.logo-wrap { display: inline-flex; padding: 5px 8px; border-radius: 10px; background: var(--logo-plate); }
.logo-wrap:hover { text-decoration: none; }
.logo { height: 46px; width: auto; display: block; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.navlink { color: var(--ink-soft); font-size: 14.5px; padding: 9px 12px; border-radius: var(--radius-sm); }
.navlink:hover { color: var(--ink); text-decoration: none; background: var(--line-soft); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(61, 51, 124, .28); }
.btn--primary:hover { background: var(--brand-deep); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { background: var(--panel); border-color: var(--brand); }
.btn--lg { padding: 13px 24px; font-size: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 80% -10%, var(--hero-ground) 0%, transparent 58%);
  z-index: 0;
}
.hero__in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 52px;
  align-items: center;
  padding: 72px 0 86px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); }
.hero h1 {
  font-size: clamp(33px, 4.4vw, 54px);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 22px 0 0;
  text-wrap: balance;
  color: var(--ink);
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.sub { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-soft); margin: 20px 0 0; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust { margin-top: 17px; font-size: 13.5px; color: var(--muted); }
.trust b { color: var(--ink-soft); font-weight: 600; }

/* ---------- Hero card-match visual ---------- */
.stage { position: relative; height: 420px; }
.pcard {
  position: absolute;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  background: var(--surface);
}
.pcard--scn { width: 262px; top: 14px; left: 4%; transform: rotate(-6deg); overflow: hidden; }
.scn__hd { background: var(--brand); color: #fff; padding: 15px 17px; }
.scn__k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .74; }
.scn__t { font-size: 20px; font-weight: 700; margin-top: 4px; line-height: 1.15; }
.scn__b { padding: 15px 17px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.pcard--tech { width: 236px; right: 3%; bottom: 8px; transform: rotate(5deg); padding: 16px 17px; }
.tech__k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.tech__t { font-size: 20px; font-weight: 700; margin: 4px 0 13px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); color: #fff; }
.chip--health { background: var(--cat-health); }
.chip--independence { background: var(--cat-independence); }
.chip--mobility { background: var(--cat-mobility); }
.chip--memory { background: var(--cat-memory); }
.chip--social { background: var(--cat-social); }
.chip--sustainability { background: var(--cat-sustainability); }
.win {
  position: absolute;
  top: 198px;
  left: 49%;
  transform: translateX(-50%) rotate(-3deg);
  z-index: 3;
  background: var(--sky);
  color: #0d3049;
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  letter-spacing: .01em;
  white-space: nowrap;
}
.spark { position: absolute; inset: 0; z-index: 0; }
.spark span { position: absolute; border-radius: 50%; background: var(--sky); opacity: .45; }
.spark span:nth-child(1) { top: 10%; right: 22%; width: 6px; height: 6px; }
.spark span:nth-child(2) { top: 74%; left: 10%; width: 9px; height: 9px; opacity: .3; }
.spark span:nth-child(3) { top: 44%; right: 6%; width: 4px; height: 4px; }

/* ---------- Sections ---------- */
section.mkt-band { padding: 64px 0; }
.sect-k { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.sect-h { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.015em; margin: 10px 0 0; text-wrap: balance; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.feat__ic {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--hero-ground);
  color: var(--brand);
  margin-bottom: 16px;
}
.feat__ic svg { width: 22px; height: 22px; }
.feat h3 { margin: 0 0 7px; font-size: 18px; font-weight: 700; color: var(--ink); }
.feat p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- Join panel ---------- */
.join {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px 36px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}
.join__t { flex: 1 1 260px; }
.join__t h2 { margin: 0 0 5px; font-size: 22px; font-weight: 800; }
.join__t p { margin: 0; color: #e3def4; font-size: 15px; }
.codeform { display: flex; gap: 10px; flex-wrap: wrap; }
.codeform input {
  font: inherit;
  font-size: 16px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 13px 16px;
  width: 190px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.codeform input::placeholder { color: #c7c0e6; letter-spacing: .08em; }
.codeform .btn--go { background: #fff; color: var(--brand); }
.codeform .btn--go:hover { background: var(--sky); color: #0d3049; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
.about p { color: var(--ink-soft); font-size: 16px; margin: 14px 0 0; max-width: 36em; }
.about h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--ink); }
.quote {
  margin: 22px 0 0;
  padding: 16px 20px;
  border-left: 3px solid var(--sky);
  background: var(--panel);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.quote p { margin: 0; font-size: 15.5px; color: var(--ink); font-style: italic; }
.quote cite { display: block; margin-top: 7px; font-style: normal; font-size: 13px; color: var(--muted); }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.cat {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}
.cat .swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* Narrow single-column band (about page, join-not-found page). */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 0; text-wrap: balance; }
.prose p { color: var(--ink-soft); font-size: 16px; margin: 16px 0 0; }
.prose code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: .95em; }

/* ---------- Footer ---------- */
footer.mkt { border-top: 1px solid var(--line); background: var(--panel); margin-top: 8px; }
.foot { display: flex; align-items: center; gap: 18px; padding: 26px 0; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot a { color: var(--ink-soft); }
.foot .staff { margin-left: auto; font-size: 13px; }
.foot .staff a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__in { grid-template-columns: 1fr; gap: 8px; padding: 48px 0 56px; }
  .stage { height: 360px; margin-top: 20px; }
  .grid3 { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .top nav .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
