/*
 * The home page only. The policy pages keep style.css, so nothing here can
 * reach them and nothing there fights with this.
 *
 * Every colour is lifted from the app itself — BoardColors.kt and
 * ColorSchemes.kt — rather than picked to look like it, down to the highlight
 * yellow the board paints under a moved piece.
 *
 * No external requests: no webfont, no icon set, no analytics. Same rule the
 * apps follow, which is why the pieces here are the apps' own SVG paths,
 * inlined, and the boards are drawn in CSS rather than photographed.
 */

:root {
  /* ColorSchemes.kt, Modern light */
  --ground: #f6fbf5;
  --panel: #ffffff;
  --ink: #171d19;
  --ink-soft: #414a43;
  --green: #2f6b4f;
  --green-edge: #1c4331;
  --rule: #ccd6cd;

  /* BoardColors.kt — the Modern squares, used for the rank and the mark */
  --light-square: #edf0f2;
  --dark-square: #6e9e7b;

  /* The board's own highlight, under a piece that just moved */
  --gold: #ffd24a;
  --gold-edge: #d9a900;

  /* The app's tinted coach card, and its one red */
  --coach-bg: #b4f0cc;
  --coach-ink: #00210f;
  --blunder: #ba1a1a;

  /* ColorSchemes.kt, Modern dark — the inverted section */
  --deep: #0f1511;
  --on-deep: #dfe4de;
  --deep-green: #99d4b1;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  /* Rounded where the platform has one. A chess tutor for six-year-olds should
     not be set in the same face as a bank statement. */
  --display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", Roboto,
             system-ui, sans-serif;
  /* One job only: the app's own voice. Where you see the serif, the app is
     speaking. Everywhere else is us speaking about the app. */
  --voice: ui-serif, Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 34rem;
  --wide: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1511;
    --panel: #18211b;
    --ink: #dfe4de;
    --ink-soft: #b6c0b8;
    --green: #99d4b1;
    --green-edge: #4e8a6b;
    --rule: #334036;
    --coach-bg: #135138;
    --coach-ink: #d6f5e3;
    --blunder: #ffb4ab;
    /* The inverted section inverts the other way, so it still reads as a change
       of ground rather than vanishing into the page. */
    --deep: #edf0f2;
    --on-deep: #171d19;
    --deep-green: #2f6b4f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.62 var(--sans);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.022em; line-height: 1.08; }

.sprite { position: absolute; width: 0; height: 0; }

.pc { width: 1em; height: 1em; fill: currentColor; display: block; }

/* ---------------------------------------------------------- the buttons - */
/* The bottom edge is the whole trick: it makes the button look like a thing
   you press rather than a rectangle you click, and it is what every game on a
   phone does. Pressing moves the face down onto the edge. */

.btn {
  --edge: var(--green-edge);
  display: inline-block;
  padding: 13px 26px;
  border-radius: 16px;
  background: var(--green);
  color: #ffffff;
  text-decoration: none;
  line-height: 1.2;
  font-family: var(--display);
  box-shadow: 0 5px 0 var(--edge);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--edge); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }

.btn-lead { display: block; font-size: 0.76rem; font-weight: 500; opacity: 0.9; }
.btn strong { display: block; font-size: 1.14rem; font-weight: 700; letter-spacing: -0.015em; }

.btn-small { padding: 9px 18px; font-weight: 700; font-size: 0.95rem; box-shadow: 0 4px 0 var(--edge); }
.btn-small:active { transform: translateY(4px); }

/* Not out yet, so it is a label, not a link that goes nowhere. */
.btn-ghost {
  --edge: var(--rule);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: default;
}
.btn-ghost:hover { transform: none; box-shadow: 0 5px 0 var(--edge); }
.btn-ghost:active { transform: none; box-shadow: 0 5px 0 var(--edge); }

/* ------------------------------------------------------------- the bar -- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  max-width: var(--wide);
  margin: 0 auto;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* Four squares off a board, at the size of a favicon. */
.mark-square {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background:
    conic-gradient(var(--dark-square) 25%, var(--light-square) 0 50%,
                   var(--dark-square) 0 75%, var(--light-square) 0);
  background-size: 50% 50%;
}

/* ------------------------------------------------------------ the hero -- */

.hero {
  max-width: 54rem;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--gutter) 0;
  text-align: center;
}

.flag {
  display: inline-block;
  margin: 0 0 22px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: #3b2d00;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.92rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  font-weight: 800;
  text-wrap: balance;
  margin-bottom: 20px;
}

.hero-sub {
  max-width: 38rem;
  margin: 0 auto 34px;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  text-wrap: pretty;
}

/* The app's coach card, rebuilt in the app's colours. It is the one thing no
   competitor's page can show, so it gets the middle of the hero. */
.coach {
  max-width: 34rem;
  margin: 0 auto 14px;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--coach-bg);
  color: var(--coach-ink);
  text-align: left;
}

.coach figcaption {
  font-family: var(--display);
  font-weight: 800;
  color: var(--blunder);
  margin-bottom: 6px;
}

.coach p {
  margin: 0;
  font-family: var(--voice);
  font-size: 1.2rem;
  line-height: 1.46;
}

.coach-note { margin: 0 0 30px; font-size: 0.95rem; color: var(--ink-soft); }

.stores { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* Three screens, fanned, the important one in front and upright. */
.fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(-40px, -3vw, 0px);
  margin-top: clamp(44px, 6vw, 72px);
  padding-bottom: 8px;
}

.fan img {
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(12, 32, 22, 0.16);
}

.fan-main { width: min(280px, 46vw); position: relative; z-index: 2; }

.fan-side {
  width: min(232px, 38vw);
  z-index: 1;
  opacity: 0.96;
}

.fan-side:first-child { transform: rotate(-6deg) translateX(26px); transform-origin: bottom right; }
.fan-side:last-child { transform: rotate(6deg) translateX(-26px); transform-origin: bottom left; }

/* ------------------------------------------------------------- the rank - */
/* Four squares of a rank, each holding one number, each marked with the piece
   the app already uses for that part of itself. */

.rank {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--rule);
  margin-top: clamp(20px, 4vw, 44px);
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 26px 12px;
  background: var(--light-square);
  color: #171d19;
}

.cell:nth-child(even) { background: var(--dark-square); }

.cell .pc { font-size: 26px; margin-bottom: 6px; opacity: 0.9; }

.cell strong {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cell span { font-size: 0.84rem; color: #26312b; }

/* --------------------------------------------------------------- demo --- */
/* The recorded loops. Cropped to the board and the coach card, because a whole
   phone at this width makes the sentence — the entire point — unreadable. */

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 88px) var(--gutter);
}

.demo-words h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; margin-bottom: 16px; }
.demo-words p { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 14px; }
.demo-note { font-size: 0.92rem; opacity: 0.8; }

.demo-shot { margin: 0; }

.demo-shot img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(12, 32, 22, 0.16);
}

/* ----------------------------------------------------------- features --- */

main { display: block; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 88px) var(--gutter);
}

.feature + .feature { border-top: 1px solid var(--rule); }

/* Flipped rows swap the columns as well as the order, or the screenshot would
   land in the column sized for the prose. */
.feature-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
.feature-flip .feature-shot { order: 2; }

.feature-shot { margin: 0; }

.feature-shot img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(12, 32, 22, 0.12);
  margin-inline: auto;
}

/* A crop of the board and the card above it reads at a smaller size than a
   whole phone does, so the two get different widths. */
.shot-board { width: min(340px, 100%); margin-inline: auto; }
.shot-phone { width: min(270px, 100%); margin-inline: auto; }

.feature-words h2 { font-size: clamp(1.6rem, 3.3vw, 2.5rem); font-weight: 800; margin-bottom: 16px; }
.feature-words p { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 14px; }
.feature-words em { color: var(--ink); font-style: italic; }

/* The app speaking, so the app's voice. */
.said {
  font-family: var(--voice);
  font-size: 1.28rem;
  line-height: 1.45;
  color: var(--ink) !important;
  border-left: 4px solid var(--dark-square);
  padding-left: 18px;
  margin-top: 22px !important;
}

/* ------------------------------------------ what is not in the app ------ */

.quiet { background: var(--deep); color: var(--on-deep); }

.quiet-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 92px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

/* The claim on the left, the evidence for it on the right. */
.quiet-claim { align-self: center; }

.quiet h2 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); font-weight: 800; margin-bottom: 18px; }
.quiet-lede { max-width: var(--measure); font-size: 1.1rem; margin: 0 0 26px; opacity: 0.88; }

.absent { list-style: none; padding: 0; margin: 0; }

.absent li {
  padding: 13px 0 13px 36px;
  border-top: 1px solid color-mix(in srgb, var(--on-deep) 20%, transparent);
  position: relative;
}

.absent li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--on-deep) 20%, transparent); }

/* An empty square: the thing that is not there. */
.absent li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--deep-green);
  border-radius: 4px;
}

.quiet-foot { max-width: var(--measure); opacity: 0.78; margin: 26px 0 0; }

/* ---------------------------------------------------------------- skins - */

.skins {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 88px) var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.skins h2 { font-size: clamp(1.6rem, 3.3vw, 2.5rem); font-weight: 800; margin-bottom: 16px; }
.skins p { max-width: var(--measure); color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------------ faq - */

.faq { max-width: var(--wide); margin: 0 auto; padding: clamp(52px, 7vw, 88px) var(--gutter); }
.faq > h2 { font-size: clamp(1.6rem, 3.3vw, 2.5rem); font-weight: 800; margin-bottom: 32px; }

/* Columns rather than a grid: grid rows would all take the height of the
   tallest answer in the row and leave gaps under the short ones. */
.qa-grid { columns: 2; column-gap: clamp(32px, 5vw, 64px); }
.qa { break-inside: avoid; }
.qa { padding: 22px 0; border-top: 1px solid var(--rule); }
.qa h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.qa p { margin: 0; color: var(--ink-soft); max-width: var(--measure); }

/* ---------------------------------------------------------------- close - */

.close {
  text-align: center;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.close h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 28px;
  text-wrap: balance;
}

/* --------------------------------------------------------------- footer - */

footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 26px var(--gutter) 48px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

footer a { margin-right: 20px; color: var(--ink-soft); }

/* ------------------------------------------------------------- narrow --- */

@media (max-width: 880px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
  .demo-shot { order: 2; max-width: 440px; margin-inline: auto; }

  .quiet-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .qa-grid { columns: 1; }

  .feature,
  .feature-flip,
  .skins { grid-template-columns: minmax(0, 1fr); }

  /* The screenshot follows the words it illustrates, on every row. */
  .feature-shot,
  .feature-flip .feature-shot { order: 2; }

  .rank { grid-template-columns: repeat(2, 1fr); }
  /* Two columns would stripe on the odd/even rule, so the second row flips. */
  .rank .cell:nth-child(3) { background: var(--dark-square); }
  .rank .cell:nth-child(4) { background: var(--light-square); }
}

@media (max-width: 620px) {
  /* The fan collapses to the one screen that carries the pitch. */
  .fan-side { display: none; }
  .fan-main { width: min(300px, 74vw); }
  .stores { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
  .coach p { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}
