:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #5f6b67;
  --line: #dfe6e2;
  --paper: #fbfaf7;
  --soft: #eef5f1;
  --accent: #bf3f2f;
  --accent-dark: #8f2e23;
  --blue: #255b7f;
  --green: #3f6b52;
  --wrap: 1040px;
  --read: 680px;
  --article-media: 760px;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
img { max-width: 100%; }
.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px max(20px, calc((100vw - var(--wrap)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.94);
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
  object-fit: cover;
  object-position: 50% 28%;
}
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
}
.header-ruby-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  white-space: nowrap;
}
.header-ruby-toggle span {
  padding: 0 4px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
.header-ruby-toggle button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}
.header-ruby-toggle button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
main { overflow-x: clip; }
.document-home {
  max-width: var(--read);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 72px) 20px clamp(44px, 6vw, 68px);
}
.doc-hero {
  padding-bottom: 28px;
}
.doc-icon {
  width: 56px;
  height: 56px;
  display: block;
  margin-bottom: 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  object-position: 50% 28%;
}
.doc-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(2.05rem, 4.5vw, 3.25rem);
}
.doc-lede {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.4vw, 1.2rem);
}
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.notion-callout {
  margin: 18px 0 38px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.notion-callout p {
  margin: 8px 0 0;
  color: var(--muted);
}
.profile-note {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.profile-note img {
  width: 112px;
  height: 112px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 28%;
}
.profile-note span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.profile-note strong {
  display: block;
  line-height: 1.35;
}
.profile-note p {
  margin: 6px 0 0;
  color: var(--muted);
}
.library-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 8px;
  margin: 0 0 38px;
}
.library-summary div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}
.library-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.library-summary strong {
  display: block;
  line-height: 1.35;
}
.doc-block {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 58px);
  padding: clamp(48px, 7vw, 88px) 20px clamp(36px, 5vw, 64px);
}
.hero-copy { max-width: 640px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: 0; }
h1 {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4.1vw, 3.5rem);
}
h2 { font-size: clamp(1.4rem, 2vw, 1.95rem); }
h3 { font-size: 1.2rem; }
.hero p, .page-hero p, .split-section p {
  max-width: 650px;
  font-size: clamp(0.98rem, 1.05vw, 1.08rem);
  color: var(--muted);
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  background: white;
}
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.subtle { background: transparent; }
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.trust-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}
.hero-panel {
  display: grid;
  gap: 14px;
}
.profile-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.profile-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.profile-card figcaption {
  display: grid;
  gap: 6px;
  padding: 16px;
  color: var(--muted);
}
.profile-card strong { color: var(--ink); line-height: 1.35; }
.profile-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.mini-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
}
.mini-grid span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.mini-grid strong {
  text-align: right;
}
.band, .pathway-section, .latest-section, .split-section, .page-hero, .article-list {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 62px) 20px;
}
.band {
  padding-top: clamp(22px, 3vw, 36px);
}
.compact-band {
  border-top: 1px solid var(--line);
}
.section-heading { max-width: var(--read); margin-bottom: 24px; }
.language-list, .pathway-grid, .article-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.notion-list {
  grid-template-columns: 1fr;
  gap: 8px;
}
.language-card, .pathway-card, .article-card {
  min-height: 148px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
}
.compact-card {
  min-height: auto;
}
.notion-list .compact-card {
  display: grid;
  grid-template-columns: minmax(0, 152px) minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 14px 16px;
}
.notion-list .compact-card span {
  margin: 2px 0 0;
}
.notion-list .compact-card h3 {
  margin: 0 0 4px;
}
.notion-list .compact-card p {
  grid-column: 2;
  margin: 0;
}
.pathway-section {
  border-top: 1px solid var(--line);
  background: #fffdfa;
}
.latest-section {
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.article-list.compact {
  padding: 0;
}
.row-list {
  grid-template-columns: 1fr;
  gap: 10px;
}
.article-card h2 {
  margin: 0;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
}
.language-card span, .pathway-card span, .article-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 900;
  font-size: 0.82rem;
}
.language-card p, .pathway-card p, .article-card p { color: var(--muted); }
.notion-list .compact-card span { margin: 2px 0 0; }
.notion-list .compact-card h3 { margin: 0 0 4px; }
.notion-list .compact-card p {
  grid-column: 2;
  margin: 0;
}
.article-card em {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 800;
  font-size: 0.9rem;
}
.row-list .article-card {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 22px;
  align-items: center;
}
.row-list .article-card span,
.row-list .article-card h2,
.row-list .article-card p {
  grid-column: 1;
}
.row-list .article-card em {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin-top: 0;
  white-space: nowrap;
}
.split-section {
  max-width: var(--wrap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 72px);
  padding-left: 20px;
  padding-right: 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.page-hero {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.page-hero h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
.hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.hub-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}
.article-list {
  padding-top: 32px;
}
.learning-sequence {
  max-width: var(--read);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 58px) 20px;
}
.sequence-list {
  display: grid;
  gap: 10px;
}
.sequence-card {
  display: grid;
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
}
.sequence-card span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}
.sequence-card strong {
  line-height: 1.35;
  font-size: 1rem;
}
.sequence-card p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
}
.sequence-card em {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.article-main {
  background: #fffdfa;
}
.article-shell {
  max-width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: clamp(32px, 5vw, 58px) 20px;
}
.breadcrumb {
  max-width: var(--read);
  margin: 0 auto 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}
.breadcrumb a {
  color: var(--accent-dark);
  text-decoration: none;
}
.article-header {
  max-width: var(--read);
  margin: 0 auto;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.article-header h1 { font-size: clamp(1.75rem, 3.2vw, 2.55rem); }
.article-header p { color: var(--muted); font-size: 1rem; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--read)) minmax(220px, 280px);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  justify-content: center;
  margin: 28px auto 0;
}
.article-content {
  min-width: 0;
}
.article-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 0;
  align-self: start;
  color: var(--muted);
}
.article-sidebar .article-toc {
  max-width: none;
  margin: 0;
}
.article-sidebar .article-toc {
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.article-sidebar .article-toc ol {
  padding-left: 20px;
}
.sidebar-panel {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.sidebar-panel strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
}
.sidebar-links {
  display: grid;
  gap: 10px;
}
.sidebar-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
}
.sidebar-links span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
.sidebar-links strong {
  margin: 2px 0 0;
  color: var(--accent-dark);
  line-height: 1.35;
}
.article-shell[data-ruby="hide"] .ruby-reading {
  display: none;
}
.article-shell[data-ruby="show"] .ruby-reading {
  display: inline;
  color: var(--muted);
  font-size: 0.9em;
}
.article-toc {
  max-width: var(--read);
  margin: 24px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.article-toc strong {
  display: block;
  margin-bottom: 8px;
}
.article-toc ol {
  margin: 0;
  padding-left: 22px;
}
.article-toc li + li {
  margin-top: 4px;
}
.article-toc a {
  color: var(--accent-dark);
  text-decoration: none;
}
.article-body {
  max-width: var(--read);
  margin: 0 auto 34px;
  font-size: 1rem;
  scroll-margin-top: 96px;
  overflow-wrap: anywhere;
}
.article-body h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.article-body h2 { margin-top: 2.1em; font-size: clamp(1.35rem, 2.2vw, 1.75rem); scroll-margin-top: 96px; }
.article-body h3 { margin-top: 1.7em; font-size: 1.18rem; }
.article-body p {
  margin: 0 0 1.05em;
}
.article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 460px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  object-fit: contain;
}
.article-body figure {
  max-width: var(--article-media);
  margin: 28px auto;
  overflow: hidden;
}
.article-body figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}
.article-body th { background: var(--soft); text-align: left; }
.article-body blockquote, .callout {
  margin: 22px 0;
  padding: 18px;
  border-left: 4px solid var(--accent);
  background: white;
}
.article-body details {
  margin: 22px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.article-body summary {
  cursor: pointer;
  font-weight: 800;
  line-height: 1.45;
}
.article-body pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 8px;
  background: #18201f;
  color: white;
}
.cta-panel {
  margin: 48px auto 24px;
  padding: 24px;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.related-languages {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}
.related-languages a {
  color: var(--accent-dark);
  text-decoration: none;
}
.article-navigation {
  max-width: 760px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.article-nav-card, .article-nav-placeholder {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.article-nav-card {
  text-decoration: none;
}
.article-nav-card span, .article-nav-placeholder {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}
.article-nav-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}
.article-nav-placeholder {
  opacity: 0.55;
}
.site-footer {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer div { display: flex; gap: 16px; }
@media (min-width: 821px) {
  .article-navigation,
  .related-languages {
    display: none;
  }
}
@media (max-width: 820px) {
  .site-header, .site-footer { align-items: flex-start; flex-direction: column; }
  .hero, .split-section { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .article-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
  }
  .article-content {
    order: 2;
  }
  .article-sidebar {
    position: static;
    order: 1;
  }
  .article-sidebar .sidebar-panel {
    display: none;
  }
  .profile-note {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
  }
  .profile-note img {
    width: 92px;
    height: 92px;
  }
  .library-summary { grid-template-columns: 1fr; }
  .language-list, .pathway-grid, .article-list { grid-template-columns: 1fr; }
  .notion-list .compact-card { grid-template-columns: 1fr; }
  .notion-list .compact-card p { grid-column: 1; }
  .sequence-card { grid-template-columns: 1fr; }
  .sequence-card p, .sequence-card em { grid-column: 1; grid-row: auto; }
  .article-navigation { grid-template-columns: 1fr; }
  .mini-grid a { align-items: flex-start; flex-direction: column; }
  .mini-grid strong { text-align: left; }
  .row-list .article-card { grid-template-columns: 1fr; }
  .row-list .article-card em { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .article-shell { padding-left: 16px; padding-right: 16px; }
  .article-body img { max-height: 360px; }
}
