/* THABLES site. One stylesheet, no framework, no network.
   Colours: the app's THABLES Plum palette (Packages/ThablesUI/.../Atlas/AtlasPalette.swift),
   light and dark by prefers-color-scheme. --muted is darker than the app's #716B7E for 4.5:1.
   Fonts: self-hosted (fonts/README.md). Manrope 800 for the wordmark and headings only. */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/Manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans-var.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #F5F5F9;
  --panel: #FFFFFF;
  --soft: #EEEAF6;
  --ink: #343146;
  --muted: #625C70;
  --line: #E5E3EC;
  --accent: #7453B8;
  --on-accent: #FFFFFF;
  --teal: #0E7C8B;
  --sel: #E4DCF5;
  --num: #7453B8;
  --num-sel: #6E4EB2;
  --draft-bg: #FBEFD9;
  --draft: #6E4A12;
  --shadow: rgba(40, 30, 70, 0.14);

  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1200px;
  --gutter: 24px;
  --section: clamp(64px, 8vw, 96px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181721;
    --panel: #22212D;
    --soft: #30283F;
    --ink: #F0ECF7;
    --muted: #B5AFC2;
    --line: #413B4D;
    --accent: #BCA2F0;
    --on-accent: #1B1726;
    --teal: #5FC3CF;
    --sel: #3D3252;
    --num: #BCA2F0;
    --num-sel: #BCA2F0;
    --draft-bg: #3A2E1A;
    --draft: #F2D3A0;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- type ---------- */

.h1, .h2, .h3 { font-family: var(--font-head); }
.h1 {
  font-weight: 800;
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.h1--page { font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.01em; }
.h2 {
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.h2--small { font-size: 28px; line-height: 1.15; letter-spacing: 0; }
.h3 { font-weight: 700; font-size: 19px; line-height: 1.3; }
.h3--group { font-size: 22px; }
.lede { font-size: clamp(19px, 1.6vw, 20px); color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow {
  font-size: 14px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}

/* The wordmark: Manrope 800, the first T in the icon teal. Nowhere else uses .wordmark. */
.wordmark {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark .t { color: var(--teal); }

.pro {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.6;
  padding: 1px 8px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  vertical-align: 0.15em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none; line-height: 1.2;
}
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn--small { min-height: 44px; padding: 10px 18px; font-size: 15px; }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; text-decoration: none;
}
.brand .wordmark { font-size: 20px; }
.icon { display: block; border-radius: 22.37%; box-shadow: 0 0 0 1px var(--line); }
.header-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 600; }
@media (max-width: 419px) {
  /* Phones: one header row. The hero's "Get notified at launch" is just below, so the pill goes. */
  .site-header .btn--small { display: none; }
  .site-header .wrap { column-gap: 10px; }
  .brand { gap: 8px; }
  .brand .wordmark { font-size: 18px; }
  .nav { column-gap: 12px; font-size: 14px; }
}

/* ---------- sections ---------- */

.section { padding: var(--section) 0; }
.band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band + .band { border-top: 0; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin-bottom: 40px; }
.section-head .lede { font-size: 19px; }

/* Hero */
.hero { padding: clamp(56px, 7vw, 88px) 0 56px; }
.hero .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-shot { flex: 1 1 560px; min-width: 0; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.cta-note { font-size: 15px; color: var(--muted); }

/* The screenshot's own title bar stays; the frame adds only border, radius and shadow. */
.shot {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px var(--shadow);
  overflow: hidden;
}
.shot img { display: block; width: 100%; }

/* Formats */
.formats { padding-bottom: 72px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; padding: 0; }
.chips-label { font-size: 15px; color: var(--muted); margin-right: 6px; }
.chip {
  font-family: var(--font-mono); font-size: 15px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--soft); color: var(--ink);
}

/* Five views */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
  list-style: none; padding: 0;
}
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  background: var(--bg); display: flex; flex-direction: column; gap: 10px;
}
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .pro { margin-left: auto; }
.card p { font-size: 15px; color: var(--muted); }
.glyph {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
}

/* Copy like Numbers */
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.split-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split-text .lede { font-size: 19px; }
.split-figure { flex: 1 1 520px; min-width: 0; }
.keys { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.keys li { display: flex; align-items: center; gap: 12px; }
kbd {
  font-family: var(--font-mono); font-size: 14px;
  min-width: 64px; padding: 4px 9px; text-align: center;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink);
}

.table-frame { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow-x: auto; }
.sample { border-collapse: collapse; width: 100%; font-family: var(--font-mono); font-size: 14px; }
.sample caption {
  caption-side: top; text-align: left; padding: 12px 16px;
  font-family: var(--font-body); font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.sample th, .sample td { padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.sample tbody tr:last-child > * { border-bottom: 0; }
.sample th { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.sample .rownum { font-family: var(--font-body); color: var(--muted); }
.sample .num { color: var(--num); text-align: right; }
.sample .sel { background: var(--sel); color: var(--ink); }
.sample .sel.num { color: var(--num-sel); }
.sample .sel-top { box-shadow: inset 0 2px 0 var(--accent); }
.sample .sel-bottom { box-shadow: inset 0 -2px 0 var(--accent); }

/* Three columns */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.col p { color: var(--muted); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 24px; }
.plan {
  border: 1px solid var(--line); border-radius: 18px; padding: 32px;
  background: var(--panel); display: flex; flex-direction: column; gap: 18px;
}
.plan--pro { border: 2px solid var(--accent); padding: 31px; }
.plan-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.price { margin-top: 6px; font-family: var(--font-head); font-weight: 800; font-size: 40px; line-height: 1.2; }
.plan-terms, .plan-lead { font-size: 15px; color: var(--muted); }
.plan-terms { margin-top: 2px; }
.ticks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; align-items: flex-start; gap: 10px; }
.ticks svg { flex: none; margin-top: 4px; width: 18px; height: 18px; color: var(--teal); }
.plan--pro .ticks svg { color: var(--accent); }

/* FAQ (home and support) */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0 14px; }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; padding: 10px 0;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] > summary::after { content: "\2212"; }
.faq details p { color: var(--muted); }
.faq--home summary { font-family: var(--font-head); font-weight: 700; font-size: 19px; }

/* ---------- inner pages ---------- */

.page { max-width: 820px; margin: 0 auto; padding: 72px var(--gutter) 96px; display: flex; flex-direction: column; gap: 36px; }
.page-head { display: flex; flex-direction: column; gap: 12px; }
.faq-group { display: flex; flex-direction: column; gap: 4px; }
.faq-group .h3 { margin-bottom: 6px; }

.card-cta {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  padding: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.card-cta > div { flex: 1 1 320px; min-width: 0; }
.card-cta p { margin-top: 6px; color: var(--muted); }

/* Privacy, Terms, Legal */
.doc {
  max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gutter) 96px;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 56px;
  line-height: 1.6;
}
.toc { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.toc-label { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.toc a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.doc-body { flex: 999 1 560px; min-width: 0; max-width: 720px; display: flex; flex-direction: column; gap: 28px; }
.doc-head { display: flex; flex-direction: column; gap: 10px; }
.doc-date { font-size: 15px; color: var(--muted); }
.doc-intro { font-size: 19px; }
.doc-section { display: flex; flex-direction: column; gap: 8px; }
.doc-section .h3 { font-size: 22px; }
.doc-section ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.badge-draft {
  align-self: flex-start;
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--draft-bg); color: var(--draft);
}
.kv {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  padding: 24px 28px; font-size: 15px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 28px;
}
.kv div { display: flex; flex-direction: column; gap: 2px; }
.kv dt { font-size: 13px; color: var(--muted); }

/* 404 */
.notfound { max-width: 720px; margin: 0 auto; padding: 96px var(--gutter); display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.mini {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  border-collapse: separate; border-spacing: 0; overflow: hidden;
  font-family: var(--font-mono); font-size: 15px;
}
.mini th { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted); text-align: left; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.mini td { padding: 10px 16px; }
.mini .status { color: var(--accent); min-width: 70px; }
.mini .null { color: var(--muted); font-style: italic; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 40px; padding-bottom: 40px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand .wordmark { font-size: 15px; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-meta { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.footer-meta a { color: var(--muted); }
.trademarks { flex-basis: 100%; font-size: 13px; }

@media (max-width: 640px) {
  .footer-meta { margin-left: 0; }
}

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