/* Kuzushi — site styles.
   No build step, no external fonts, no third-party anything: the same rule the
   app itself keeps. The palette is the app's own (static/style.css), so the
   site and the thing it describes look like one product.

   Dark is the app's identity and this site's default. A light scheme is
   provided for people whose OS asks for one — the same variables, retuned. */

:root {
  color-scheme: dark light;

  --bg: #0f1115;
  --bg-lift: #151821;
  --fg: #f3f4f6;
  --muted: #9aa0aa;
  --field: #1a1d24;
  --border: #2a2f3a;

  /* The site's accent is the app ICON's violet, not the app UI's blue: the
     icon is what somebody sees first, on a store listing and a home screen. */
  --accent: #a294e8;
  --accent-deep: #6f62a4;

  /* Inside the board illustration, colour carries meaning and must stay the
     app's own: the armed chip is the app's blue, Say neutral, Ask green,
     Neg red, openers violet. Changing these would misdescribe the product. */
  --app-accent: #4f8cff;
  --ask: #3fb950;
  --neg: #ff6b6b;
  --opener: #a78bfa;
  --clear: #e3b341;

  --measure: 34rem;
  --radius: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfd;
    --bg-lift: #ffffff;
    --fg: #16181d;
    --muted: #5c626e;
    --accent: #57499a;
    --accent-deep: #6f62a4;
    --field: #ffffff;
    --border: #dcdfe6;
    --app-accent: #1a5fd0;
    --ask: #1a7f37;
    --neg: #c8412f;
    --opener: #6c46c4;
    --clear: #8a6400;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

/* --- Skip link: the first tab stop on every page ------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip:focus { left: 0; }

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

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

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header -------------------------------------------------------------- */
.site-head {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.05rem;
}
.brand svg { display: block; }
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: clamp(2.5rem, 8vw, 5rem) 0 1rem;
}
.hero-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 700;
}
.lede {
  font-size: clamp(1.08rem, 2.4vw, 1.25rem);
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 1.5rem;
}
.lede strong { color: var(--fg); font-weight: 600; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  margin-bottom: 1.4rem;
}

/* --- Store badges (placeholders until the listings exist) ---------------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  cursor: default;
}
.badge svg { flex: none; }
.badge b {
  color: var(--fg);
  font-weight: 600;
  display: block;
  font-size: 0.98rem;
  line-height: 1.2;
}
.badge span {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
  max-width: var(--measure);
}

/* --- The board illustration ---------------------------------------------- */
.device {
  border: 1px solid var(--border);
  background: var(--bg-lift);
  border-radius: 18px;
  padding: 0.9rem;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.75);
  max-width: 22rem;
  margin: 0 auto;
  width: 100%;
}
.chips {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chip {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--field);
  border-radius: 7px;
  padding: 0.3rem 0.15rem;
  white-space: nowrap;
}
.chip.on {
  color: var(--fg);
  border-color: var(--app-accent);
  background: color-mix(in srgb, var(--app-accent) 16%, var(--field));
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tile {
  aspect-ratio: 1 / 0.82;
  border: 1px solid var(--border);
  background: var(--field);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.2rem;
  text-align: center;
  overflow: hidden;
}
.tile .em { font-size: 1.05rem; line-height: 1; }
.tile .lb {
  font-size: 0.68rem;
  line-height: 1.15;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.tile.ask {
  border-color: color-mix(in srgb, var(--ask) 55%, var(--border));
  background: color-mix(in srgb, var(--ask) 10%, var(--field));
}
.tile.neg {
  border-color: color-mix(in srgb, var(--neg) 55%, var(--border));
  background: color-mix(in srgb, var(--neg) 10%, var(--field));
}
.tile.held {
  border-color: var(--app-accent);
  background: color-mix(in srgb, var(--app-accent) 14%, var(--field));
}

.openers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.opener {
  border: 1px solid color-mix(in srgb, var(--opener) 45%, var(--border));
  background: color-mix(in srgb, var(--opener) 12%, var(--field));
  border-radius: 7px;
  font-size: 0.6rem;
  color: var(--fg);
  text-align: center;
  padding: 0.35rem 0.1rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.strip {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

figure { margin: 0; }
figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* --- Sections ------------------------------------------------------------ */
main { padding-bottom: 4rem; }

section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
section + section { border-top: 1px solid var(--border); }

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  font-weight: 660;
}
h3 {
  font-size: 1.06rem;
  margin: 0 0 0.4rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}
p { max-width: var(--measure); }
.section-lede { color: var(--muted); max-width: var(--measure); margin-top: 0; }

.split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.flip > :first-child { order: 2; }
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.card {
  border: 1px solid var(--border);
  background: var(--bg-lift);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.card .icon {
  font-size: 1.15rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* A row of the board shown three times, one per modifier — the "one chip
   rewrites all sixteen" demonstration. */
.rows { display: grid; gap: 1rem; margin: 0; padding: 0; }
.row-demo { }
.row-demo dt {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.row-demo dd { margin: 0; }
.row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.quiet { color: var(--muted); }
.small { font-size: 0.9rem; }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-lift);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0 0;
  max-width: var(--measure);
}
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }

/* --- Document pages (privacy, support) ----------------------------------- */
.doc {
  max-width: 44rem;
  padding: clamp(2rem, 6vw, 3.5rem) 1.25rem 5rem;
  margin: 0 auto;
}
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 0.5rem; }
.doc h2 {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.35rem;
}
.doc h3 { margin-top: 1.9rem; }
.doc p, .doc li { max-width: none; }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.45rem; }
.doc .updated {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0;
}
.doc .summary {
  border: 1px solid var(--border);
  background: var(--bg-lift);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 2rem 0 0;
}
.doc .summary h2 {
  margin: 0 0 0.6rem;
  border: 0;
  padding: 0;
  font-size: 1.1rem;
}
.doc .summary ul { margin-bottom: 0; }

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin: 2rem 0;
}
.toc h2 {
  margin: 0 0 0.5rem;
  border: 0;
  padding: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
/* The contents list is GENERATED from the headings (kramdown's {:toc}), and
   those headings carry their own numbers — "1. Who this is…" — because the
   body cross-references them as §4, §9 and so on. So the list must not add a
   second number of its own, or every entry reads "1. 1. Who this is…". */
.toc ol,
.toc ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.toc li { margin-bottom: 0.25rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-weight: 620;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

dl.faq dt {
  font-weight: 620;
  margin-top: 1.9rem;
  font-size: 1.06rem;
}
dl.faq dd { margin: 0.4rem 0 0; }

/* --- Footer -------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
}
.site-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.site-foot p { margin: 0; max-width: 26rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
