:root {
  --background: #f7f7f4;
  --surface: #ffffff;
  --ink: #111214;
  --muted: #60646b;
  --line: #d9dad6;
  --accent: #2458d3;
  --accent-dark: #173b91;
  --green: #217153;
  --max: 1040px;
  --mono: "Geist Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font: inherit; }
code, pre { font-family: var(--mono); }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(36, 88, 211, 0.35);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus { top: 20px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  width: min(calc(100% - 48px), var(--max));
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.desktop-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.desktop-links a,
.footer nav a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 650;
}

.desktop-links a:hover,
.footer nav a:hover,
.hf-link:hover,
.text-link:hover { color: var(--accent-dark); }

.github-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.github-button svg {
  fill: #e0a127;
  stroke: #9a6814;
  stroke-width: 0.7;
}

.github-button:hover { border-color: var(--ink); background: #fff; }

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 21px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}

.button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.button-secondary { background: transparent; color: var(--ink); }
.button-secondary:hover { border-color: var(--ink); background: #fff; color: var(--ink); }

.menu-button {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
}

.menu-button span {
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 72px 0 auto;
  z-index: 99;
  padding: 12px 24px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--background);
}

.mobile-menu a {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}

.hero {
  position: relative;
  isolation: isolate;
  width: min(calc(100% - 48px), var(--max));
  min-height: 760px;
  margin: 0 auto;
  padding: 86px 0 96px;
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 960px;
}

.announcement {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 28px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}

.announcement span {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(33, 113, 83, 0.12);
}

.hero h1 {
  margin: 0 0 27px;
  font-size: clamp(52px, 6.8vw, 72px);
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 1;
  text-wrap: balance;
}

.hero h1 .hero-subline {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.7em;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.hero-lead {
  max-width: 760px;
  margin: 0 0 31px;
  color: var(--muted);
  font-size: clamp(20px, 2.3vw, 24px);
  font-weight: 510;
  line-height: 1.48;
  letter-spacing: -0.012em;
}

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.hero-note { margin: 22px 0 0; color: var(--muted); font-family: var(--mono); font-size: 17px; }

.brain-stage {
  position: absolute;
  inset: 105px -18vw 20px 8%;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  opacity: 1;
  pointer-events: none;
}

.brain-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    90deg,
    var(--background) 0%,
    rgba(247, 247, 244, 0.98) 24%,
    rgba(247, 247, 244, 0.76) 40%,
    rgba(247, 247, 244, 0.18) 58%,
    transparent 72%
  );
  pointer-events: none;
}

#brain-canvas { width: 100%; height: 100%; display: block; mix-blend-mode: multiply; }

.brain-stage noscript img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }

.section {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 88px 0;
  border-top: 1px solid var(--line);
}

.kicker {
  margin: 0 0 17px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.section-heading { max-width: 800px; margin-bottom: 45px; }

.section-heading h2,
.api-copy h2,
.closing h2 {
  margin: 0;
  font-size: clamp(40px, 5.3vw, 58px);
  font-weight: 810;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-wrap: balance;
}

.section-heading > p:last-child {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.intro { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 72px; }
.intro .section-heading { margin: 0; }
.intro-copy { max-width: 650px; }
.intro-copy p { margin: 0 0 23px; color: var(--muted); font-size: 20px; line-height: 1.57; }

.step-grid,
.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.step-grid article,
.principle-grid article {
  min-width: 0;
  padding: 30px 28px 0 0;
  border-right: 1px solid var(--line);
}

.step-grid article:not(:first-child),
.principle-grid article:not(:first-child) { padding-left: 28px; }
.step-grid article:last-child, .principle-grid article:last-child { border-right: 0; }

.step-grid span {
  display: block;
  margin-bottom: 25px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 17px;
}

.step-grid h3,
.principle-grid h3 { margin: 0 0 10px; font-size: 23px; letter-spacing: -0.025em; line-height: 1.15; }
.step-grid p, .principle-grid p { margin: 0; color: var(--muted); font-size: 17px; }

.model-list { border-top: 1px solid var(--ink); }

.model-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.8fr);
  gap: 48px;
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.model-main h3 {
  margin: 0 0 13px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.043em;
  line-height: 1.06;
}

.model-main .repository {
  max-width: 100%;
  margin: 0 0 25px;
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.repository span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 17px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.repository a { color: var(--accent-dark); }
.model-main > p:not(.repository) { max-width: 670px; margin: 0 0 22px; color: var(--muted); font-size: 18px; line-height: 1.58; }

.text-link,
.hf-link {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.model-facts { align-self: start; margin: 0; border-top: 1px solid var(--line); }
.model-facts div { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.model-facts dt { color: var(--muted); font-family: var(--mono); font-size: 17px; font-weight: 650; }
.model-facts dd { min-width: 0; margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.model-facts .technical { color: var(--muted); }

.catalog-note,
.status-note { max-width: 900px; margin: 36px 0 0; color: var(--muted); font-size: 17px; }
.catalog-note a, .status-note a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

.blog-card {
  min-width: 0;
  padding: 31px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.34);
}

.blog-card:hover { background: var(--surface); }
.blog-card > span { color: var(--accent-dark); font-size: 17px; font-weight: 800; letter-spacing: 0.045em; text-transform: uppercase; }
.blog-card h2, .blog-card h3 { margin: 17px 0 12px; font-size: clamp(27px, 3vw, 34px); letter-spacing: -0.04em; line-height: 1.08; }
.blog-card p { margin: 0 0 23px; color: var(--muted); font-size: 17px; }
.blog-card strong { color: var(--accent-dark); font-size: 17px; }
.blog-all-link { display: inline-block; margin-top: 28px; }

.blog-page-main,
.article-main { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }
.blog-index-hero { max-width: 890px; padding: 90px 0 72px; }
.blog-index-hero h1,
.article-header h1 { margin: 0; font-size: clamp(48px, 7.5vw, 78px); font-weight: 830; letter-spacing: -0.06em; line-height: 0.98; text-wrap: balance; }
.blog-index-hero > p:last-child { max-width: 760px; margin: 28px 0 0; color: var(--muted); font-size: 21px; }
.blog-index-grid { padding: 0 0 96px; }

.article-shell { max-width: 900px; margin: 0 auto; padding: 82px 0 100px; }
.article-header { padding-bottom: 52px; border-bottom: 1px solid var(--line); }
.article-header .article-lead { max-width: 790px; margin: 27px 0 0; color: var(--muted); font-size: clamp(20px, 2.5vw, 24px); line-height: 1.5; }
.article-meta { display: flex; flex-wrap: wrap; gap: 9px 22px; margin: 28px 0 0; color: var(--muted); font-size: 17px; }
.article-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 48px 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.article-facts div { padding: 17px 19px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-facts dt { color: var(--muted); font-size: 17px; font-weight: 700; }
.article-facts dd { margin: 5px 0 0; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.article-body { max-width: 760px; }
.article-body h2 { margin: 62px 0 18px; font-size: clamp(33px, 4.5vw, 46px); letter-spacing: -0.045em; line-height: 1.08; }
.article-body h3 { margin: 37px 0 13px; font-size: 25px; letter-spacing: -0.03em; line-height: 1.18; }
.article-body p, .article-body li { color: #34373d; font-size: 18px; line-height: 1.72; }
.article-body p { margin: 0 0 24px; }
.article-body ul { margin: 0 0 27px; padding-left: 25px; }
.article-body li { margin-bottom: 9px; }
.article-body a { color: var(--accent-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.article-callout { margin: 38px 0; padding: 24px 26px; border-left: 4px solid var(--accent); background: #eef2ff; }
.article-callout strong { display: block; margin-bottom: 8px; color: var(--accent-dark); font-size: 17px; }
.article-callout p { margin: 0; }
.article-source-list { padding-top: 26px; border-top: 1px solid var(--line); }
.article-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--ink); }
.article-next a { padding: 19px; border: 1px solid var(--line); font-size: 17px; font-weight: 800; }
.article-next a:hover { background: var(--surface); }
.article-repository { overflow-wrap: anywhere; }

.api-section { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(400px, 1.05fr); align-items: center; gap: 66px; }
.api-copy p:not(.kicker) { max-width: 620px; margin: 22px 0; color: var(--muted); font-size: 18px; }
.api-section pre { margin: 0; overflow: auto; padding: 28px; border: 1px solid #27292e; border-radius: 4px; background: #17191d; color: #f5f5f2; font-size: 17px; line-height: 1.75; }

.principle-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.faq-list { max-width: 860px; border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 0; cursor: pointer; list-style: none; font-size: 19px; font-weight: 750; line-height: 1.35; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span { color: var(--muted); font-family: var(--mono); font-size: 22px; font-weight: 400; }
.faq-list details[open] summary span { transform: rotate(45deg); }
.faq-list details p { max-width: 780px; margin: -3px 0 27px; color: var(--muted); font-size: 17px; }

.closing { padding-top: 96px; padding-bottom: 96px; }
.closing p:not(.kicker) { max-width: 680px; margin: 25px 0 31px; color: var(--muted); font-size: 19px; }

.footer {
  width: min(calc(100% - 48px), var(--max));
  display: flex;
  justify-content: space-between;
  gap: 50px;
  margin: 0 auto;
  padding: 52px 0 68px;
  border-top: 1px solid var(--line);
}

.footer p { margin: 16px 0 0; color: var(--muted); font-size: 17px; }
.footer nav { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 14px 23px; max-width: 550px; }

@media (max-width: 900px) {
  .desktop-links { display: none; }
  .github-button { margin-left: auto; }
  .intro, .api-section { grid-template-columns: 1fr; gap: 42px; }
  .step-grid, .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-grid article:nth-child(2), .principle-grid article:nth-child(2) { border-right: 0; }
  .step-grid article:nth-child(n + 3), .principle-grid article:nth-child(n + 3) { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
  .model-row { grid-template-columns: 1fr; gap: 36px; }
  .article-facts { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 17px; }
  .nav-inner, .hero, .section, .footer { width: min(calc(100% - 36px), var(--max)); }
  .blog-page-main, .article-main { width: min(calc(100% - 36px), var(--max)); }
  .nav-inner { min-height: 62px; gap: 12px; }
  .brand { font-size: 17px; }
  .brand img { width: 27px; height: 27px; }
  .github-button { display: none; }
  .menu-button { display: flex; margin-left: auto; }
  .mobile-menu { inset: 62px 0 auto; }
  .hero { min-height: 760px; padding-top: 60px; }
  .announcement { margin-bottom: 24px; font-size: 17px; }
  .hero h1 { font-size: clamp(42px, 12.5vw, 54px); }
  .hero h1 .hero-subline { font-size: 0.72em; }
  .hero-lead { font-size: 20px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .hero-note { line-height: 1.6; }
  .brain-stage { inset: 250px -48% 12px -30%; opacity: 1; }
  .section { padding: 68px 0; }
  .section-heading h2, .api-copy h2, .closing h2 { font-size: clamp(38px, 12vw, 50px); }
  .section-heading > p:last-child, .intro-copy p, .api-copy p:not(.kicker) { font-size: 18px; }
  .step-grid, .principle-grid { grid-template-columns: 1fr; }
  .step-grid article, .step-grid article:not(:first-child), .principle-grid article, .principle-grid article:not(:first-child) { margin: 0; padding: 27px 0; border-top: 1px solid var(--line); border-right: 0; }
  .model-row { padding: 44px 0; }
  .blog-card-grid, .article-next { grid-template-columns: 1fr; }
  .blog-card { padding: 25px 22px; }
  .blog-index-hero { padding: 64px 0 54px; }
  .article-shell { padding: 60px 0 76px; }
  .model-main h3 { font-size: 32px; }
  .model-main > p:not(.repository) { font-size: 17px; }
  .model-facts dt, .model-facts dd { font-size: 17px; }
  .api-section pre { padding: 21px; font-size: 17px; }
  .faq-list summary { font-size: 18px; }
  .footer { flex-direction: column; padding-bottom: 48px; }
  .footer nav { justify-content: flex-start; }
}

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