/* Palette mirrors core/ui/palette.gd and the app icon (assets/icons/app_icon.png):
   a saturated blue field, yellow-to-orange lettering, every shape held by a thick
   deep-navy outline. docs/design/STYLE.md describes the same "sticker" language for
   the game's own screens; keep this file and Palette in step when either changes. */
@font-face {
  font-family: "Paytone One";
  src: url("../assets/fonts/paytone-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #14286E;
  --navy-fill: #1F3B94;
  --blue: #3D8BFD;
  --blue-deep: #0056DF;
  --blue-bright: #059DF9;
  --yellow: #FFC93C;
  --orange: #FF8C42;
  --purple: #9B5DE5;
  --green: #4CD964;
  --ink: #2B2B2B;
  --bg: #FFF6E9;
  --card-bg: #FFFFFF;
  /* Text laid straight on --bg or on a card: headings, links, small print.
     They swap in the dark theme below; the outlines, lips, accents and the
     hero stay as they are, because they were made to hold on any ground. */
  --head: var(--navy);
  --link: var(--navy-fill);
  --muted: #555;
  color-scheme: light dark;
  --radius: 22px;
  --border: 4px;
  --lip: 6px;
  --display: "Paytone One", "Arial Rounded MT Bold", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark system theme: the game does the same with Palette.NIGHT / Palette.MOONLIGHT
   (core/ui/app_theme.gd); keep the three colours in step with it. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101733;
    --ink: #F4EFE6;
    --card-bg: #19224D;
    --head: #FFF6E9;
    --link: #8DB4FF;
    --muted: #B9B4C9;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--link);
}

/* White lettering held by a navy outline, the way the icon's lettering is held.
   paint-order puts the stroke behind the fill so the outline grows outward and
   never eats into the glyphs; the text-shadow is the fallback for the rare
   browser without it. */
.outlined {
  color: #fff;
  -webkit-text-stroke: 0.2em var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--navy);
}

/* Header */
.site-header {
  padding: 14px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  border-radius: 9px;
  display: block;
  filter: drop-shadow(0 2px 0 var(--navy));
}

.brand-name {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--head);
}

/* Hero: the icon's blue field, with the speed lines that fan out behind its
   lettering. Kept to the deeper half of the icon's gradient so white text on it
   stays readable; the bright blue lives in the glow behind the logo. */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 44px 0 64px;
  border-top: var(--border) solid var(--navy);
  border-bottom: var(--border) solid var(--navy);
  background:
    radial-gradient(ellipse 60% 50% at 50% 26%, rgba(5, 157, 249, 0.85), rgba(5, 157, 249, 0) 70%),
    repeating-conic-gradient(from 0deg at 50% 30%, rgba(255, 255, 255, 0.07) 0deg 7deg, rgba(255, 255, 255, 0) 7deg 14deg),
    linear-gradient(180deg, var(--blue-deep), #0068E6);
}

.hero-inner {
  position: relative;
  text-align: center;
}

/* Stacked drop-shadows trace the icon's own alpha, so the outline follows its
   rounded transparent corners exactly (a CSS border would be a guess at the
   radius and leave slivers of blue at the corners). */
.hero-logo {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 28px;
  display: block;
  filter:
    drop-shadow(4px 0 0 var(--navy))
    drop-shadow(-4px 0 0 var(--navy))
    drop-shadow(0 4px 0 var(--navy))
    drop-shadow(0 -4px 0 var(--navy))
    drop-shadow(0 12px 0 var(--navy));
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.6vw, 2.7rem);
  line-height: 1.15;
  margin: 0 0 18px;
}

.tagline {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(20, 40, 110, 0.55);
}

.cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Primary call-to-action: playable right now, unlike the store badge below it,
   which is a future placeholder. Built like the game's PlayfulButton: an accent
   fill, a navy border, a hard navy lip underneath that the button sinks into
   when pressed. Hover deliberately does nothing of its own, as in the game --
   on a phone a finger leaves the emulated hover stuck on. */
.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 38px;
  border-radius: 999px;
  background: var(--yellow);
  border: var(--border) solid var(--navy);
  box-shadow: 0 var(--lip) 0 var(--navy);
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.2;
  text-decoration: none;
  color: #fff;
  -webkit-text-stroke: 0.2em var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 0.08em 0 var(--navy);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.play-cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--navy);
}

.play-cta:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

/* The play glyph is drawn, not typed: Paytone One has no U+25B6, and a fallback
   font would make the arrow differ from machine to machine. */
.play-cta .play-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.55em 0 0.55em 0.9em;
  border-color: transparent transparent transparent #fff;
  filter:
    drop-shadow(2px 0 0 var(--navy))
    drop-shadow(-2px 0 0 var(--navy))
    drop-shadow(0 2px 0 var(--navy))
    drop-shadow(0 -2px 0 var(--navy));
  -webkit-text-stroke: 0;
}

/* The secondary treatment (PlayfulButton.apply_secondary): not an action, so no
   accent fill and no lip -- just an outlined pill. */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border-radius: 999px;
  background: rgba(20, 40, 110, 0.35);
  border: 3px solid var(--navy);
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

/* Features */
.features {
  padding: 60px 0 76px;
}

.features h2 {
  font-family: var(--display);
  font-weight: 400;
  text-align: center;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  color: var(--head);
  margin: 0 0 36px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px 22px;
}

/* A card is a sticker: navy border, hard navy lip, and an accent tab on top.
   The tab cycles through the game's own accents (orange, blue, purple, green,
   yellow); none of them is RED, which the game reserves for wrong-answer
   feedback. */
.feature-card {
  --accent: var(--orange);
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: var(--border) solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 var(--lip) 0 var(--navy);
  padding: 34px 24px 22px;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--accent);
  border-bottom: 3px solid var(--navy);
}

.feature-card:nth-child(5n + 2) { --accent: var(--blue); }
.feature-card:nth-child(5n + 3) { --accent: var(--purple); }
.feature-card:nth-child(5n + 4) { --accent: var(--green); }
.feature-card:nth-child(5n + 5) { --accent: var(--yellow); }

.feature-card h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--head);
}

.feature-card p {
  margin: 0;
  font-size: 0.97rem;
}

/* Footer */
.site-footer {
  padding: 24px 0 40px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--head);
}

.site-footer a {
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .play-cta {
    transition: none;
  }
}

/* Narrow phones: keep the call-to-action on one line. */
@media (max-width: 420px) {
  .play-cta {
    padding: 12px 24px;
    font-size: 1.2rem;
    gap: 10px;
  }
}
