*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--brand-soft); color: var(--text); }
[hidden] { display: none !important; }
.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;
}
.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 200;
  background: var(--surface); color: var(--text); padding: 10px 16px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 10px; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 760px; margin-bottom: 2rem; }
.section-head p { color: var(--muted); margin-bottom: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--brand); font-size: .8rem; font-weight: 750;
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: .8rem;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 800; font-size: 1.18rem; letter-spacing: -.03em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--blue-500), var(--navy-800));
  color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand span.accent { color: var(--brand); }
.nav-list { display: flex; align-items: center; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .7rem; border-radius: 9px; color: var(--text-soft);
  font-size: .93rem; font-weight: 600;
}
.nav-list a:hover, .nav-list a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  border-radius: 11px; cursor: pointer; transition: transform .18s, border-color .18s;
}
.icon-button:hover { border-color: var(--brand); color: var(--brand); }
.icon-button:active { transform: scale(.96); }
.menu-toggle { display: none; }
.offline-indicator {
  position: fixed; bottom: 16px; left: 16px; z-index: 150;
  background: var(--navy-900); color: #fff; padding: .6rem 1rem;
  border-radius: 999px; font-size: .85rem; box-shadow: var(--shadow-md);
}

/* Hero */
.hero { position: relative; padding: clamp(3.5rem, 8vw, 6.5rem) 0 3rem; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(59, 130, 246, .17), transparent 65%); pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero h1 .gradient { background: linear-gradient(100deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-soft); max-width: 620px; }
.hero-points { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; list-style: none; padding: 0; margin: 1.5rem 0 0; color: var(--muted); font-size: .92rem; }
.hero-points li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-points svg { color: var(--green-600); }
.hero-visual { position: relative; }
.hero-panel {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
  border-radius: var(--radius-lg); padding: 1.5rem; color: #fff;
  box-shadow: var(--shadow-lg); transform: rotate(1.2deg);
}
.hero-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; font-size: .8rem; opacity: .8; }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 1rem 0; }
.mini-bars span { flex: 1; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mini-stat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: .75rem; }
.mini-stat strong { display: block; font-size: 1.3rem; }
.mini-stat span { font-size: .72rem; opacity: .75; }
.float-card {
  position: absolute; right: -12px; bottom: -18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: .6rem; font-size: .85rem;
}
.float-card svg { color: var(--green-600); }

/* Footer */
.site-footer { background: var(--navy-950); color: #c9d8f0; padding: 3.5rem 0 1.5rem; }
.site-footer a { color: #c9d8f0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h3 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .55rem; font-size: .92rem; }
.footer-brand p { max-width: 320px; font-size: .92rem; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .82rem;
}

/* Breadcrumbs */
.breadcrumbs { padding: 1.2rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* Page hero */
.page-hero { padding: 1.5rem 0 2rem; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: .75rem; }
.page-hero p { color: var(--text-soft); font-size: 1.08rem; max-width: 760px; margin-bottom: 0; }
.page-hero-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }

/* Prose */
.prose { max-width: 780px; color: var(--text-soft); }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.4rem; }
.prose code, .formula {
  font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--border);
  padding: .15em .4em; border-radius: 6px; font-size: .93em;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text); }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.animate-in { animation: fade-up .45s ease both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
