/* Qix site — self-contained, no external assets. Light + dark. */
:root {
  --bg: #faf9f7;
  --bg-raise: #ffffff;
  --bg-inset: #f1efec;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --accent: #4f52c9;
  --accent-soft: #ececfa;
  --border: #e3e1dd;
  --key-face: #ffffff;
  --key-edge: #d5d3cf;
  --key-shadow: rgba(0, 0, 0, 0.10);
  --hero-grad: radial-gradient(1200px 600px at 70% -10%, #ecebfa 0%, transparent 60%);
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --bg-raise: #1c1c1f;
    --bg-inset: #202023;
    --text: #ececee;
    --text-dim: #98989f;
    --accent: #9d9ff2;
    --accent-soft: #26264a;
    --border: #2c2c30;
    --key-face: #2a2a2e;
    --key-edge: #414147;
    --key-shadow: rgba(0, 0, 0, 0.5);
    --hero-grad: radial-gradient(1200px 600px at 70% -10%, #1e1e33 0%, transparent 60%);
    --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
h2 { font-size: 1.7rem; margin: 2.6em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 2em 0 0.4em; }
p, ul, ol { margin: 0.8em 0; }
li { margin: 0.3em 0; }
code {
  font: 0.88em ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

/* Keycaps — the house motif. */
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.1em 0.5em;
  text-align: center;
  font: 600 0.82em -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--key-face);
  border: 1px solid var(--key-edge);
  border-bottom-width: 3px;
  border-radius: 7px;
  box-shadow: 0 1px 0 var(--key-shadow);
  white-space: nowrap;
}

/* Layout */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px clamp(20px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.nav .brand img { width: 28px; height: 28px; }
.nav .links { display: flex; gap: 18px; margin-left: auto; font-size: 0.95rem; }
.nav .links a { color: var(--text-dim); }
.nav .links a.active, .nav .links a:hover { color: var(--text); text-decoration: none; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

/* Landing */
.hero {
  background: var(--hero-grad);
  padding: clamp(48px, 9vw, 110px) 0 40px;
  text-align: center;
}
.hero img.appicon { width: clamp(96px, 14vw, 148px); height: auto; filter: drop-shadow(0 12px 28px rgba(0,0,0,.18)); }
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  margin: 0.5em auto 0.3em;
  max-width: 17em;
}
.hero .sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 38em;
  margin: 0 auto;
}
.hero .cta { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { border: 1px solid var(--border); color: var(--text); background: var(--bg-raise); }
.btn.ghost:hover { text-decoration: none; border-color: var(--text-dim); }

.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.hero .shot { max-width: 980px; margin: 44px auto 0; }

figure { margin: 1.6em 0; }
figure figcaption {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 10px;
  text-align: center;
}
figure.gif img { border-radius: 12px; }

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin: 56px 0;
}
.pillar {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.pillar h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pillar p { margin: 0; font-size: 0.95rem; color: var(--text-dim); }
.pillar .glyph { font-size: 1.5rem; margin-bottom: 10px; }

.feature {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin: clamp(48px, 8vw, 96px) 0;
}
.feature:nth-of-type(even) .copy { order: 2; }
.feature .copy h2 { margin-top: 0; }
.feature .copy p { color: var(--text-dim); }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .copy { order: 0; }
}

.rules {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px clamp(22px, 4vw, 44px);
  margin: 60px 0;
  box-shadow: var(--shadow-card);
}
.rules ol { padding-left: 1.3em; }
.rules li { margin: 0.55em 0; }

footer {
  margin-top: clamp(60px, 10vw, 120px);
  padding: 36px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
}

/* Manual */
.manual {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-top: 36px;
}
.manual .toc {
  position: sticky;
  top: 76px;
  align-self: start;
  font-size: 0.93rem;
}
.manual .toc .group { color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 6px; }
.manual .toc a { display: block; padding: 3px 0; color: var(--text-dim); }
.manual .toc a.active { color: var(--accent); font-weight: 600; }
.manual .toc a:hover { color: var(--text); text-decoration: none; }
.manual article h1 { font-size: 2.1rem; margin: 0 0 0.4em; }
.manual article .lead { font-size: 1.12rem; color: var(--text-dim); margin-bottom: 1.6em; }
@media (max-width: 820px) {
  .manual { grid-template-columns: 1fr; }
  .manual .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
  .manual .toc .group { width: 100%; margin: 8px 0 0; }
}

table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.95rem; }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }

.tip {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 18px;
  margin: 1.4em 0;
  font-size: 0.95rem;
}
.tip strong { color: var(--accent); }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 40px; }
.shortcut-grid h3 { margin-top: 0.6em; }
.shortcut-grid table td:first-child { white-space: nowrap; padding-right: 18px; }

.pagenav { display: flex; justify-content: space-between; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.95rem; }
