/* All Kings Fall — site styles.
   Palette and block anatomy follow the brand guide v1.0 (see
   TacticsApp/TacticsApp/BrandKit.swift for the same system in SwiftUI):
   flat fills, an ink edge on everything, a hard offset shadow, no blur.
   Gold is the one primary and never a plain surface. */

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/baloo2-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/baloo2-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/nunito-400-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/nunito-400-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #101013;
  --bone: #F4F2EC;
  --bone-shade: #E6E3DB;
  --gold: #F2C528;
  --gold-light: #FFE850;
  --gold-shade: #B8861F;
  --brick: #9B4529;
  --brick-shade: #692F1C;
  --brick-ghost: #F5E5DF;
  --slate: #4D7688;
  --slate-shade: #31515E;
  --slate-ghost: #E4EDF1;
  --night: #22323B;
  --deep: #18282F;
  --grass: #5F7F3C;
  --grass-lip: #8FAE5C;
  --grass-line: #7D9A4F;
  --hill-near: #274049;
  --hill-mid: #2C4A50;
  --hill-far: #31515E;
  --stone: #A8A49B;
  --aside: #8B8B93;
  --threat: #FF8A3D;
  --path: #2FBFD6;
  --heal: #2FA563;

  --display: "Baloo 2", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --edge: 4px;
  --lift: 6px;
  --radius: 16px;
  --gutter: 24px;
  --measure: 62ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--bone);
  background: var(--deep);
}
body.page-light { color: var(--ink); background: var(--bone); }

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6.5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; max-width: var(--measure); }

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.page-light .kicker { color: var(--brick); }

/* Display type wearing the brand's hard ink outline and drop. */
.block-text {
  color: var(--gold);
  -webkit-text-stroke: 0.08em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--ink);
}
.block-text.bone { color: var(--bone); }

/* ---------- Blocks (buttons) ---------- */

.block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  background: var(--bone);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  padding: 0.9em 1.4em;
  box-shadow: 0 var(--lift) 0 var(--ink);
  cursor: pointer;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, background-color 90ms;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.block:hover { background: var(--bone-shade); }
.block:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--ink); }
.block.primary { background: var(--gold); }
.block.primary:hover { background: var(--gold-light); }
.block.primary:active { background: var(--gold-shade); }
.block.tertiary { background: var(--night); color: var(--bone); }
.block.tertiary:hover { background: var(--hill-mid); }
.block.tertiary:active { background: var(--deep); }
.block[disabled] { background: #3A3A42; color: #6B6B74; border-color: #6B6B74; box-shadow: none; transform: translateY(var(--lift)); cursor: default; }

/* ---------- Panels ---------- */

.panel {
  background: var(--night);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 var(--lift) 0 var(--ink);
  padding: 26px;
}
.panel.bone { background: var(--bone); color: var(--ink); }
.panel.brick { background: var(--brick); color: var(--brick-ghost); }
.panel.slate { background: var(--slate); color: var(--slate-ghost); }

/* ---------- Top bar ---------- */

.topbar { padding-block: 22px 8px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.wordmark svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 6px 22px; flex-wrap: wrap; font-weight: 700; font-size: 0.95rem; }
.nav a { text-decoration: none; opacity: 0.85; }
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 3px; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding-block: 40px 96px; }
.hero .wrap {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-copy { display: grid; gap: 22px; }
.hero-copy h1 { max-width: 12ch; }

/* The battlefield's rolling hills, as three stepped bands. */
.hills { position: absolute; inset: auto 0 0 0; height: 62%; pointer-events: none; }
.hills span { position: absolute; left: -10%; right: -10%; bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.hills .far  { height: 100%; background: var(--hill-far); left: -30%; right: 20%; }
.hills .mid  { height: 72%; background: var(--hill-mid); left: 10%; right: -35%; }
.hills .near { height: 42%; background: var(--hill-near); }
.hills .ground { height: 40px; border-radius: 0; background: var(--grass); border-top: 6px solid var(--grass-lip); left: 0; right: 0; }

/* ---------- Signup ---------- */

.signup { display: grid; gap: 12px; }
.signup form { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.signup input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--bone);
  background: var(--deep);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  padding: 0 18px;
  height: 62px;
  caret-color: var(--gold);
}
.signup input[type="email"]::placeholder { color: rgba(228, 237, 241, 0.4); }
.signup .block { height: 62px; padding-block: 0; flex: 0 0 auto; }
.signup .fine { font-size: 0.9rem; color: rgba(228, 237, 241, 0.7); }
.signup .fine a { color: inherit; }
.signup .status { font-weight: 700; }
.signup .status.ok { color: var(--gold-light); }
.signup .status.bad { color: var(--threat); }
/* Honeypot: off-canvas, never for people. */
.signup .nope { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Board scene ---------- */

.scene { display: grid; gap: 14px; justify-items: center; }
.board {
  --tile: clamp(34px, 5vw, 52px);
  display: grid;
  grid-template-columns: repeat(9, var(--tile));
  grid-template-rows: repeat(5, var(--tile));
  gap: 0;
  padding: 10px;
  background: var(--grass-line);
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 8px 0 var(--ink);
  position: relative;
}
.board .t { background: var(--grass); outline: 2px solid var(--grass-line); outline-offset: -1px; position: relative; }
.board .t.deploy { background: var(--grass-lip); background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(16,16,19,0.08) 6px 8px); }
.board .t.center { box-shadow: inset 0 0 0 3px rgba(242, 197, 40, 0.35); }
.board .t.marked { background: var(--threat); }
.board .t.path { background: var(--path); }
.board .t.cursor { box-shadow: inset 0 0 0 4px var(--gold); z-index: 2; }
.board .t .badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 24px; height: 24px; padding-inline: 5px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 0.85rem; line-height: 1;
  color: var(--bone); background: var(--ink); border-radius: 999px;
  border: 2px solid var(--bone);
  z-index: 3;
}
.board .piece {
  position: absolute; inset: -22% -6% 2% -6%;
  z-index: 2;
  pointer-events: none;
}
.board .piece img { width: 100%; height: 100%; object-fit: contain; }
.board .piece.flip img { transform: scaleX(-1); }
.board .t.shadow::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 8%; height: 18%; background: rgba(16,16,19,0.28); border-radius: 50%; }

@keyframes tick { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.board .t.marked .badge { animation: tick 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .board .t.marked .badge { animation: none; } }

.scene .caption { font-size: 0.9rem; color: rgba(228, 237, 241, 0.75); text-align: center; max-width: 34ch; }
.scene .caption b { color: var(--threat); }

/* ---------- Sections ---------- */

.section { padding-block: 72px; }
.section-head { display: grid; gap: 10px; margin-bottom: 36px; max-width: var(--measure); }

.beats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.beat { display: grid; gap: 12px; align-content: start; }
.beat .kicker { color: var(--gold); }
.beat p { color: rgba(228, 237, 241, 0.82); }

.rosters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.roster { display: grid; gap: 14px; align-content: start; }
.roster ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roster li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: baseline; }
.roster li b { font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.roster li .glyph {
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  color: var(--ink); background: var(--bone); border: 3px solid var(--ink); border-radius: 8px;
}
.roster p { color: rgba(228, 237, 241, 0.82); }

.wins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.wins .panel { display: grid; gap: 10px; align-content: start; }
.wins .panel p { opacity: 0.9; }

.cta { padding-block: 24px 88px; }
.cta .panel { display: grid; gap: 18px; justify-items: start; }
.cta .panel h2 { max-width: 16ch; }

/* ---------- Footer ---------- */

.footer { border-top: var(--edge) solid var(--ink); padding-block: 28px 40px; font-size: 0.9rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { text-decoration: none; opacity: 0.85; }
.footer a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.page-light .footer { border-color: var(--bone-shade); }

/* ---------- Documents (privacy, support, thanks) ---------- */

.doc { padding-block: 32px 80px; }
.doc .wrap { max-width: 820px; }
.doc header { display: grid; gap: 12px; margin-bottom: 40px; }
.doc .meta { font-weight: 600; color: var(--aside); }
.doc h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 56px; padding-top: 28px; border-top: var(--edge) solid var(--ink); }
.doc h2.part { border: 0; padding-top: 0; }
.doc h3 { font-size: 1.3rem; margin-top: 32px; }
.doc h2 + h3 { margin-top: 20px; }
.doc p, .doc ul { max-width: var(--measure); margin-top: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc .summary { background: var(--bone-shade); border: var(--edge) solid var(--ink); border-radius: 18px; padding: 24px 26px; margin-top: 24px; box-shadow: 0 var(--lift) 0 var(--ink); }
.doc .summary p { max-width: none; }
.doc .summary p + p { margin-top: 12px; }
.doc address { font-style: normal; margin-top: 14px; line-height: 1.5; }
.doc hr { border: 0; border-top: 2px dashed var(--stone); margin: 48px 0 0; }
.page-light .doc a { color: var(--brick); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.thanks .wrap { display: grid; gap: 22px; max-width: 720px; justify-items: start; }
.thanks h1 { max-width: 14ch; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy h1 { max-width: none; }
  .beats { grid-template-columns: 1fr; }
  .rosters, .wins { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  :root { --gutter: 16px; }
  .board { --tile: calc((100vw - 2 * var(--gutter) - 20px - 8px) / 9); }
  .signup .block { flex: 1 1 100%; }
}

.kicker.gold { color: var(--gold); }
