/* ===== Theme tokens ===== */
:root {
  --navy: #0a1f44;        /* primary text */
  --navy-soft: #2b3f66;   /* secondary text */
  --navy-line: #d4dae6;   /* borders */
  --bg: #ffffff;          /* page background */
  --bg-muted: #f6f8fc;    /* subtle panel background */
  --ad-bg: #f0f2f7;       /* ad placeholder fill */
  --ad-border: #c9d1e0;   /* ad placeholder border */
  --max-width: 1280px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.6;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  border-bottom: 2px solid var(--navy);
  background: var(--bg);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
  color: var(--navy);
}
.brand-mark {
  font-family: "SF Mono", Menlo, monospace;
  font-weight: 800;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 0 6px;
  border-radius: 6px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--navy-line);
  background: #fff;
}
.brand:hover { text-decoration: none; }
.brand-tagline {
  color: var(--navy-soft);
  font-size: 14px;
  font-weight: 600;
}

/* ===== Search ===== */
.search {
  position: relative;
  margin-left: auto;
  flex: 1 1 280px;
  max-width: 420px;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0.55;
  background: var(--navy-soft);
  -webkit-mask: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.4 1.4-1.4-5.4-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E");
          mask: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.4 1.4-1.4-5.4-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E");
}
.search-input {
  width: 100%;
  font-size: 14px;
  color: var(--navy);
  background: var(--bg-muted);
  border: 1.5px solid var(--navy-line);
  border-radius: 10px;
  padding: 9px 34px 9px 36px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: var(--navy-soft); opacity: 0.7; }
.search-input:focus {
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10, 31, 68, 0.1);
}
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-soft);
  background: #fff;
  border: 1px solid var(--navy-line);
  border-radius: 5px;
  padding: 1px 7px;
  pointer-events: none;
}
.search-input:focus ~ .search-kbd { opacity: 0; }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--navy-line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(10, 31, 68, 0.18);
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-line) transparent;
}
.search-result {
  display: block;
  padding: 9px 11px;
  border-radius: 8px;
  text-decoration: none;
}
.search-result:hover { text-decoration: none; background: var(--bg-muted); }
.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.search-result-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.search-badge {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--navy-soft);
  background: var(--bg-muted);
  border: 1px solid var(--navy-line);
  border-radius: 20px;
  padding: 2px 8px;
}
.search-result-section {
  font-size: 11.5px;
  color: var(--navy-soft);
  margin-top: 2px;
}
.search-snippet {
  font-size: 12.5px;
  color: var(--navy-soft);
  margin-top: 4px;
  line-height: 1.45;
}
.search-results mark,
.search-snippet mark {
  background: #ffe69a;
  color: var(--navy);
  border-radius: 3px;
  padding: 0 1px;
}
.search-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--navy-soft);
}

/* In-page highlight when arriving via ?q= */
mark.search-hit {
  background: #ffe69a;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  scroll-margin-top: 90px;
}
mark.search-hit:first-of-type {
  box-shadow: 0 0 0 2px #ffd34d;
}

/* ===== Layout: left sidebar | content | right ads ===== */
.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 260px 1fr 200px;
  gap: 24px;
  align-items: start;
}

/* ===== Sidebar (independent scroll region) ===== */
.sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;     /* scrolling here doesn't scroll the page */
  border: 1px solid var(--navy-line);
  border-radius: 16px;
  background: #fff;
  padding: 0 10px 12px;
  box-shadow: 0 1px 2px rgba(10, 31, 68, 0.04),
              0 10px 30px rgba(10, 31, 68, 0.06);
  scrollbar-width: thin;
  scrollbar-color: var(--navy-line) transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--navy-line);
  border-radius: 8px;
  border: 3px solid #fff;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--navy-soft); }

/* Header stays pinned while the topic list scrolls underneath it */
.sidebar-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding: 14px 6px 10px;
  border-bottom: 1px solid var(--navy-line);
}
.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--navy-soft);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--navy-soft);
  -webkit-mask: center / 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M4 5h16v2H4zM4 11h16v2H4zM4 17h10v2H4z'/%3E%3C/svg%3E");
          mask: center / 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M4 5h16v2H4zM4 11h16v2H4zM4 17h10v2H4z'/%3E%3C/svg%3E");
}
.topic-nav { padding-top: 6px; }

/* Smooth expand / collapse of the disclosure sections.
   Animates open AND close in modern browsers; degrades to instant elsewhere. */
:root { interpolate-size: allow-keywords; }
.topic::details-content,
.cluster::details-content {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.28s ease, opacity 0.22s ease, content-visibility 0.28s allow-discrete;
}
.topic[open]::details-content,
.cluster[open]::details-content {
  height: auto;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .topic::details-content,
  .cluster::details-content { transition: none; }
}

/* ---- Top-level sections ---- */
.topic { margin: 1px 0; }
.topic-head {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--navy);
  padding: 9px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}
.topic-head::-webkit-details-marker { display: none; }
.topic-head-text {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.topic-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-head::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--navy-line);
  border-bottom: 2px solid var(--navy-line);
  transform: rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.15s ease;
}
.topic[open] > .topic-head::after { transform: rotate(45deg); border-color: var(--navy-soft); }
.topic-head:hover { background: var(--bg-muted); }
.topic-head:hover::after { border-color: var(--navy-soft); }
.topic.active > .topic-head { color: var(--navy); }

/* ---- Sub-topic links: clean left-rail with active segment ---- */
.subtopics {
  list-style: none;
  margin: 1px 0 10px 15px;
  padding: 0;
  border-left: 1px solid var(--navy-line);
}
.subtopics li { margin: 0; }
.subtopics a {
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--navy-soft);
  padding: 7px 10px 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.subtopics a:hover {
  text-decoration: none;
  color: var(--navy);
  background: var(--bg-muted);
}
.subtopics a.active {
  color: var(--navy);
  font-weight: 600;
  border-left-color: var(--navy);
  background: var(--bg-muted);
}

/* ---- Nested clusters (e.g. Swift Language) ---- */
.clusters {
  padding: 0;
  margin: 0 0 6px;
}
.cluster { border: none; }
.cluster-head {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--navy-soft);
  padding: 7px 10px 7px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}
.cluster-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.cluster-head::-webkit-details-marker { display: none; }
.cluster-head::after {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--navy-line);
  border-bottom: 1.5px solid var(--navy-line);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.cluster[open] > .cluster-head::after { transform: rotate(45deg); }
.cluster-head:hover { background: var(--bg-muted); color: var(--navy); }
.cluster.active > .cluster-head { color: var(--navy); }
.cluster .subtopics { margin-left: 22px; }
.cluster .subtopics a { font-size: 12.5px; }

/* ===== Content ===== */
.content { min-width: 0; }
.hero { padding-bottom: 12px; border-bottom: 1px solid var(--navy-line); margin-bottom: 24px; }
.hero h1 {
  font-size: 38px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
}
.lead {
  margin-top: 12px;
  font-size: 18px;
  color: var(--navy-soft);
  max-width: 60ch;
}
.intro h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin: 28px 0 10px;
}
.intro p { color: var(--navy-soft); max-width: 65ch; }
.learn-list {
  margin: 10px 0 0 20px;
  color: var(--navy-soft);
}
.learn-list li { margin: 6px 0; }

/* ===== Ads ===== */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy-soft);
  opacity: 0.7;
}
.ads-right {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ad-tall { height: 600px; }
.ad-box { height: 250px; }
.ads-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 24px;
}
.ad-banner { height: 120px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 2px solid var(--navy);
  background: var(--bg);
}
.site-footer p {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  font-size: 13px;
  color: var(--navy-soft);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 240px 1fr; }
  .ads-right { display: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero h1 { font-size: 30px; }
}

/* ===== Landing extras ===== */
.next-up {
  margin-top: 14px;
  font-weight: 600;
  color: var(--navy);
}
.next-up a { text-decoration: underline; }

/* ===== Lesson pages ===== */
.breadcrumb {
  font-size: 13px;
  color: var(--navy-soft);
  margin-bottom: 8px;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.lesson h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.lesson > .lead {
  margin: 12px 0 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--navy-line);
}
.lesson h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin: 34px 0 12px;
  padding-top: 6px;
}
.lesson h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin: 24px 0 8px;
}
.lesson p { color: var(--navy-soft); max-width: 70ch; margin-bottom: 12px; }
.lesson ul, .lesson ol { color: var(--navy-soft); margin: 8px 0 14px 22px; max-width: 70ch; }
.lesson li { margin: 6px 0; }
.lesson strong { color: var(--navy); }

/* Inline code */
.lesson code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-muted);
  border: 1px solid var(--navy-line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--navy);
}

/* Code blocks */
.code-block {
  position: relative;
  background: #0a1f44;
  border-radius: 10px;
  margin: 14px 0 18px;
  overflow: auto;
}
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #eaf0ff;
}
.code-block code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.code-block .c-key { color: #ff8fb1; }     /* keywords */
.code-block .c-type { color: #8fd3ff; }    /* types */
.code-block .c-str { color: #b8f1c0; }     /* strings */
.code-block .c-com { color: #8a9bc4; font-style: italic; } /* comments */
.code-block .c-num { color: #ffd479; }     /* numeric literals */
.code-caption {
  font-size: 12px;
  color: var(--navy-soft);
  margin: -10px 0 18px;
  font-style: italic;
}

/* Callouts */
.callout {
  border-left: 4px solid var(--navy);
  background: var(--bg-muted);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  max-width: 70ch;
}
.callout p { margin: 0; color: var(--navy-soft); }
.callout strong { color: var(--navy); }
.callout.tip { border-left-color: #1f7a3d; }
.callout.warn { border-left-color: #b5471f; }

/* Numbered step cards */
.steps { counter-reset: step; list-style: none; margin: 16px 0; padding: 0; max-width: 72ch; }
.steps > li {
  counter-increment: step;
  position: relative;
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  padding: 16px 18px 16px 60px;
  margin: 0 0 14px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.steps > li h3 { margin: 0 0 6px; font-size: 17px; }
.steps > li p { margin: 0 0 6px; }
.steps > li p:last-child { margin-bottom: 0; }

/* Buttons / download */
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 8px;
  margin: 6px 8px 6px 0;
}
.btn:hover { text-decoration: none; background: var(--navy-soft); }
.btn.secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 9px 18px;
}

/* Spec / requirement table */
.spec-table {
  width: 100%;
  max-width: 70ch;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 14px;
}
.spec-table th, .spec-table td {
  border: 1px solid var(--navy-line);
  padding: 9px 12px;
  text-align: left;
  color: var(--navy-soft);
}
.spec-table th { background: var(--bg-muted); color: var(--navy); font-weight: 700; }

/* Lesson prev/next nav */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--navy-line);
}
.lesson-nav a {
  font-weight: 700;
  color: var(--navy);
}
.lesson-nav .muted { color: var(--navy-soft); font-weight: 500; }

/* ===== SwiftUI output preview (HTML/CSS mock of the rendered UI) ===== */
.preview {
  position: relative;
  border: 1px solid var(--navy-line);
  border-radius: 14px;
  background: #e7ebf2;            /* device-ish frame */
  margin: 8px 0 20px;
  max-width: 70ch;
  overflow: hidden;
}
.preview-tag {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--navy-soft);
  opacity: 0.65;
  z-index: 2;
}
.preview-stage {
  --ios-blue: #007aff;
  --ios-green: #34c759;
  --ios-red: #ff3b30;
  --ios-gray: #8e8e93;
  --ios-bg: #f2f2f7;
  min-height: 90px;
  margin: 26px 14px 14px;
  padding: 22px 18px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #000;
  font-size: 15px;
  text-align: center;
}
/* left-align variant for list/form-like previews */
.preview-stage.fill { align-items: stretch; padding: 0; }
.preview-stage.fill > * { width: 100%; }

/* Reusable iOS-ish element helpers (use inline styles for anything custom) */
.ios-btn {
  display: inline-block;
  background: var(--ios-blue);
  color: #fff;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 15px;
}
.ios-btn.tinted { background: rgba(0,122,255,0.15); color: var(--ios-blue); }
.ios-btn.plain { background: none; color: var(--ios-blue); padding: 6px 8px; }
.ios-toggle {
  display: inline-block; width: 51px; height: 31px; border-radius: 16px;
  background: var(--ios-gray); position: relative; vertical-align: middle;
}
.ios-toggle.on { background: var(--ios-green); }
.ios-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ios-toggle.on::after { left: 22px; }
.ios-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 14px; background: #fff;
  border-bottom: 1px solid #e3e3e8; font-size: 15px;
}
.ios-nav-title { font-size: 17px; font-weight: 700; }
.ios-caption { font-size: 12px; color: var(--ios-gray); }

/* Screenshot placeholder */
.shot {
  border: 1px dashed var(--ad-border);
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--navy-soft);
  font-size: 13px;
  margin: 14px 0 18px;
  max-width: 70ch;
}

/* ===== Architecture diagrams ===== */
.diagram {
  margin: 20px 0;
  padding: 20px 18px 14px;
  background: var(--bg-muted);
  border: 1px solid var(--navy-line);
  border-radius: 12px;
  max-width: 760px;
  overflow-x: auto;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
}
.diagram-caption {
  font-size: 12px;
  color: var(--navy-soft);
  font-style: italic;
  text-align: center;
  margin-top: 12px;
}

/* CSS layered-stack diagram (presentation / domain / data, etc.) */
.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 540px;
  margin: 6px auto;
}
.layer {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--navy-line);
  background: #fff;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
}
.layer .layer-sub {
  display: block;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--navy-soft);
  margin-top: 3px;
}
.layer.presentation { background: #eaf1fe; border-color: #b9d0fb; }
.layer.domain { background: #e9f7ee; border-color: #b6e2c6; }
.layer.data { background: #fdeee9; border-color: #f3cdbe; }

/* Small role/label chips used inside diagrams or prose */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--navy-line);
  border-radius: 20px;
  padding: 5px 12px;
}

/* ===================== Landing page (home) ===================== */
/* Hero */
.hero-home {
  background:
    radial-gradient(1100px 380px at 72% -10%, #eef3fc 0%, rgba(238,243,252,0) 62%),
    linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
  border-bottom: 1px solid var(--navy-line);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 56px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-soft);
  background: #fff;
  border: 1px solid var(--navy-line);
  border-radius: 30px;
  padding: 5px 14px;
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--navy);
  margin: 0 0 18px;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--navy-soft);
  max-width: 52ch;
  margin: 0 0 26px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-cta .btn { font-size: 15px; padding: 13px 24px; }
.hero-note { margin: 16px 0 0; font-size: 13px; color: var(--navy-soft); }

.hero-visual { min-width: 0; }
.hero-code {
  margin: 0;
  box-shadow: 0 24px 60px rgba(10, 31, 68, 0.18);
}
.hero-code pre { padding: 22px; font-size: 13.5px; }

/* Stats strip */
.stats-strip {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-around;
  border-bottom: 1px solid var(--navy-line);
}
.stat { text-align: center; min-width: 110px; }
.stat strong { display: block; font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
.stat span { font-size: 13px; color: var(--navy-soft); }

/* Section blocks */
.home-section { max-width: var(--max-width); margin: 0 auto; padding: 56px 24px; }
.home-section-head { margin-bottom: 28px; }
.home-h2 { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; margin: 0 0 8px; }
.home-lead { font-size: 16px; color: var(--navy-soft); max-width: 62ch; margin: 0; line-height: 1.55; }

/* Curriculum grid */
.curr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.curr-card {
  display: block;
  background: #fff;
  border: 1px solid var(--navy-line);
  border-radius: 14px;
  padding: 22px 20px 18px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.curr-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: #c5d3ec;
  box-shadow: 0 14px 34px rgba(10, 31, 68, 0.10);
}
.curr-card-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  font-size: 15px; font-weight: 800;
  color: var(--navy); background: var(--bg-muted);
  border: 1px solid var(--navy-line); border-radius: 10px;
  margin-bottom: 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.curr-card:hover .curr-card-num { background: var(--navy); color: #fff; border-color: var(--navy); }
.curr-card-title { font-size: 17px; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
.curr-card-desc { font-size: 13.5px; line-height: 1.5; color: var(--navy-soft); margin: 0 0 14px; }
.curr-card-meta { font-size: 12.5px; font-weight: 700; color: var(--navy-soft); display: flex; align-items: center; gap: 6px; }
.curr-card-arrow { transition: transform 0.15s ease; }
.curr-card:hover .curr-card-arrow { transform: translateX(4px); color: var(--navy); }

/* Features */
.features { padding-top: 8px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--bg-muted); border: 1px solid var(--navy-line);
  color: var(--navy); margin-bottom: 12px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 16px; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
.feature p { font-size: 13.5px; line-height: 1.55; color: var(--navy-soft); margin: 0; }

/* Closing CTA band */
.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 60px 24px; }
.cta-band h2 { font-size: 28px; font-weight: 800; margin: 0 0 8px; color: #fff; letter-spacing: -0.5px; }
.cta-band p { font-size: 16px; color: #c9d4ea; margin: 0 0 24px; }
.cta-band .cta-btn { background: #fff; color: var(--navy); font-size: 15px; padding: 13px 26px; }
.cta-band .cta-btn:hover { background: #eaf1fe; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; padding: 44px 20px 40px; }
  .hero-visual { order: 2; }
}

/* ===== Author credit ===== */
.hero-credit {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--navy-soft);
}
.hero-credit a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.search-credit {
  margin-top: 4px;
  padding: 9px 11px 7px;
  border-top: 1px solid var(--navy-line);
  font-size: 11.5px;
  color: var(--navy-soft);
  text-align: center;
}
.search-credit a { color: var(--navy); font-weight: 700; text-decoration: none; }
.search-credit a:hover { text-decoration: underline; }

/* ===== Author chip (header, beside search) ===== */
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 4px 13px 4px 4px;
  border: 1px solid var(--navy-line);
  border-radius: 30px;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.author-chip:hover {
  text-decoration: none;
  background: var(--bg-muted);
  border-color: #c5d3ec;
}
.author-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--navy-line);
}
.author-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .author-name { display: none; }
  .author-chip { padding: 4px; }
}
