/* 6doku.com. Colors and type follow the app (iOS/Sixdoku/Theme.swift):
   paper, board, ink and persimmon, in SF Pro Rounded where the system has it. */

:root {
  color-scheme: light dark;
  --paper: #f3efe7;
  --board: #fffdf9;
  --ink: #24232b;
  --ink-soft: #7a7580;
  --grid-thin: #e6e0d5;
  --grid-thick: #4a4752;
  --accent: #f15a1e;
  /* The deeper orange the app uses for Increase Contrast: readable as text. */
  --accent-text: #b9400a;
  --on-accent: #ffffff;
  --card: #fffdf9;
  --rule: #e6e0d5;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@supports (color: color(display-p3 1 1 1)) {
  :root {
    --accent: color(display-p3 0.95 0.36 0.10);
    --accent-text: color(display-p3 0.74 0.25 0.04);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141416;
    --board: #1e1e22;
    --ink: #edebe6;
    --ink-soft: #9a97a0;
    --grid-thin: #303036;
    --grid-thick: #8e8b96;
    --accent: #ff8038;
    --accent-text: #ff9e66;
    --on-accent: #141416;
    --card: #1e1e22;
    --rule: #303036;
  }
  @supports (color: color(display-p3 1 1 1)) {
    :root {
      --accent: color(display-p3 1 0.50 0.22);
      --accent-text: color(display-p3 1 0.62 0.40);
    }
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); margin: 0 0 0.4em; }
h2 { font-size: 1.35rem; margin: 2em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 1.6em 0 0.3em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
strong { font-weight: 700; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 680px; }
@media (min-width: 600px) { .wrap { padding: 0 28px; } }

/* Header and footer */

.site-header { padding: 18px 0 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-nav { display: flex; gap: 18px; font-size: 0.95rem; font-weight: 600; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

.site-footer { margin-top: 72px; padding: 24px 0 40px; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--ink-soft); }

/* The wordmark: a tall persimmon 6, cut off flat at the baseline, then
   "doku", as the app's title logo draws it (Wordmark.swift). */

.wordmark {
  display: inline-flex;
  align-items: flex-end;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.015em;
}
.wordmark .six {
  display: inline-block;
  color: var(--accent);
  font-size: 1.35em;
  line-height: 1;
  /* Drop the 6 below the line and cut it there, through the bottom of its loop. */
  height: 0.79em;
  overflow: hidden;
  margin-bottom: 0.03em;
}
.wordmark .six span { display: block; transform: translateY(-0.04em); }

/* Landing */

.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 48px 0 8px;
}
@media (min-width: 820px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; gap: 56px; padding-top: 72px; }
}
.hero .icon { width: 96px; height: 96px; border-radius: 22.37%; display: block; margin-bottom: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px rgb(0 0 0 / 0.08); }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 32em; }
.lede strong { color: var(--ink); }

.features { display: grid; gap: 16px; margin: 56px 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li { background: var(--card); border-radius: 18px; padding: 20px 22px; margin: 0; }
.features h3 { margin: 0 0 0.35em; }
.features p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* Coming soon / download. site.js swaps in the App Store link once there is one. */

.get { margin: 28px 0 0; }
.soon {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 14px;
  background: var(--card); color: var(--ink); font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--rule);
}
.soon::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.store-button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
}
.get .note { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 0.92rem; }

/* The board, drawn as the app draws it (BoardView.swift): givens in ink,
   your digits in persimmon, the selected cell outlined, its row, column
   and box lightly tinted and every matching digit tinted more. */

.board-wrap { width: 100%; max-width: 400px; margin: 0 auto; }
.board {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  aspect-ratio: 1;
  background: var(--board);
  border: 2px solid var(--grid-thick);
  border-radius: 5%;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 16px 40px rgb(0 0 0 / 0.08);
}
.cell {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 9vw;
  font-size: calc(100cqi / 6 * 0.54);
  font-weight: 400;
  color: var(--accent);
  border-right: 1px solid var(--grid-thin);
  border-bottom: 1px solid var(--grid-thin);
  font-variant-numeric: tabular-nums;
}
.cell.given { color: var(--ink); font-weight: 600; }
.cell:nth-child(6n) { border-right: 0; }
.cell:nth-child(6n + 3) { border-right: 2px solid var(--grid-thick); }
.cell:nth-child(n + 7):nth-child(-n + 12),
.cell:nth-child(n + 19):nth-child(-n + 24) { border-bottom: 2px solid var(--grid-thick); }
.cell:nth-child(n + 31) { border-bottom: 0; }
.cell.rel { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cell.match { background: color-mix(in srgb, var(--accent) 17%, transparent); }
.cell.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cell.sel::after {
  content: ""; position: absolute; inset: 1px;
  border: 2.5px solid var(--accent); border-radius: 6px;
}
.notes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: 100%; height: 100%; padding: 12% 8%;
  font-size: calc(100cqi / 6 * 0.21); font-weight: 600; color: var(--ink-soft);
}
.notes i { font-style: normal; display: grid; place-items: center; }

/* Link pages */

.link-page { padding-top: 48px; text-align: center; }
.link-page .icon { width: 88px; height: 88px; border-radius: 22.37%; margin: 0 auto 20px; display: block; }
.link-page h1 { margin-bottom: 0.25em; }
.link-page .date { color: var(--ink-soft); font-weight: 600; margin-bottom: 1.4em; }
.link-page .lede { margin-left: auto; margin-right: auto; }
.link-page .board-wrap { max-width: 280px; margin-top: 36px; }
.level { color: var(--accent-text); }

/* Text pages */

.doc { padding-top: 40px; }
.doc .updated { color: var(--ink-soft); font-size: 0.95rem; }
.doc li::marker { color: var(--ink-soft); }
.callout { background: var(--card); border-radius: 18px; padding: 18px 22px; margin: 1.5em 0; }
.callout p:last-child { margin-bottom: 0; }
.faq h2 { font-size: 1.15rem; }

.not-found { padding-top: 72px; text-align: center; }
.not-found .big { font-size: 5rem; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 12px; }
.not-found .lede { margin: 0 auto 1.5em; }
