/* ==========================================================================
   String — marketing site
   Single stylesheet, no build step, no external requests.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */

:root {
  color-scheme: light dark;

  /* Palette — light */
  --bg:            #ffffff;
  --bg-alt:        #f6f6fb;
  --surface:       #ffffff;
  --surface-alt:   #f0eff8;
  --text:          #14131a;
  --text-muted:    #55535f;
  --border:        #e2e1ec;
  --primary:       #4a39d1;
  --primary-hover: #3b2cad;
  --primary-soft:  #eceafb;
  --accent:        #0c6f5b;
  --accent-soft:   #e2f3ee;
  --focus:         #4a39d1;
  --shadow:        0 1px 2px rgb(20 19 26 / 6%), 0 8px 24px rgb(20 19 26 / 6%);

  /* Fluid type scale */
  --step--1: clamp(0.83rem, 0.79rem + 0.20vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.95rem + 0.25vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.11rem + 0.44vw, 1.44rem);
  --step-2:  clamp(1.44rem, 1.30rem + 0.71vw, 1.84rem);
  --step-3:  clamp(1.73rem, 1.51rem + 1.09vw, 2.35rem);
  --step-4:  clamp(2.07rem, 1.75rem + 1.62vw, 3.00rem);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --radius:    10px;
  --radius-lg: 16px;
  --container: 1100px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0e0d14;
    --bg-alt:        #14131c;
    --surface:       #17161f;
    --surface-alt:   #1e1c29;
    --text:          #f2f1f7;
    --text-muted:    #a9a6b6;
    --border:        #2b2937;
    --primary:       #a99dff;
    --primary-hover: #c0b7ff;
    --primary-soft:  #211d3d;
    --accent:        #5fd3b2;
    --accent-soft:   #10312a;
    --focus:         #a99dff;
    --shadow:        0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 32%);
  }
}

/* --- Reset -------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
  font-weight: 680;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p, ul, ol { margin: 0 0 var(--sp-4); }
p { text-wrap: pretty; }

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-7) 0; }

/* --- Layout ------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section { padding-block: var(--sp-8); }
.section--alt { background: var(--bg-alt); }

@media (min-width: 768px) {
  .section { padding-block: var(--sp-9); }
}

.section__head { max-width: 62ch; margin-bottom: var(--sp-7); }
.section__head p { color: var(--text-muted); font-size: var(--step-1); margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --- Header / nav ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: var(--step-1);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand svg { flex: none; }

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__list a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 550;
}
.nav__list a:hover { color: var(--text); background: var(--surface-alt); }
.nav__list a[aria-current="page"] { color: var(--text); background: var(--surface-alt); }

/* Mobile nav */
@media (max-width: 819px) {
  .nav__menu {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
    display: none;
    box-shadow: var(--shadow);
  }
  .nav__menu[data-open="true"] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
  .nav__list a { padding: var(--sp-3); font-size: var(--step-0); }
  .nav__menu .btn { margin-top: var(--sp-3); width: 100%; }
}

@media (min-width: 820px) {
  .nav__toggle { display: none; }
  .nav__menu { display: flex !important; align-items: center; gap: var(--sp-4); }
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7em 1.25em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }

@media (prefers-color-scheme: dark) {
  .btn--primary { color: #14131a; }
  .btn--primary:hover { color: #14131a; }
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-alt); color: var(--text); }

.btn--sm { padding: 0.5em 0.9em; font-size: var(--step--1); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-8) var(--sp-8);
  background:
    radial-gradient(60rem 30rem at 78% -10%, var(--primary-soft), transparent 65%),
    var(--bg);
}

@media (min-width: 768px) {
  .hero { padding-block: var(--sp-9); }
}

.hero__grid { display: grid; gap: var(--sp-7); align-items: center; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-8); }
}

.hero p.hero__lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: var(--sp-6);
}

.hero__note {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--step--1);
  font-weight: 620;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.35em 0.85em;
  margin-bottom: var(--sp-4);
}

/* --- Cards & grids ------------------------------------------------------ */

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 940px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

.card h3 { margin-bottom: var(--sp-2); }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--text-muted); font-size: var(--step--1); }

.card__icon {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: var(--sp-4);
}

/* --- Feature rows ------------------------------------------------------- */

.feature-row {
  display: grid;
  gap: var(--sp-6);
  align-items: center;
  padding-block: var(--sp-7);
  border-top: 1px solid var(--border);
}
.feature-row:first-of-type { border-top: 0; }

@media (min-width: 860px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .feature-row--flip .feature-row__media { order: -1; }
}

.feature-row h3 { font-size: var(--step-2); }
.feature-row p { color: var(--text-muted); }

/* --- Platform / spec lists ---------------------------------------------- */

.speclist { list-style: none; padding: 0; margin: 0; }
.speclist li {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
}
.speclist li:first-child { border-top: 0; }
.speclist dt, .speclist strong { font-weight: 620; min-width: 11rem; }

.perm-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.perm-table th, .perm-table td {
  text-align: left;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.perm-table th { font-weight: 620; }
.perm-table code { white-space: nowrap; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Callouts ----------------------------------------------------------- */

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-5);
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--primary); }

/* --- Prose (legal pages) ------------------------------------------------ */

.prose { max-width: 72ch; }
.prose h2 {
  font-size: var(--step-2);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.prose h2:first-of-type { margin-top: var(--sp-5); }
.prose h3 { font-size: var(--step-1); margin-top: var(--sp-5); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: var(--sp-2); }
.prose li > ul { margin-top: var(--sp-2); }

.prose__meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.prose__meta p:last-child { margin-bottom: 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.toc h2 {
  font-size: var(--step-0);
  border: 0;
  margin: 0 0 var(--sp-3);
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.toc ol { margin: 0; padding-left: 1.3em; font-size: var(--step--1); }
.toc li { margin-bottom: var(--sp-1); }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: var(--sp-7) var(--sp-6);
  margin-top: var(--sp-8);
  font-size: var(--step--1);
}

.footer__grid { display: grid; gap: var(--sp-6); }
@media (min-width: 700px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

.footer__grid h2 {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}
.footer__grid ul { list-style: none; padding: 0; margin: 0; }
.footer__grid li { margin-bottom: var(--sp-2); }
.footer__grid a { color: var(--text-muted); text-decoration: none; }
.footer__grid a:hover { color: var(--text); text-decoration: underline; }

.footer__bottom {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
}
.footer__bottom p { margin: 0; }

/* --- Consent banner ----------------------------------------------------- */

.consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
}

.consent__inner {
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  gap: var(--sp-4);
}
@media (min-width: 880px) {
  .consent__inner { grid-template-columns: 1fr auto; align-items: center; }
}

.consent h2 { font-size: var(--step-0); margin-bottom: var(--sp-2); }
.consent p { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
.consent__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.consent-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: var(--sp-6);
  max-width: 32rem;
  width: calc(100vw - 2rem);
  box-shadow: var(--shadow);
}
.consent-dialog::backdrop { background: rgb(0 0 0 / 55%); }

.consent-option {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
}
.consent-option input { margin-top: 0.35em; width: 1.1em; height: 1.1em; flex: none; }
.consent-option label { font-weight: 620; display: block; }
.consent-option p { font-size: var(--step--1); color: var(--text-muted); margin: var(--sp-1) 0 0; }

/* --- Utilities ---------------------------------------------------------- */

.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;
}

.muted { color: var(--text-muted); }
.lede  { font-size: var(--step-1); color: var(--text-muted); max-width: 62ch; }
.center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-6 { margin-top: var(--sp-6); }

.badge {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Utility classes rather than inline style attributes, so the Content-Security-
   Policy in .htaccess can keep style-src locked to 'self'. */
.mx-auto           { margin-inline: auto; }
.btn-row--center   { justify-content: center; }
.brand--footer     { margin-bottom: var(--sp-3); }
.consent__actions--dialog { margin-top: var(--sp-6); }

/* Unresolved facts in the legal copy. Deliberately loud: the site must not go
   live while any of these remain. Grep for "todo" in the HTML to find them. */
.todo {
  background: #ffd400;
  color: #14131a;
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* --- Sub-item auto-complete demo ---------------------------------------
   Replaces the animated GIF the brief asked for: same story, a few hundred
   bytes, crisp at any zoom, and it holds the finished state for anyone who
   prefers reduced motion. */

.demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.demo figcaption {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

/* Default (and reduced-motion) state: the finished result, all ticked. */
.demo-check { opacity: 1; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  .demo-check { opacity: 0; }
  .demo-check--1 { animation: demoTick 9s linear infinite 0.6s; }
  .demo-check--2 { animation: demoTick 9s linear infinite 1.7s; }
  .demo-check--3 { animation: demoTick 9s linear infinite 2.8s; }
  .demo-check--parent { animation: demoTick 9s linear infinite 3.7s; }
}

@keyframes demoTick {
  0%, 6%    { opacity: 0; transform: scale(0.5); }
  11%, 80%  { opacity: 1; transform: scale(1); }
  88%, 100% { opacity: 0; transform: scale(0.5); }
}
