:root {
  --bg: #F8F7FB;
  --bg-soft: #EFEDF6;
  --surface: #FFFFFF;
  --surface-solid: #FFFFFF;
  --border: rgba(23, 21, 31, 0.10);
  --border-strong: rgba(23, 21, 31, 0.20);
  --ink: #17151F;
  --ink-muted: #635F70;
  --ink-faint: #8B8798;
  --magenta: #D31895;
  --cyan: #0B87A0;
  --magenta-vivid: #FF2FCB;
  --cyan-vivid: #34E7FF;
  --good: #0F9D6E;
  --warn: #B45309;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --good-bg: rgba(15, 157, 110, 0.1);
  --magenta-bg: rgba(211, 24, 149, 0.1);
  --cyan-bg: rgba(11, 135, 160, 0.1);
  --chip-bg: rgba(255, 255, 255, 0.85);
  --nav-bg: rgba(248, 247, 251, 0.78);

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08080C;
    --bg-soft: #101018;
    --surface: #121218;
    --surface-solid: #121218;
    --border: rgba(243, 239, 231, 0.10);
    --border-strong: rgba(243, 239, 231, 0.20);
    --ink: #F3EFE7;
    --ink-muted: #A6A3B4;
    --ink-faint: #6C697C;
    --magenta: #FF5FD0;
    --cyan: #34E7FF;
    --magenta-vivid: #FF2FCB;
    --cyan-vivid: #34E7FF;
    --good: #3CFFB4;
    --warn: #FFB84D;
    --warn-bg: rgba(255, 184, 77, 0.14);
    --good-bg: rgba(60, 255, 180, 0.12);
    --magenta-bg: rgba(255, 95, 208, 0.14);
    --cyan-bg: rgba(52, 231, 255, 0.12);
    --chip-bg: rgba(18, 18, 24, 0.85);
    --nav-bg: rgba(8, 8, 12, 0.78);
  }
}
:root[data-theme="dark"] {
  --bg: #08080C;
  --bg-soft: #101018;
  --surface: #121218;
  --surface-solid: #121218;
  --border: rgba(243, 239, 231, 0.10);
  --border-strong: rgba(243, 239, 231, 0.20);
  --ink: #F3EFE7;
  --ink-muted: #A6A3B4;
  --ink-faint: #6C697C;
  --magenta: #FF5FD0;
  --cyan: #34E7FF;
  --magenta-vivid: #FF2FCB;
  --cyan-vivid: #34E7FF;
  --good: #3CFFB4;
  --warn: #FFB84D;
  --warn-bg: rgba(255, 184, 77, 0.14);
  --good-bg: rgba(60, 255, 180, 0.12);
  --magenta-bg: rgba(255, 95, 208, 0.14);
  --cyan-bg: rgba(52, 231, 255, 0.12);
  --chip-bg: rgba(18, 18, 24, 0.85);
  --nav-bg: rgba(8, 8, 12, 0.78);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: 0.002em;
  text-wrap: balance;
  margin: 0;
}

p { color: var(--ink-muted); line-height: 1.65; font-size: 1rem; }
.tnum { font-variant-numeric: tabular-nums; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* nav */
nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.wordmark b { color: var(--cyan); font-weight: 700; text-shadow: 0 0 10px rgba(11, 135, 160, 0.25); }
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px -4px rgba(255,47,203,0.35), 0 4px 14px -6px rgba(52,231,255,0.28);
}
.nav-links { display: flex; align-items: center; gap: 32px; font-size: 0.86rem; perspective: 700px; }
.nav-links a {
  text-decoration: none; color: var(--ink-muted);
  font-family: var(--font-mono); letter-spacing: 0.02em;
  display: inline-block;
  transform-origin: center bottom;
  transform: translateY(0) translateZ(0) rotateX(0) scale(1);
  transition: color 0.24s ease, transform 0.28s cubic-bezier(0.2, 0.75, 0.25, 1.25), text-shadow 0.24s ease;
}
.nav-links a[aria-current="page"] { color: var(--magenta); position: relative; }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--magenta-vivid), var(--cyan-vivid));
}
.nav-links a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.nav-toggle { display: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover, .nav-links a:focus-visible {
    color: var(--cyan);
    transform: translateY(-3px) translateZ(16px) rotateX(-8deg) scale(1.1);
    text-shadow: 0 8px 16px rgba(52, 231, 255, 0.35);
  }
}

.theme-toggle {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; margin-left: 6px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface-solid); color: var(--ink-muted);
  cursor: pointer; padding: 0;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.theme-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .icon-moon { display: none; }
.theme-toggle.is-dark .icon-sun { display: none; }
.theme-toggle.is-dark .icon-moon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .nav-links a { transition: none; }
  .nav-links a:hover, .nav-links a:focus-visible { transform: none; text-shadow: none; }
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(92deg, var(--magenta-vivid), var(--cyan-vivid));
  color: #14101B;
  box-shadow: 0 1px 2px rgba(23,21,31,0.12), 0 10px 26px -10px rgba(255, 47, 203, 0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(23,21,31,0.12), 0 14px 32px -8px rgba(52, 231, 255, 0.45); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--cyan);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; display: inline-block; }

section { padding: 72px 0; position: relative; }

/* cta band (reused at the end of blog posts) */
.cta-card {
  position: relative; border-radius: 20px; padding: 2px;
  background: linear-gradient(135deg, rgba(255,47,203,0.45), rgba(52,231,255,0.32));
}
.cta-inner {
  background: var(--surface-solid); border-radius: 18px; padding: 44px;
  text-align: center;
}
.cta-inner h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.cta-inner p { margin: 14px auto 0; max-width: 46ch; }
.cta-inner .btn { margin-top: 24px; }

.to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 50;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(23,21,31,0.28);
  text-decoration: none;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, color 0.2s ease;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { border-color: var(--cyan); color: var(--cyan); }
.to-top:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: opacity 0.15s ease; transform: none; } }

footer { padding: 56px 0 44px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; }
.footer-links { display: flex; gap: 26px; font-size: 0.84rem; font-family: var(--font-mono); }
.footer-links a { text-decoration: none; color: var(--ink-muted); }
.footer-links a:hover { color: var(--cyan); }
.footer-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 8px; }

/* blog listing */
.program-hero { padding: 72px 0 24px; }
.program-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-top: 18px; }
.program-hero p { max-width: 64ch; margin-top: 20px; font-size: 1.08rem; }
.program-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 18px 0 64px; }
.program-tile { aspect-ratio: 1; min-height: 280px; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 4vw, 48px); overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.program-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--magenta-vivid), var(--cyan-vivid)); }
.program-tile:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 22px 44px -22px rgba(23,21,31,.2); }
.program-tile:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.program-tile .tile-number { font: 500 .82rem var(--font-mono); color: var(--cyan); }
.program-tile h2 { font-size: clamp(2rem, 3vw, 3.25rem); }
.program-tile p { max-width: 38ch; margin: 16px 0 0; }
.program-tile .tile-arrow { align-self: flex-end; font-size: 2rem; line-height: 1; color: var(--magenta); }
.program-detail { padding-top: 24px; }
.program-detail .article h2:first-child { margin-top: 0; }
.program-detail .article { max-width: 850px; }
.program-detail .feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.program-detail .feature-list > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.program-detail .feature-list h3 { margin: 0; }
.program-detail .feature-list p { margin: 10px 0 0; font-size: .94rem; }
.app-list { display: grid; gap: 24px; margin: 20px 0 64px; }
.app-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 28px; align-items: start; padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.app-icon { width: 116px; height: 116px; object-fit: cover; border-radius: 24px; border: 1px solid var(--border); }
.app-card h2 { font-size: clamp(1.55rem, 2.5vw, 2.2rem); }
.app-card p { margin: 12px 0 0; max-width: 72ch; }
.app-card ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; }
.app-card li { padding: 7px 10px; border-radius: 7px; background: var(--bg-soft); color: var(--ink-muted); font-size: .8rem; }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.store-links .btn { font-size: .78rem; }
.blog-hero { padding: 64px 0 20px; }
.blog-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 16px; }
.blog-hero p { margin-top: 18px; max-width: 56ch; font-size: 1.02rem; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 26px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 22px 44px -22px rgba(23,21,31,0.22); }
.post-card .cat { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--magenta); }
.post-card h2 { font-size: 1.15rem; line-height: 1.3; }
.post-card p { font-size: 0.88rem; flex: 1; }
.post-card .meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); }

/* article */
.breadcrumb { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb:hover { color: var(--cyan); }

.post-header { padding: 48px 0 8px; }
.post-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 16px; font-weight: 700; }
.post-meta { display: flex; gap: 16px; margin-top: 20px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); flex-wrap: wrap; }
.post-meta span { display: flex; align-items: center; gap: 6px; }

.article { padding: 32px 0 8px; }
.article h2 { font-size: 1.5rem; margin-top: 44px; margin-bottom: 4px; }
.article h3 { font-size: 1.15rem; margin-top: 30px; margin-bottom: 4px; }
.article p { margin-top: 16px; font-size: 1.02rem; }
.article ul, .article ol { color: var(--ink-muted); line-height: 1.75; font-size: 1.02rem; padding-left: 22px; margin-top: 16px; }
.article li { margin-top: 8px; }
.article strong { color: var(--ink); font-weight: 700; }
.article a.inline-link { color: var(--cyan); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.article-brand { display: flex; align-items: center; gap: 16px; margin: 26px 0 8px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.article-brand img { width: 72px; height: 72px; flex: none; border-radius: 16px; object-fit: cover; }
.article-brand strong { display: block; }
.article-brand span { color: var(--ink-muted); font-size: .9rem; }
.article-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 28px 0; }
.article-gallery figure { margin: 0; min-width: 0; }
.article-gallery a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-align: center; }
.article-gallery img { display: block; width: 100%; max-height: 540px; object-fit: contain; }
.article-gallery figcaption { color: var(--ink-muted); font-size: .82rem; line-height: 1.5; margin-top: 8px; }
@media (max-width: 560px) { .article-gallery { grid-template-columns: 1fr; } }

.callout {
  margin-top: 28px;
  background: var(--cyan-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 20px 24px;
}
.callout p { margin-top: 0; color: var(--ink); font-size: 0.96rem; }
.callout p:first-child { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.stat-strip div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat-strip b { display: block; font-family: var(--font-mono); font-size: 1.4rem; color: var(--magenta); }
.stat-strip span { font-size: 0.78rem; color: var(--ink-faint); }

.nav-inner { gap: 16px; }
.nav-links a, .nav-inner > .btn { white-space: nowrap; }
@media (max-width: 1180px) {
  .nav-links { gap: 18px; }
}
@media (max-width: 1024px) {
  .nav-links { gap: 14px; font-size: .78rem; }
  .nav-inner > .btn { padding: 10px 14px; font-size: .74rem; }
}
@media (max-width: 880px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
  .nav-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-solid); color: var(--ink); cursor: pointer; }
  .nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
  .nav-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
  .nav-links { display: none; position: absolute; top: calc(100% - 1px); left: 20px; right: 20px; flex-direction: column; align-items: stretch; gap: 0; padding: 8px; max-height: calc(100dvh - 85px); overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 18px 36px rgba(21, 20, 35, .14); }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 12px; font-size: .82rem; }
  .footer-inner { align-items: flex-start; }
  .footer-inner > div { min-width: 0; max-width: 100%; }
  .footer-links { flex-wrap: wrap; gap: 10px 18px; max-width: 100%; }
  .footer-links a { overflow-wrap: anywhere; }
  .nav-inner .wordmark { font-size: .9rem; gap: 6px; }
  .nav-inner .brand-mark { width: 28px; height: 28px; }
  .nav-inner > .btn { padding: 10px 12px; font-size: .72rem; white-space: nowrap; }
  .program-grid, .program-detail .feature-list { grid-template-columns: 1fr; }
  .program-tile { aspect-ratio: auto; min-height: 300px; }
  .app-card { grid-template-columns: 1fr; padding: 24px; }
  .app-icon { width: 96px; height: 96px; border-radius: 20px; }
  .cta-inner { padding: 30px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-grid.reveal { opacity: 1; transform: none; }
  .stat-strip { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-inner > .btn { display: none; }
}
