/* worder — marketing site
   Palette + type lifted straight from the app's Theme.swift so the web
   feels like the game: warm editorial cream, deep green, royal-order tints. */

:root {
  --bg: #faf5eb;
  --surface: #ffffff;
  --ink: #211f1c;
  --ink-soft: #6b665e;
  --ink-faint: #b8b2a8;
  --accent: #1e7a60;
  --accent-ink: #ffffff;
  --accent-soft: #dbede6;
  --gold: #d9a638;
  --tile: #ffffff;
  --tile-stroke: #d9d1c2;
  --hairline: #e7ded0;
  --shadow: rgba(40, 35, 25, 0.10);
  --shadow-lift: rgba(40, 35, 25, 0.18);

  /* Royal-order category tints (identical in both modes) */
  --c-opinion: #d96b4d;
  --c-size: #e6a838;
  --c-age: #b89933;
  --c-shape: #66a35c;
  --c-colour: #409e8c;
  --c-origin: #4c8ac7;
  --c-material: #8576c7;
  --c-purpose: #c76b9e;

  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino,
           "Book Antiqua", Georgia, serif;
  --sans: -apple-system, "SF Pro Rounded", ui-rounded, system-ui,
          "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #212126;
    --ink: #f5f2eb;
    --ink-soft: #a8a69e;
    --ink-faint: #4d4d54;
    --accent: #4ac28b;
    --accent-ink: #0c1712;
    --accent-soft: #23392f;
    --gold: #f2c75c;
    --tile: #2e2e33;
    --tile-stroke: #4d4d54;
    --hairline: #2b2b30;
    --shadow: rgba(0, 0, 0, 0.35);
    --shadow-lift: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  display: block;
}
.topbar nav a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-left: 22px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 40px 0 24px; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 22px;
  max-width: 16ch;
}
.hero p.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 34px;
}

/* ---------- Animated board ---------- */
.stage {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 28px;
  padding: 40px 24px 32px;
  box-shadow: 0 18px 48px var(--shadow);
  margin: 8px 0 20px;
}
.stage-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 26px;
  height: 1em;
  transition: color 0.4s ease;
}
.stage-label.solved { color: var(--accent); }

.board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 10px;
  min-height: 96px;
}
.article, .noun {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5vw, 2.3rem);
  color: var(--ink);
}
.article { font-style: italic; color: var(--ink-soft); }
.noun { font-weight: 700; }

.tiles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 10px;
}

.tile {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--serif);
  line-height: 1;
  color: var(--ink);
  background: var(--tile);
  border: 2px solid var(--tile-stroke);
  border-radius: 16px;
  padding: 0.42em 0.72em 0.46em;
  box-shadow: 0 6px 16px var(--shadow);
  transition: border-color 0.45s cubic-bezier(.22,1,.36,1);
  will-change: transform;
  cursor: grab;
  user-select: none;
}
.tile.lift {
  box-shadow: 0 16px 32px var(--shadow-lift);
  z-index: 3;
}
.tile .word {
  font-size: clamp(1.4rem, 5vw, 2.3rem);
  line-height: 1.05;
}
.tile.solved { border-color: var(--tint, var(--tile-stroke)); }
.tile .cat {
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tint, var(--ink-faint));
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}
.tile.solved .cat { max-height: 1.4em; opacity: 1; margin-top: 0.36em; }

/* ---------- Buttons ---------- */
.cta-row {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; align-items: center;
  margin-top: 10px;
}
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 15px 26px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--tile-stroke);
}
.btn-ghost:hover { border-color: var(--ink-soft); text-decoration: none; }
.cta-note { font-size: 0.85rem; color: var(--ink-faint); margin-top: 16px; }

.badge-link {
  display: inline-flex;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.badge-link:hover { transform: translateY(-2px); text-decoration: none; }
.appstore-badge { height: 54px; width: auto; display: block; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; border-top: 1px solid var(--hairline); }
section.block h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
section.block p.sub {
  color: var(--ink-soft);
  max-width: 54ch;
  margin: 0 0 30px;
  font-size: 1.08rem;
}

/* royal-order chips */
.order-rail {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tint); }
.chip .arrow { color: var(--ink-faint); }

/* screenshots */
.shots {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.shots img {
  width: 250px;
  max-width: 42vw;
  height: auto;
  border-radius: 30px;
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 60px var(--shadow);
}

/* how-to cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 24px;
}
.card .num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Legal pages ---------- */
.legal { padding: 30px 0 60px; }
.legal h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 0 0 6px;
}
.legal .updated { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 34px; }
.legal h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 34px 0 10px;
}
.legal p, .legal li { color: var(--ink); }
.legal p { margin: 0 0 14px; }
.legal ul { padding-left: 20px; margin: 0 0 16px; }
.legal li { margin-bottom: 8px; }
.legal a { text-decoration: underline; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 34px 0 46px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.foot-links a { color: var(--ink-soft); margin-right: 20px; }

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }

  /* Stack the header: logo/title on top, nav links in a centered row below. */
  .topbar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 0 14px;
  }
  .topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
  }
  .topbar nav a { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile::after, .tile .cat { transition: none !important; }
}
