/*
  styles.css — Sudoku by Bonendo website

  The same palette, radii and spacing as the app's Theme.swift, so the pages
  read as the app's own: cool grey background, white cards that float on it,
  a coral accent, and a lighter-surface-than-background rule for dark mode.
  Colours are the asset catalog's light and dark values verbatim.
*/

:root {
  --background: #F1F3F8;      /* BoardSurface */
  --surface: #FFFFFF;         /* BoardCard */
  --surface-sunken: #E9ECF4;  /* SurfaceSunken */
  --separator: #E2E6F0;       /* SeparatorLine */
  --text: #161A28;            /* TextPrimary */
  --text-secondary: #6B7186;  /* TextSecondary */
  --text-tertiary: #9198AC;   /* TextTertiary */
  --accent: #CE4130;          /* BrandAccent */
  --accent-fill: #CE4130;     /* AccentFill */
  --on-accent: #FFFFFF;
  --success: #2F7D52;         /* SuccessTint */
  --info: #1F6FBF;            /* InfoTint */
  --warning: #A05F08;         /* WarningTint */
  --hint-panel: #2B3040;      /* HintPanel */
  --hint-target: #E9B949;     /* HintTarget */
  --hint-evidence: #2E86D6;   /* HintEvidence */
  --cell-given: #ECECEF;      /* CellGiven */
  --grid-line: #CFD6E4;       /* GridLine */
  --grid-band: #161A28;       /* GridBand */
  --shadow: rgba(0, 0, 0, 0.06);

  --radius-card: 22px;
  --radius-tile: 14px;
  --radius-control: 16px;
  --space-tight: 8px;
  --space-regular: 12px;
  --space-section: 20px;
  --space-screen: 20px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1E222C;
    --surface: #2B3040;
    --surface-sunken: #262B37;
    --separator: #3B4256;
    --text: #FFFFFF;
    --text-secondary: #9BA2B9;
    --text-tertiary: #6E768F;
    --accent: #FF7A6E;
    --accent-fill: #F4573F;
    --success: #7FC79B;
    --info: #62AFF0;
    --warning: #F5A65B;
    --hint-panel: #171B23;
    --hint-target: #F5A65B;
    --hint-evidence: #62AFF0;
    --cell-given: #171B23;
    --grid-line: #3B4256;
    --grid-band: #9BA2B9;
    --shadow: rgba(0, 0, 0, 0);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Layout ----------------------------------------------------------------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-screen) 64px;
}

.page.wide { max-width: 1040px; }

/* Top bar: the app's tab strip, as a pill of links. */
.nav {
  display: flex;
  justify-content: center;
  padding: var(--space-section) 0;
}

.nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 6px 18px var(--shadow);
}

.nav a {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}

.nav a:hover { text-decoration: none; background: var(--surface-sunken); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--surface-sunken); }

h1 {
  margin: 12px 0 var(--space-section);
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  margin: 36px 0 var(--space-regular);
  font-size: 20px;
  font-weight: 700;
}

h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }

p { margin: 0 0 1em; }
p.lede { font-size: 20px; color: var(--text-secondary); }
.muted { color: var(--text-secondary); }
.small { font-size: 14px; color: var(--text-tertiary); }

/* Cards ------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-section);
  box-shadow: 0 8px 24px var(--shadow);
  margin-bottom: var(--space-regular);
}

.card p:last-child { margin-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-regular);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-regular);
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--space-section);
  box-shadow: 0 8px 24px var(--shadow);
}

.tile p { margin: 0; color: var(--text-secondary); font-size: 15px; }

.tile .icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--info) 14%, transparent);
  color: var(--info);
  font-size: 22px;
}

.tile .icon.accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tile .icon.success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.tile .icon.warning { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }

/* Rows inside a card, like a settings group. */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-regular);
  padding: 14px 0;
  border-top: 1px solid var(--separator);
  min-height: 48px;
}
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row .label { font-weight: 600; }
.row .value { color: var(--text-secondary); text-align: right; }

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 17px;
}
.button:hover { text-decoration: none; filter: brightness(1.05); }
.button.secondary { background: var(--surface-sunken); color: var(--text); }

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

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  margin: 24px 0 40px;
}

.hero .icon-large {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: var(--space-section);
}

.hero h1 { font-size: 48px; }
.hero .actions { display: flex; gap: var(--space-regular); flex-wrap: wrap; margin-top: var(--space-section); }

.phone {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  h1 { font-size: 32px; }
  .phone { max-width: 260px; }
}

/* A hint, drawn the way the app draws it: a dark panel below the board. */
.hint-demo {
  display: grid;
  grid-template-columns: minmax(0, 260px) 1fr;
  gap: var(--space-section);
  align-items: center;
}

@media (max-width: 600px) { .hint-demo { grid-template-columns: 1fr; } }

.mini-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--grid-band);
  padding: 3px;
  border-radius: 8px;
  aspect-ratio: 1;
}

.mini-board .cell {
  display: grid;
  place-items: center;
  background: var(--cell-given);
  font-weight: 600;
  font-size: 26px;
  color: var(--text);
}

.mini-board .cell.empty { background: var(--surface); }
.mini-board .cell.target { background: var(--hint-target); color: #161A28; }
.mini-board .cell.evidence { background: var(--hint-evidence); color: #fff; }

.hint-panel {
  background: var(--hint-panel);
  color: #fff;
  border-radius: var(--radius-card);
  padding: var(--space-section);
}
.hint-panel h3 { color: #fff; text-align: center; }
.hint-panel p { color: rgba(255, 255, 255, 0.78); text-align: center; margin: 0; }
.hint-panel .steps { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hint-panel .steps span {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 600;
}
.hint-panel .steps span.current { background: #E6E8EE; color: #161A28; }

/* Screenshots strip ------------------------------------------------------ */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-regular);
}
.shots img {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Legal text ------------------------------------------------------------- */

.legal h2 { margin-top: 28px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }

.footer {
  margin-top: 56px;
  padding-top: var(--space-section);
  border-top: 1px solid var(--separator);
  display: flex;
  justify-content: space-between;
  gap: var(--space-regular);
  flex-wrap: wrap;
  color: var(--text-tertiary);
  font-size: 14px;
}
.footer a { color: var(--text-secondary); }
