:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #ece6da;
  --text: #1c2a2f;
  --muted: #56666b;
  --line: #d8d0c0;
  --accent: #2f6f5c;
  --accent-ink: #ffffff;
  --link: #1f6a55;
  --sun: #d9963f;
  --code-bg: #ebe5d8;
  --hero-ink: #fbf6ec;
  --radius: 4px;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b20;
    --surface: #17252b;
    --surface-2: #1d2e35;
    --text: #e6e1d6;
    --muted: #9fb0b2;
    --line: #2c4049;
    --accent: #e3ad62;
    --accent-ink: #14232b;
    --link: #8fd0b9;
    --sun: #e3ad62;
    --code-bg: #20333a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--font);
  overflow-wrap: break-word;
}
img, svg, video, iframe { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 48rem; }
.center { text-align: center; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, #14232b 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #2c4049;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--hero-ink); text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a { color: #d8e3df; text-decoration: none; padding: 0.4rem 0.7rem; border-radius: var(--radius); }
.site-nav a:hover { background: #22363f; }
.site-nav a[aria-current="page"] { color: #f2c27b; box-shadow: inset 0 -2px 0 #f2c27b; border-radius: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem;
  padding: 0.65rem 1.25rem; font-weight: 650; text-decoration: none; border-radius: var(--radius);
  clip-path: polygon(0.6rem 0, 100% 0, calc(100% - 0.6rem) 100%, 0 100%);
  padding-inline: 1.6rem;
}
.btn-primary { background: #e3ad62; color: #14232b; }
.btn-primary:hover { background: #f2c27b; }
.btn-ghost { background: rgba(255,255,255,0.1); color: var(--hero-ink); box-shadow: inset 0 0 0 2px rgba(251,246,236,0.6); }
.btn-ghost:hover { background: rgba(255,255,255,0.18); }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.cta.center { justify-content: center; }

/* hero */
.hero { position: relative; color: var(--hero-ink); background: #14232b; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14,24,30,0.82) 0%, rgba(14,24,30,0.55) 45%, rgba(14,24,30,0) 80%); }
.hero-inner { padding-top: clamp(3rem, 9vw, 7rem); padding-bottom: clamp(5rem, 14vw, 11rem); max-width: var(--wrap); }
.hero-inner > * { max-width: 38rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 700; color: #f2c27b; margin: 0; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.75rem); margin: 0.25rem 0 0.4rem; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 2px 16px rgba(0,0,0,0.35); }
.hero-sub { font-size: clamp(1.15rem, 2.6vw, 1.4rem); margin: 0 0 1rem; font-weight: 600; }
.hero-summary p { margin: 0; color: #e3ddd0; }
.store-note { font-size: 0.9rem; color: #cfd8d4; margin-top: 0.9rem; }
.store-note a { color: #f2c27b; }

/* sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 1.25rem; }
.section h2::before { content: ""; display: block; width: 2.5rem; height: 0.4rem; margin-bottom: 0.9rem; background: var(--sun); clip-path: polygon(0 100%, 30% 0, 100% 100%); }
.center h2::before { margin-inline: auto; }
.section-lead { color: var(--muted); margin-top: -0.5rem; }
.lead { font-size: 1.2rem; }
.about { background: var(--bg); }
.features, .tech { background: var(--surface-2); }
.made blockquote { margin: 0; padding: 1rem 1.25rem; border-left: 4px solid var(--sun); background: var(--surface); }
.made blockquote p { margin: 0; }
.closing { background: var(--surface-2); }
.support { color: var(--muted); margin-top: 1.5rem; }

.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.feature-grid li { background: var(--surface); padding: 1rem 1.1rem 1rem 2.6rem; position: relative; border-radius: var(--radius); border: 1px solid var(--line); }
.feature-grid li::before { content: ""; position: absolute; left: 1rem; top: 1.35rem; width: 0.85rem; height: 0.75rem; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.spec ul { list-style: none; padding: 0; margin: 0; }
.spec li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.spec li:last-child { border-bottom: 0; }

/* media */
.frame { aspect-ratio: 16 / 9; width: 100%; background: #0e181e; border-radius: var(--radius); overflow: hidden; }
.frame iframe, .frame video { width: 100%; height: 100%; border: 0; }
.placeholder { display: grid; place-items: center; text-align: center; color: #9fb0b2; border: 2px dashed #3a525c; background: repeating-linear-gradient(135deg, #14232b 0 14px, #17282f 14px 28px); font-weight: 650; }
.placeholder small { font-weight: 400; }
.shots { display: grid; gap: 0.75rem; margin-top: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.shots figure { margin: 0; }
.shots img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.shots figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: anywhere; }

/* docs */
.docs { display: grid; gap: 2.5rem; grid-template-columns: 15rem minmax(0, 1fr); padding-top: 2.5rem; padding-bottom: 4rem; }
.docs-side { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; font-size: 0.95rem; }
.side-h { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin: 0 0 0.5rem; }
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.doc-pages a { display: block; padding: 0.35rem 0.6rem; text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.doc-pages a:hover { background: var(--surface-2); }
.doc-pages a[aria-current="page"] { border-left-color: var(--sun); font-weight: 650; background: var(--surface-2); }
.toc { margin-top: 1.25rem; }
.toc summary { cursor: pointer; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; padding: 0.25rem 0; }
.toc li a { display: block; padding: 0.2rem 0.6rem; color: var(--muted); text-decoration: none; }
.toc li a:hover { color: var(--link); }
.side-version { margin-top: 1.5rem; color: var(--muted); font-size: 0.85rem; }

.prose { max-width: 46rem; min-width: 0; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0 0 1rem; }
.prose h2 { font-size: 1.55rem; margin: 2.5rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--accent); }
.anchor { color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; margin-left: 0.25rem; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
@media (hover: none) { .anchor { opacity: 0.45; } }
.doc-support { margin-top: 3rem; padding: 1rem 1.25rem; background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.changelog h2 { font-family: var(--mono); font-size: 1.3rem; }
.notfound { padding: 5rem 1rem; }

@media (max-width: 56rem) {
  .docs { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 1.25rem; }
  .docs-side { position: static; max-height: none; overflow: visible; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
  .doc-pages { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .doc-pages a { border-left: 0; border-bottom: 3px solid transparent; }
  .doc-pages a[aria-current="page"] { border-bottom-color: var(--sun); }
  .side-version, .changelog-side { display: none; }
  .hero::after { background: linear-gradient(180deg, rgba(14,24,30,0.78) 0%, rgba(14,24,30,0.55) 60%, rgba(14,24,30,0.2) 100%); }
}

/* footer */
.site-footer { background: #14232b; color: #cfd8d4; padding: 2.5rem 0 1.5rem; font-size: 0.95rem; }
.site-footer a { color: #f2c27b; }
.footer-row { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-row nav { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--hero-ink); margin-top: 0; }
.site-footer .muted { color: #9fb0b2; font-weight: 400; }
.legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #2c4049; font-size: 0.82rem; color: #9fb0b2; }
.legal p { margin: 0.25rem 0; }

/* ghost buttons on light sections */
.closing .btn-ghost { color: var(--text); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.closing .btn-ghost:hover { background: var(--surface); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.compare tbody th { font-weight: 600; background: transparent; }
