*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) { color-scheme: light; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--text-hero); }
h2, h3, h4 { font-size: var(--text-heading); }

.mono { font-family: var(--font-mono); }

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

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
}

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  --header-height: 68px;
}
@media (max-width: 1299px) {
  .site-header { --header-height: 92px; }
}

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px;
  flex-wrap: wrap;
  row-gap: 4px;
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (min-width: 1300px) {
  .site-header .wrap { padding-top: 0; padding-bottom: 0; }
}

.brand {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  row-gap: 2px;
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 600;
  color: var(--text);
}

.brand .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background-color: #f0f2f9;
  background-image: url("/favicon.svg?v=2");
  background-size: 76%;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
  flex-shrink: 0;
}

.brand .brand-name { line-height: 1; }
.brand .brand-name-lead { color: var(--text); }
.brand .brand-name-in { color: var(--accent-bright); }

.brand .brand-tagline {
  display: block;
  flex-basis: 100%;
  order: 3;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  line-height: 1.3;
  white-space: nowrap;
}

@media (min-width: 1300px) {
  .brand .brand-tagline {
    flex-basis: auto;
    order: 0;
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid var(--border-bright);
  }
}

/* ── Tagline word rotator ──────────────────────────────────────
   Same crossfade mechanic as .hero-rotator (home.css), sized to
   sit inline at the tagline's own 13px font size. The keyframes
   live here (not home.css) because the header — and this rotator
   with it — renders on every page, not just index.html. ───────── */
@keyframes hero-rotator-cycle {
  0%, 100% { opacity: 0; transform: translateY(6px); }
  4%, 16%  { opacity: 1; transform: translateY(0); }
  20%      { opacity: 0; transform: translateY(-6px); }
}

.tagline-rotator {
  position: relative;
  display: inline-block;
  height: 1.3em;
  min-width: 7ch;
  vertical-align: bottom;
}
.tagline-rotator span {
  position: absolute;
  left: 0; top: 0;
  opacity: 0;
  animation: hero-rotator-cycle 10s infinite;
  white-space: nowrap;
  color: var(--signal-color);
  font-weight: 600;
}
.tagline-rotator span:nth-child(1) { animation-delay: 0s; }
.tagline-rotator span:nth-child(2) { animation-delay: 2s; }
.tagline-rotator span:nth-child(3) { animation-delay: 4s; }
.tagline-rotator span:nth-child(4) { animation-delay: 6s; }
.tagline-rotator span:nth-child(5) { animation-delay: 8s; }

.tagline-rotator .signal-a { --signal-color: var(--signal-a); }
.tagline-rotator .signal-b { --signal-color: var(--signal-b); }
.tagline-rotator .signal-c { --signal-color: var(--signal-c); }
.tagline-rotator .signal-d { --signal-color: var(--signal-d); }
.tagline-rotator .signal-e { --signal-color: var(--signal-e); }

/* 11-frame variant: the 10 "your ___" phrases plus a closing "us"
   frame, each 3s, 33s full cycle. Uses its own keyframe sized to
   1/11 of the timeline (hero-rotator-cycle's 20%-per-item spacing
   is tuned for a 5-item cycle and doesn't divide evenly into 11).
   Frames repeat the 5 signal colors twice (frames 1–5, 6–10), and
   "us" closes in the brand accent color rather than a signal color. */
@keyframes tagline-rotator-cycle-11 {
  0%, 100%   { opacity: 0; transform: translateY(6px); }
  1.8%, 7.3% { opacity: 1; transform: translateY(0); }
  9.1%       { opacity: 0; transform: translateY(-6px); }
}

.tagline-rotator-11 { min-width: 13ch; }
.tagline-rotator-11 span {
  animation-name: tagline-rotator-cycle-11;
  animation-duration: 33s;
}
.tagline-rotator-11 span:nth-child(1)  { animation-delay: 0s; }
.tagline-rotator-11 span:nth-child(2)  { animation-delay: 3s; }
.tagline-rotator-11 span:nth-child(3)  { animation-delay: 6s; }
.tagline-rotator-11 span:nth-child(4)  { animation-delay: 9s; }
.tagline-rotator-11 span:nth-child(5)  { animation-delay: 12s; }
.tagline-rotator-11 span:nth-child(6)  { animation-delay: 15s; }
.tagline-rotator-11 span:nth-child(7)  { animation-delay: 18s; }
.tagline-rotator-11 span:nth-child(8)  { animation-delay: 21s; }
.tagline-rotator-11 span:nth-child(9)  { animation-delay: 24s; }
.tagline-rotator-11 span:nth-child(10) { animation-delay: 27s; }
.tagline-rotator-11 span:nth-child(11) { animation-delay: 30s; }

.tagline-rotator-us { --signal-color: var(--accent-bright); }

@media (prefers-reduced-motion: reduce) {
  .tagline-rotator span {
    animation: none;
    position: static;
    opacity: 1;
    display: none;
  }
  .tagline-rotator span:first-child { display: inline; }
  .tagline-rotator { height: auto; }
}

@media (min-width: 1300px) {
  .brand .brand-tagline { display: block; }
}

.nav-links {
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px);
}

.nav-links a {
  font-size: var(--text-sm); color: var(--text-muted);
  transition: color .15s ease;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }

.nav-links .cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.nav-links .cta:hover { background: var(--accent-bright); color: #fff; }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-bright);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border-bright);
  border-radius: 8px;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  font-size: var(--text-heading); color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Nav dropdowns ─────────────────────────────────────────── */
.nav-item { position: relative; }

.nav-item > button.nav-trigger {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none;
  font-family: var(--font-body);
  font-size: var(--text-sm); color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}
.nav-item > button.nav-trigger:hover,
.nav-item.open > button.nav-trigger { color: var(--text); }
.nav-trigger .caret { transition: transform .15s ease; }
.nav-item.open .nav-trigger .caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 120;
}
.nav-item.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: normal;
}
.nav-dropdown a:hover { background: var(--surface-2); color: var(--text); }
.nav-dropdown a .sub { display: block; font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.nav-dropdown .nav-dropdown-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 4px;
}

.nav-dropdown .nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-height, 68px); left: 0; right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    padding: 12px 20px 28px;
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .theme-toggle {
    align-self: flex-start;
    margin: 16px 0 4px;
  }

  .nav-links > a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-body);
  }
  .nav-links > a.cta {
    margin-top: 16px;
    text-align: center;
    border-bottom: none;
  }

  .nav-item { border-bottom: 1px solid var(--border); }
  .nav-item > button.nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 14px 4px;
    font-size: var(--text-body);
  }
  .nav-dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; border: none; background: none;
    padding: 0 0 10px 10px;
    display: none;
    min-width: 0;
  }
  .nav-item.mobile-expanded .nav-dropdown { display: block; }
  .nav-dropdown a { padding: 10px 8px; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: var(--text-sm); font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { background: var(--accent-bright); color: #fff; box-shadow: var(--shadow-md); }

.btn-outline { border-color: var(--border-bright); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-glow); }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

/* ── Sections ──────────────────────────────────────────────── */
section { padding: 96px 0; position: relative; }
section.tight { padding: 64px 0; }

@media (max-width: 720px) {
  section { padding: 64px 0; }
  section.tight { padding: 44px 0; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent);
}

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: var(--text-hero); margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: var(--text-body); line-height: 1.6; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: var(--border-bright); transform: translateY(-2px); }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  background: var(--bg-raised);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-col a, .footer-col p {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Utility ───────────────────────────────────────────────── */
.c-muted { color: var(--text-muted); }
.c-dim { color: var(--text-dim); }
.c-accent { color: var(--accent-bright); }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
