/* ---- tokens -------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-inset: #eef1f8;
  --text: #12151c;
  --text-muted: #565e70;
  --border: #e0e4ee;
  --accent: #4338ca;          /* indigo */
  --accent-hover: #3730a3;
  --accent-soft: #eceafd;
  --accent-text: #4338ca;
  --on-accent: #ffffff;
  --volt: #f5a524;            /* secondary highlight */
  --code-bg: #eaeef6;
  --ring: #4338ca;
  --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 10px 28px rgb(16 24 40 / .07);
  --radius: 14px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0d15;
    --bg-elev: #121723;
    --bg-inset: #161c2b;
    --text: #e8ecf5;
    --text-muted: #97a0b5;
    --border: #222a3c;
    --accent: #7c73ff;
    --accent-hover: #9089ff;
    --accent-soft: #1b1d3a;
    --accent-text: #a5a0ff;
    --on-accent: #0a0d15;
    --volt: #f5a524;
    --code-bg: #1a2130;
    --ring: #8b85ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 34px rgb(0 0 0 / .38);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0d15;
  --bg-elev: #121723;
  --bg-inset: #161c2b;
  --text: #e8ecf5;
  --text-muted: #97a0b5;
  --border: #222a3c;
  --accent: #7c73ff;
  --accent-hover: #9089ff;
  --accent-soft: #1b1d3a;
  --accent-text: #a5a0ff;
  --on-accent: #0a0d15;
  --volt: #f5a524;
  --code-bg: #1a2130;
  --ring: #8b85ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 34px rgb(0 0 0 / .38);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

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

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--code-bg);
  padding: .12em .4em;
  border-radius: 6px;
}

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--bg-elev); color: var(--text);
  padding: .6rem 1rem; border: 1px solid var(--border);
  border-radius: 0 0 8px 0; z-index: 10;
}
.skip:focus { left: 0; }

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

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 680; font-size: 1.02rem;
  letter-spacing: -.02em; text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; color: var(--accent); }
.brand small {
  font-size: .6rem; font-weight: 650; letter-spacing: .1em;
  color: var(--text-muted); text-transform: uppercase;
  vertical-align: .4em; margin-left: .15rem;
}

.nav { display: flex; align-items: center; gap: 1.15rem; font-size: .94rem; }
.nav a { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 550; }
.nav .btn { padding: .45rem .85rem; font-size: .9rem; box-shadow: none; }

.theme-toggle {
  font: inherit; line-height: 1; cursor: pointer;
  background: var(--bg-elev); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--text); }

@media (max-width: 720px) {
  .nav { gap: .85rem; font-size: .88rem; }
}

/* Below ~600px the header no longer fits on one line, so the nav wraps to a
   second row rather than pushing the page into horizontal scroll. */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; row-gap: .55rem; padding: .55rem 0; }
  .nav { width: 100%; justify-content: flex-start; gap: 1.1rem; }
  .nav .btn { margin-left: auto; }
  .nav .btn.btn-primary { padding: .42rem .8rem; }
}

/* ---- typography ---------------------------------------------------- */
h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.05rem, 5.4vw, 3.3rem);
  line-height: 1.08; letter-spacing: -.032em; font-weight: 700;
}
h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.022em;
}
h3 { margin: 0 0 .5rem; font-size: 1.03rem; letter-spacing: -.01em; }

.eyebrow {
  margin: 0 0 1rem; font-size: .76rem; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 650; color: var(--accent-text);
}
.lede { margin: 0 0 1.75rem; font-size: 1.1rem; color: var(--text-muted); }
.lede.narrow { max-width: 46rem; }
.section-intro { max-width: 44rem; margin-bottom: 2rem; }
.section-intro p { margin: 0; color: var(--text-muted); }

/* ---- buttons ------------------------------------------------------- */
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.2rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elev); color: var(--text);
  font-weight: 560; text-decoration: none;
  box-shadow: var(--shadow);
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 28%, var(--border)); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; box-shadow: none; }

/* ---- hero ---------------------------------------------------------- */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 3rem; }
.hero-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
}
.hero-copy { max-width: 36rem; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { order: 2; }
}

.hero-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-panel-bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
  font: .74rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-muted);
}
.hero-panel-bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--border); display: inline-block;
}
.hero-panel-bar span { margin-left: .4rem; }
.hero-panel pre {
  margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto;
  font: .82rem/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}
.tok-kw { color: var(--accent-text); }
.tok-str { color: #2f9e6b; }
.tok-com { color: var(--text-muted); }
.tok-fn { color: var(--volt); }
:root[data-theme="dark"] .tok-str { color: #6edaa5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tok-str { color: #6edaa5; }
}

.stats {
  display: flex; flex-wrap: wrap; gap: 2.25rem;
  margin: 3rem 0 0; padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.stats div { margin: 0; }
.stats dt { font-size: .8rem; color: var(--text-muted); }
.stats dd {
  margin: .15rem 0 0; font-size: 1.45rem;
  font-weight: 660; letter-spacing: -.02em;
}

/* ---- sections ------------------------------------------------------ */
.section { padding: 3.25rem 0; border-top: 1px solid var(--border); }
.section:last-of-type { padding-bottom: 4.5rem; }
.section-alt { background: var(--bg-elev); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}
.section-alt .card { background: var(--bg); }
.card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.card ul { margin: .75rem 0 0; padding-left: 1.1rem; color: var(--text-muted); font-size: .9rem; }
.card li + li { margin-top: .2rem; }

.card-icon {
  width: 34px; height: 34px; margin-bottom: .85rem;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.card-icon svg { width: 18px; height: 18px; }

/* process */
.steps-grid { counter-reset: step; }
.step { position: relative; }
.step-num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; margin-bottom: .8rem;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-size: .78rem; font-weight: 700;
}

/* stack pills */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.pills li {
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elev); color: var(--text-muted);
  padding: .35rem .8rem; font-size: .87rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.section-alt .pills li { background: var(--bg); }

.stack-group { margin-bottom: 1.5rem; }
.stack-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

/* engagement table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .94rem; }
th, td { text-align: left; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 570; }
td { color: var(--text-muted); }

/* CTA band */
.cta-band {
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--radius); padding: 2.25rem;
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  align-items: center; justify-content: space-between;
}
.cta-band h2 { margin: 0 0 .35rem; color: inherit; }
.cta-band p { margin: 0; opacity: .85; }
.cta-band .btn {
  background: var(--on-accent); color: var(--accent);
  border-color: transparent; box-shadow: none;
}
.cta-band .btn:hover { filter: brightness(.95); border-color: transparent; }

/* ---- prose --------------------------------------------------------- */
.prose { max-width: 44rem; padding: 3rem 0 4.5rem; }
.prose p { color: var(--text-muted); }
.prose h2 { margin-top: 2.5rem; }
.prose ul { color: var(--text-muted); padding-left: 1.15rem; }
.prose li + li { margin-top: .35rem; }

.definition { display: grid; gap: 1rem; margin: 1.5rem 0; }
.definition div {
  border-left: 2px solid var(--accent);
  padding: .1rem 0 .1rem 1rem;
}
.definition dt { font-weight: 600; }
.definition dd { margin: .15rem 0 0; color: var(--text-muted); }

.section-note {
  margin: 1.1rem 0 0;
  font-size: .93rem;
  color: var(--text-muted);
}
.section-note a { color: var(--accent-text); }

/* ---- FAQ ----------------------------------------------------------- */
.faq-wrap { max-width: 48rem; }

.faq-heading {
  margin: 2.5rem 0 1rem;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-muted); font-weight: 650;
}
.faq-heading:first-child { margin-top: 0; }

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  margin-bottom: .6rem;
}

.faq > summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 3rem 1rem 1.25rem;
  font-weight: 570;
  position: relative;
  border-radius: var(--radius);
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after {
  content: "";
  position: absolute;
  right: 1.3rem; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .15s ease;
}
.faq[open] > summary::after { transform: translateY(-30%) rotate(225deg); }
.faq > summary:hover { color: var(--accent-text); }
.faq > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

.faq-body { padding: 0 1.25rem 1.15rem; }
.faq-body p { margin: 0 0 .8rem; color: var(--text-muted); font-size: .96rem; }
.faq-body p:last-child { margin-bottom: 0; }

.updated {
  margin: -.5rem 0 2rem;
  font-size: .85rem; color: var(--text-muted);
}

/* ---- contact ------------------------------------------------------- */
.contact-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
}
.contact-list { margin: 0; padding: 0; list-style: none; }
.contact-list li + li { margin-top: 1.1rem; }
.contact-list dt, .contact-label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 650;
}
.contact-value { font-size: 1.05rem; margin-top: .1rem; }
.contact-value a { text-decoration: none; color: var(--accent-text); font-weight: 560; }
.contact-value a:hover { text-decoration: underline; }
.contact-note { font-size: .9rem; color: var(--text-muted); }
.postal { font-style: normal; font-size: .98rem; line-height: 1.6; color: var(--text); }
.footer-inner address { font-style: normal; }

.checklist { margin: 0; padding-left: 1.15rem; color: var(--text-muted); font-size: .95rem; }
.checklist li + li { margin-top: .35rem; }

/* form */
.field { margin-bottom: 1rem; }
.field label {
  display: block; margin-bottom: .3rem;
  font-size: .85rem; font-weight: 570; color: var(--text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .6rem .75rem;
}
.section-alt .field input,
.section-alt .field select,
.section-alt .field textarea { background: var(--bg-elev); }
.field textarea { resize: vertical; min-height: 6rem; }
.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 75%, transparent); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-color: var(--accent); }

/* ---- 404 ----------------------------------------------------------- */
.center-page {
  min-height: 62vh; display: grid; place-content: center;
  text-align: center; gap: .5rem; padding: 4rem 0;
}
.center-page .code {
  font-size: clamp(3.5rem, 14vw, 6rem); font-weight: 700;
  letter-spacing: -.04em; line-height: 1; color: var(--accent);
  margin: 0;
}

/* ---- footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); }
.footer-inner {
  display: grid; gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding: 2.5rem 0 1.5rem;
}
.footer-inner h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: .7rem;
}
.footer-inner ul { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.footer-inner li + li { margin-top: .35rem; }
.footer-inner a { color: var(--text-muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }
.footer-blurb { max-width: 22rem; font-size: .93rem; color: var(--text-muted); margin: .7rem 0 0; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.1rem 0 1.75rem;
  font-size: .85rem; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between;
}
.footer-bottom p { margin: 0; }

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