/* SplatReader + Splat Capture website. Colours from iOS/SplatCapture/Theme.swift and brand/README.md.
   Brand blue is flat everywhere (no gradients). Amber is the one accent; coral / amber / mint mean coverage only. */

:root {
  color-scheme: light dark;

  --brand: #6734FF;          /* fills behind white text, both modes (white on it: 5.98:1) */
  --brand-text: #6734FF;     /* blue as text on light */
  --page: #F5F1EC;           /* cream */
  --card: #FAF7F2;           /* paper */
  --ink: #1A1A2E;
  --muted: #4C4A5C;          /* secondary text, 7.6:1 on cream */
  --hairline: rgba(26, 26, 46, 0.10);
  --shadow: 0 4px 24px rgba(26, 26, 46, 0.06);
  --amber: #F5A524;
  --amber-text: #8A5A00;
  --code-bg: #1A1A2E;
  --code-ink: #F5F1EC;
  --header-bg: rgba(245, 241, 236, 0.86);
  --focus: #6734FF;

  /* coverage (fills only) */
  --cov-grey: #B8B3AB;
  --coral: #E5484D;
  --mint: #5CF0B8;

  /* illustration */
  --device: #1A1A2E;
  --device-edge: #2E2E48;
  --screen: #232338;
  --screen-line: rgba(245, 241, 236, 0.28);

  --radius: 20px;
  --radius-sm: 14px;
  --max: 1120px;
  --font: "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-text: #7F8CFF;   /* ≈ 6.4:1 on ink */
    --page: #0F0F1A;         /* night */
    --card: #1A1A2E;
    --ink: #F5F1EC;
    --muted: #BDB8C9;
    --hairline: rgba(255, 255, 255, 0.10);
    --shadow: none;
    --amber-text: #F5A524;
    --code-bg: #08080F;
    --code-ink: #F5F1EC;
    --header-bg: rgba(15, 15, 26, 0.86);
    --focus: #7F8CFF;
    --cov-grey: #6B6878;
    --device: #05050B;
    --device-edge: #34344E;
    --screen: #1E1E33;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--brand-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
h4 { font-size: 1.0625rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li + li { margin-top: 0.35em; }
strong { font-weight: 650; }

code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.08em 0.36em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 0 0 1em;
  border: 1px solid var(--hairline);
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--brand); color: #fff; padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.025em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .accent { color: var(--brand-text); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block; padding: 0.45rem 0.75rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 550; font-size: 0.97rem;
}
.site-nav a:hover { background: var(--hairline); }
.site-nav a[aria-current="page"] { color: var(--brand-text); }
.site-nav .nav-cta {
  background: var(--brand); color: #fff; margin-left: 0.35rem; padding-inline: 0.95rem;
}
.site-nav .nav-cta:hover { background: var(--brand); filter: brightness(1.08); }

@media (max-width: 720px) {
  html { scroll-padding-top: 120px; }
  .header-inner { flex-wrap: wrap; gap: 0; padding-block: 0.5rem; }
  .site-nav { margin-left: 0; width: 100%; overflow-x: auto; }
  .site-nav ul { gap: 0.1rem; padding-top: 0.35rem; }
  .site-nav a { padding: 0.4rem 0.6rem; font-size: 0.93rem; white-space: nowrap; }
  .site-nav .nav-cta { margin-left: 0.2rem; }
  .site-nav { scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 430px) {
  .site-nav .nav-cta-item { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 52px; padding: 0.7rem 1.35rem; border-radius: 16px;
  font: inherit; font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
}
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-secondary { background: var(--card); color: var(--brand-text); border-color: var(--hairline); box-shadow: var(--shadow); }
.btn-secondary:hover { border-color: var(--brand-text); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.is-disabled { background: var(--hairline); color: var(--muted); cursor: not-allowed; filter: none; border-color: transparent; box-shadow: none; }
.btn.is-disabled:active { transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn-note { font-size: 0.9rem; color: var(--muted); margin-top: 0.7rem; }

.btn-small {
  font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 9px;
  background: var(--card); color: var(--brand-text); border: 1px solid var(--hairline); cursor: pointer;
}
.btn-small:hover { border-color: var(--brand-text); }
.hash-row .btn-small { flex: none; white-space: nowrap; }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.section-alt { background: var(--card); border-block: 1px solid var(--hairline); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.kicker {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-text); margin-bottom: 0.75rem;
}
.lede { font-size: clamp(1.12rem, 1rem + 0.5vw, 1.35rem); color: var(--muted); max-width: 40em; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.hero h1 .accent { color: var(--brand-text); }
.hero .lede { margin-bottom: 1.75rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.25rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.93rem; }
.hero-meta li + li { margin-top: 0; }
.hero-meta li { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-meta svg { width: 1.05em; height: 1.05em; color: var(--brand-text); }
.hero-art { width: 100%; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 560px; margin-inline: auto; }
}

/* product hero (Mac / iPhone pages) */
.product-hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
.product-icon { width: clamp(96px, 14vw, 148px); height: auto; }
.product-icon.ios { border-radius: 22.5%; box-shadow: 0 8px 28px rgba(26, 26, 46, 0.16); }
.product-hero h1 { margin-bottom: 0.3em; }
@media (max-width: 640px) {
  .product-hero { grid-template-columns: 1fr; }
}

/* ---------- Illustration ---------- */
.ill-device { fill: var(--device); }
.ill-edge { fill: none; stroke: var(--device-edge); stroke-width: 2; }
.ill-screen { fill: var(--screen); }
.ill-line { fill: none; stroke: var(--screen-line); stroke-width: 1.5; }
.ill-card { fill: var(--card); stroke: var(--hairline); }
.ill-ink { fill: var(--ink); }
.ill-path { fill: none; stroke: var(--brand-text); stroke-width: 2.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.ill-label { font-family: var(--font); font-weight: 650; font-size: 15px; }

/* ---------- Cards and grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: clamp(1.25rem, 1rem + 1vw, 1.9rem); box-shadow: var(--shadow);
}
.section-alt .card { background: var(--page); }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--muted); }

/* app cards on the home page */
.app-card { display: flex; flex-direction: column; gap: 0.25rem; }
.app-card header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.app-card header img { width: 72px; height: 72px; }
.app-card header img.ios { border-radius: 22.5%; }
.app-card header h3 { margin: 0; font-size: 1.5rem; }
.app-card header p { margin: 0; font-size: 0.95rem; }
.app-card .tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--amber-text); border: 1px solid currentColor; border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.35rem;
  vertical-align: 0.15em;
}
.app-card ul { color: var(--ink); }
.app-card .btn-row { margin-top: auto; padding-top: 1rem; }

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.7rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* ---------- Steps (the flow) ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.steps li + li { margin-top: 0; }
.steps > li .card { height: 100%; }
.step-num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.9rem;
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.numbered { counter-reset: n; list-style: none; padding: 0; }
.numbered > li { counter-increment: n; position: relative; padding-left: 2.75rem; min-height: 2rem; }
.numbered > li + li { margin-top: 1.1rem; }
.numbered > li::before {
  content: counter(n); position: absolute; left: 0; top: -0.05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.9rem;
}

/* ---------- Coverage legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.legend li + li { margin-top: 0; }
.legend li { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.swatch { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid var(--hairline); }
.swatch.grey { background: var(--cov-grey); }
.swatch.coral { background: linear-gradient(90deg, var(--coral), var(--amber)); }
.swatch.mint { background: var(--mint); }

/* ---------- Specs / requirements ---------- */
.spec { width: 100%; border-collapse: collapse; font-size: 0.98rem; table-layout: fixed; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 0.75rem 0; border-bottom: 1px solid var(--hairline); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th { width: 38%; padding-right: 1rem; font-weight: 600; color: var(--muted); }
.spec td { overflow-wrap: anywhere; }
.spec caption { text-align: left; font-weight: 700; font-size: 1.1rem; padding-bottom: 0.5rem; }

/* ---------- Download box ---------- */
.download-box { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
@media (max-width: 860px) { .download-box { grid-template-columns: 1fr; } }
.download-box > *, .grid > * { min-width: 0; }
@media (max-width: 480px) { .spec th { width: 34%; } }
.hash { font-family: var(--mono); font-size: 0.85rem; overflow-wrap: anywhere; word-break: break-all; }
.hash-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; justify-content: space-between; }
.hash-row .hash { flex: 1 1 14em; min-width: 0; }
.spec td code { word-break: break-all; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 0 0 1.25rem;
  background: color-mix(in srgb, var(--brand) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.callout > :last-child { margin-bottom: 0; }
.callout.amber {
  background: color-mix(in srgb, var(--amber) 12%, var(--card)); border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}

/* ---------- Privacy band ---------- */
.privacy-band { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; }
.privacy-band .shield { width: 56px; height: 56px; color: var(--brand-text); }
.privacy-band p { margin: 0; color: var(--muted); }
.privacy-band h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin-bottom: 0.25em; }
@media (max-width: 760px) { .privacy-band { grid-template-columns: 1fr; } }

/* ---------- Prose pages (privacy, licenses) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.85rem); margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1.25em; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--hairline); }
.prose thead th { font-weight: 650; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-scroll { overflow-x: auto; }
.page-head { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 0; }
.page-head .lede { margin-bottom: 0; }
.updated { color: var(--muted); font-size: 0.93rem; margin-top: 1rem; }
.toc { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 0 0 2rem; }
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; letter-spacing: 0; }
.toc ol { margin: 0; columns: 2; column-gap: 2rem; }
.toc li { break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.license-text {
  white-space: pre-wrap; font-family: var(--mono); font-size: 0.8rem; line-height: 1.5;
  max-height: 26rem; overflow: auto; background: var(--card); color: var(--ink); border: 1px solid var(--hairline);
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.75rem; }
.faq details {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 0 1.2rem;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font-weight: 650; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.2rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--brand-text); border-bottom: 2px solid var(--brand-text); transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > :not(summary) { color: var(--muted); }
.faq details > :last-child { padding-bottom: 1rem; margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 2.5rem 3rem; font-size: 0.93rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-start; }
.footer-grid nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-grid nav li + li { margin-top: 0; }
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--brand-text); text-decoration: underline; }
.footer-small { margin-top: 1.25rem; font-size: 0.85rem; max-width: 60em; }

/* placeholder values not yet filled in config.js */
.cfg-pending { color: var(--muted); font-style: italic; }

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

@media print {
  .site-header, .site-footer, .btn, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}

