:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --accent-2: #d97706;
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px -12px rgba(15, 23, 42, 0.12);
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px;
  --radius-sm: 10px;
}

:root.dark {
  --bg: #0b0f0e;
  --surface: #131a18;
  --surface-alt: #0f1513;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.1);
  --accent-2: #f59e0b;
  --on-accent: #062420;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 36px -14px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #0b0f0e;
    --surface: #131a18;
    --surface-alt: #0f1513;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --accent-2: #f59e0b;
    --on-accent: #062420;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 36px -14px rgba(0, 0, 0, 0.55);
  }
}

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

html {
  scroll-behavior: smooth;
}

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

:root.dark body {
  letter-spacing: 0.005em;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

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

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

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

main.prose {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 4.2vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0.25em 0 0.4em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 1.5em 0 0.5em;
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0 0 0.35em;
  font-weight: 600;
}

.lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 64ch;
}

.kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
  display: block;
}

.meta-line {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Reading progress bar for articles */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 60;
  transition: width 80ms linear;
}

/* Top Bar Contract: 3 zones separated by gap */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: block;
}

nav.top-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

nav.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

nav.top-nav a:hover,
nav.top-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.top-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 24px 20px;
}

.mobile-drawer.open {
  display: grid;
  gap: 10px;
}

.mobile-drawer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0 16px;
}

/* Hero Section */
.hero {
  padding: 56px 0 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-facts {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.hero-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  min-height: 360px;
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.stage-characters {
  position: relative;
  height: 230px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.stage-characters img {
  height: 195px;
  width: auto;
  object-fit: contain;
  transition: transform 200ms var(--ease);
}

.stage-characters img.is-center {
  height: 220px;
  z-index: 2;
}

.stage-bubble {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.stage-bubble strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 2px;
}

/* Sections & Grids */
section.s {
  padding: 56px 0;
}

section.alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.bento .span-2 {
  grid-column: span 2;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
}

.kpi-item {
  padding: 12px 0;
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
}

.kpi-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.card.interactive {
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}

.card.interactive:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card p {
  margin: 0.4em 0 0;
  color: var(--muted);
}

.card-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.cmd-phrase {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Segmented Controls */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segmented button {
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.segmented button[aria-pressed="true"],
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Pricing */
.price {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 12px 0 6px;
}

.price small {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
}

.card.pop {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: grid;
  gap: 10px;
}

.check-list li {
  padding-left: 22px;
  position: relative;
  color: var(--muted);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Steps & Callouts (No thick left borders!) */
.steps {
  counter-reset: s;
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 16px 60px;
  position: relative;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 22px 0;
}

.callout strong {
  color: var(--text);
}

/* Tables */
.tw {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 20px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

td,
th {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td,
tr:last-child th {
  border-bottom: none;
}

th {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-alt);
}

/* Accordions */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 10px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* Search & Filter Inputs */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}

.input {
  width: 100%;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.input:focus {
  border-color: var(--accent);
  outline: none;
}

/* Character Showcase */
.char-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.char-card img {
  height: 170px;
  width: auto;
  object-fit: contain;
  margin-bottom: 12px;
}

/* Showcase Image */
.media-frame {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b1f1b;
}

.media-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Breadcrumbs */
.crumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
}

/* CTA Band */
.ctaband {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  margin: 40px 0 16px;
}

.ctaband h2 {
  margin-top: 0;
}

.ctaband .btn-row {
  justify-content: center;
  margin-bottom: 0;
}

.cta-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto 14px;
}

.about-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.about-brand img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Footer */
footer.f {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  padding: 48px 0 36px;
  margin-top: 48px;
}

footer.f .cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}

footer.f a {
  color: var(--muted);
  display: block;
  padding: 4px 0;
  text-decoration: none;
}

footer.f a:hover {
  color: var(--text);
}

footer.f a.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

footer.f h4 {
  color: var(--text);
  margin: 0 0 10px;
  font-size: 0.875rem;
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 32px 0;
    gap: 28px;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .bento .span-2 {
    grid-column: auto;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  footer.f .cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  nav.top-nav,
  .top-cta .btn-primary {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 520px) {
  .kpi-strip,
  footer.f .cols {
    grid-template-columns: 1fr;
  }
}

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