:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1c1c1c;
  --text-dim: #5a5a5a;
  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, 0.08);
  --kbd-bg: #ececec;
  --kbd-border: #c0c0c0;
  --kbd-text: #1a1a1a;
  --rule: #e5e3df;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --surface: #18191c;
    --text: #f0f0ef;
    --text-dim: #9a9a9a;
    --accent: #ef4554;
    --accent-soft: rgba(239, 69, 84, 0.14);
    --kbd-bg: #2a2b2f;
    --kbd-border: #444;
    --kbd-text: #f0f0ef;
    --rule: #25262a;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: inherit; }
a:hover { color: var(--accent); }

kbd {
  display: inline-block;
  font: 0.92em/1 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  background: var(--kbd-bg);
  color: var(--kbd-text);
  border: 1px solid var(--kbd-border);
  border-radius: 4px;
  padding: 1px 6px 2px;
  white-space: nowrap;
  vertical-align: baseline;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
}

.brand img { width: 36px; height: 36px; }
.brand-name { font-size: 1.1rem; letter-spacing: 0.3px; }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.15s;
}

.site-nav a.current,
.site-nav a:hover { color: var(--text); }

.site-nav .lang {
  border-left: 1px solid var(--rule);
  padding-left: 22px;
}

/* Main layout */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.section {
  padding: 70px 0;
  border-top: 1px solid var(--rule);
}

.section:first-of-type { border-top: none; }

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin: 0 0 0.2em;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }

.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 1.5em;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  padding: 80px 0 60px;
  align-items: center;
}

.tagline {
  font-size: 1.3rem;
  color: var(--text-dim);
  margin: 0 0 1.2em;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 1.4em;
}

.hero-icon {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.hero-title h1 { margin-bottom: 0.1em; }
.hero-title .tagline { margin: 0; }

.hero-desc {
  font-size: 1.05rem;
  margin-bottom: 1.6em;
  max-width: 38ch;
}

.appstore img {
  width: 165px;
  height: 40px;
  transition: transform 0.15s ease;
}

.appstore:hover img { transform: translateY(-1px); }

.hero-shot img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Two-up image grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 36px;
}

.grid-2 figure { margin: 0; }

.grid-2 img {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.grid-2 figcaption {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

.img-narrow {
  max-width: 320px;
  margin: 32px auto 0;
}

.img-narrow img {
  width: 185px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Standalone figures (single-image, full width inside main) */
.section > figure {
  margin: 28px 0 0;
  max-width: 720px;
}

.section > figure img {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section > figure figcaption {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Help: narrower hero (text only) */
.hero-narrow {
  grid-template-columns: 1fr;
  padding: 70px 0 30px;
}

.hero-narrow .hero-desc {
  max-width: 62ch;
}

/* Help: table of contents */
.toc {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin: 24px 0 16px;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
  columns: 2;
  column-gap: 32px;
  line-height: 1.9;
}

.toc a {
  text-decoration: none;
  color: var(--text);
}

.toc a:hover { color: var(--accent); }

/* Help: section sub-heading */
.section h3 {
  font-size: 1.2rem;
  margin: 32px 0 0.6em;
  letter-spacing: -0.005em;
}

/* Help: key list (no bullets, generous spacing) */
.key-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}

.key-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.key-list li:last-child { border-bottom: none; }

/* Help: file-path code block */
.path {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px 16px;
  font: 0.92rem/1.4 "SF Mono", ui-monospace, Menlo, monospace;
  overflow-x: auto;
  margin: 0 0 1em;
}

/* Help: "New" badge */
.badge-new {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 8px;
}

/* Smooth scroll for TOC anchor links + sticky-header offset */
html { scroll-behavior: smooth; }
:target { scroll-margin-top: 80px; }

/* Keyboard overlay (#19 as HTML/CSS) */
.keyboard-overlay {
  position: relative;
  margin: 36px auto 8px;
  max-width: 862px;
}

.keyboard-overlay img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.callout {
  position: absolute;
  background: var(--accent);
  color: #fff;
  font: 600 0.78rem/1 -apple-system, sans-serif;
  padding: 5px 9px 5px 5px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.callout::before {
  content: "[" attr(data-key) "]";
  display: inline-block;
  margin-right: 6px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font-weight: 700;
}

/* Callout positions on front_hero_light.png — measured against actual layout */
.c-T     { left: 22%; top: 48%; }
.c-P     { left: 39%; top: 48%; }
.c-Slots { left: 55%; top: 58%; }
.c-L     { left: 19%; top: 73%; }
.c-plus  { left: 50%; top: 73%; }
.c-Y     { left: 33%; top: 86%; }
.c-Space { left: 54%; top: 86%; }

/* Download CTA */
.download {
  text-align: center;
}

.download p { margin-bottom: 1.8em; }

/* Footer */
.site-footer {
  padding: 40px 32px 48px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid var(--rule);
}

.site-footer p { margin: 0.4em 0; }
.site-footer a { color: var(--text-dim); }

/* Responsive */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 50px 0 40px;
  }
  .hero-icon { width: 72px; height: 72px; }
  .hero-title { gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 50px 0; }
  .site-header { padding: 14px 20px; }
  .site-nav { gap: 16px; font-size: 0.88rem; }
  .site-nav .lang { padding-left: 16px; }
  main { padding: 0 18px 40px; }
  .toc ol { columns: 1; }
  .callout {
    font-size: 0.62rem;
    padding: 3px 7px 3px 3px;
  }
  .callout::before {
    padding: 1px 4px;
    margin-right: 4px;
  }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  /* Hide callouts on narrow screens — they'd overlap unreadably */
  .keyboard-overlay .callout { display: none; }
}
