:root {
  --night: #0b1e2d;
  --night-2: #132d42;
  --ink: #082744;
  --muted: #5c7188;
  --paper: #fbfcfd;
  --wash: #eef4f7;
  --line: #d5e0e7;
  --teal: #2dd4a8;
  --teal-deep: #168c72;
  --teal-soft: #e4faf7;
  --blue: #438ed0;
  --blue-soft: #eaf4fd;
  --purple: #8971dc;
  --purple-soft: #f0edff;
  --orange: #ef9b51;
  --orange-soft: #fff3e8;
  --red: #e05d6f;
  --shadow: 0 22px 58px rgba(2, 31, 54, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ── Topbar ── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 42px;
  background: var(--night);
  border-bottom: 1px solid rgba(45, 212, 168, 0.24);
  color: rgba(255, 255, 255, 0.66);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--teal);
}

nav .nav-docs {
  padding: 5px 12px;
  border: 1px solid rgba(45, 212, 168, 0.4);
  border-radius: 6px;
  color: var(--teal);
  font-size: 0.82rem;
}

nav .nav-docs:hover {
  background: rgba(45, 212, 168, 0.1);
}

/* ── Main container ── */

main {
  background: var(--paper);
}

main.detail {
  max-width: 1280px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* ── Buttons ── */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 850;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--teal);
  color: var(--night);
}

.btn-primary:hover {
  background: #25c49a;
  box-shadow: 0 4px 16px rgba(45, 212, 168, 0.3);
}

.btn-secondary {
  border: 1px solid rgba(45, 212, 168, 0.4);
  background: transparent;
  color: var(--teal);
}

.btn-secondary:hover {
  background: rgba(45, 212, 168, 0.08);
}

.cover .btn-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
}

.cover .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Cover ── */

.cover {
  position: relative;
  min-height: calc(100vh - 58px);
  overflow: hidden;
  background: radial-gradient(circle at 80% 38%, #0c496c 0, var(--night) 63%, #020e1b 100%);
  color: #fff;
}

.cover:after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 330px;
  background:
    linear-gradient(170deg, transparent 0 30%, rgba(45, 212, 168, 0.42) 30.4%, transparent 31%),
    linear-gradient(168deg, transparent 0 42%, rgba(45, 212, 168, 0.24) 42.3%, transparent 43%),
    linear-gradient(166deg, transparent 0 54%, rgba(45, 212, 168, 0.18) 54.2%, transparent 55%);
  opacity: 0.8;
}

.pronounce {
  position: absolute;
  top: 34px;
  right: 42px;
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid rgba(45, 212, 168, 0.52);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(3, 23, 43, 0.7);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-copy {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  padding: 100px 76px 84px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--teal-deep);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover .eyebrow {
  color: var(--teal);
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  max-width: 1040px;
  color: #fff;
  font-size: clamp(3.6rem, 7vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.058em;
}

h1 span,
h2 span {
  color: var(--teal);
}

.cover p {
  max-width: 900px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  line-height: 1.42;
}

.cover-actions {
  display: flex;
  gap: 14px;
  margin-top: 36px;
}

.cover-meta {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.82rem;
  font-weight: 600;
}

.cover-meta code {
  color: var(--teal);
  font-weight: 900;
}

/* ── Problem ── */

.problem {
  display: grid;
  grid-template-columns: 48% 52%;
  gap: 28px;
  align-items: center;
  padding: 82px 76px 64px;
}

.problem h2 {
  color: var(--ink);
  font-size: clamp(2.6rem, 4.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.problem-copy p:not(.eyebrow) {
  max-width: 690px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.44;
}

.evidence-map {
  position: relative;
  padding: 22px 22px 18px 82px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7fafc;
}

.evidence-map:before {
  content: "";
  position: absolute;
  top: 72px;
  bottom: 82px;
  left: 42px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(0deg, var(--night-2), var(--teal-deep), #d6961f);
}

.evidence-map:after {
  content: "";
  position: absolute;
  top: 69px;
  left: 35px;
  width: 15px;
  height: 15px;
  border-top: 3px solid #d6961f;
  border-left: 3px solid #d6961f;
  transform: rotate(45deg);
}

.map-title {
  color: var(--teal-deep);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.map-row {
  margin-top: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.map-row:nth-child(3) {
  border-color: #9bded5;
  background: var(--teal-soft);
}

.map-row:nth-child(4) {
  border-color: #acd0ec;
  background: var(--blue-soft);
}

.map-row:nth-child(5) {
  border-color: #e6c675;
  background: var(--orange-soft);
}

.map-row b {
  display: block;
  color: var(--ink);
  font-size: 1.04rem;
}

.map-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-callout {
  margin-top: 14px;
  padding: 12px 13px;
  border-left: 4px solid var(--orange);
  color: var(--ink);
  background: var(--orange-soft);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.25;
}

/* ── Thread chain ── */

.thread-section {
  padding: 72px 76px;
  background: var(--night);
  color: #fff;
}

.thread-section .eyebrow {
  color: var(--teal);
}

.thread-section h2 {
  color: #fff;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.thread-lede {
  max-width: 780px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.14rem;
  line-height: 1.44;
}

.thread-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 42px;
}

.thread-node {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 800;
}

.thread-need { background: var(--teal-soft); color: var(--teal-deep); }
.thread-req { background: var(--blue-soft); color: #2a6faa; }
.thread-arch { background: var(--purple-soft); color: #6a54c0; }
.thread-behavior { background: #fef3e2; color: #b37020; }
.thread-risk { background: #fee2e6; color: #b83e4f; }
.thread-ver { background: #e8f5e9; color: #2e7d32; }
.thread-evi { background: #e3f2fd; color: #1565c0; }
.thread-view { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.2); }

.thread-arrow {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.2rem;
}

/* ── Stack section ── */

.stack-section {
  padding: 72px 76px;
}

.stack-section h2 {
  color: var(--ink);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-top: 36px;
}

.stack-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-decoration: none;
  transition: all 0.15s;
}

.stack-card:hover {
  border-color: #9bded5;
  box-shadow: 0 10px 24px rgba(12, 43, 73, 0.06);
  transform: translateY(-2px);
}

.stack-num {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.stack-card h3 {
  margin-top: 10px;
  color: var(--ink);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.stack-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.42;
}

.stack-card code {
  color: var(--teal-deep);
  font-size: 0.88rem;
}

.stack-status {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stack-status.released {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.stack-status.wip {
  background: var(--orange-soft);
  color: #b37020;
}

/* ── Standards ── */

.standards-section {
  padding: 72px 76px;
  background: #f7fafc;
  border-top: 1px solid var(--line);
}

.standards-section h2 {
  color: var(--ink);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.standards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-top: 36px;
}

.standard-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal-deep);
  border-radius: 12px;
  background: #fff;
}

.standard-card:nth-child(2) { border-top-color: var(--blue); }
.standard-card:nth-child(3) { border-top-color: var(--purple); }
.standard-card:nth-child(4) { border-top-color: var(--red); }

.standard-card h3 {
  color: var(--ink);
  font-size: 1.1rem;
}

.standard-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

/* ── Resources section ── */

.resources-section {
  padding: 72px 76px;
  background: #f7fafc;
  border-top: 1px solid var(--line);
}

.resources-section h2 {
  color: var(--ink);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.resources-lede {
  max-width: 680px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.44;
}

.resources-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.resource-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--teal-deep);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.resource-group-title svg {
  flex: none;
}

.resource-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  transition: all 0.15s;
}

.resource-card:hover {
  border-color: #9bded5;
  box-shadow: 0 8px 20px rgba(12, 43, 73, 0.06);
  transform: translateY(-2px);
}

.resource-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  flex: none;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.resource-icon-pdf {
  background: #fce8e8;
  color: #c0392b;
}

.resource-icon-repo {
  background: var(--night);
  color: #fff;
}

.resource-icon-docs {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-info h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 850;
}

.resource-info p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.resource-action {
  flex: none;
  color: var(--teal-deep);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.resource-card:hover .resource-action {
  color: var(--teal);
}

/* ── CTA section ── */

.cta-section {
  padding: 72px 76px;
  text-align: center;
  background: var(--night);
  color: #fff;
}

.cta-section h2 {
  color: #fff;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  letter-spacing: -0.04em;
}

.cta-section p {
  max-width: 640px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.14rem;
  line-height: 1.44;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

/* ── Footer ── */

.site-footer {
  background: var(--night);
  border-top: 1px solid rgba(45, 212, 168, 0.18);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 42px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-weight: 900;
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--teal);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.78rem;
}

/* ── Detail pages ── */

.detail {
  padding: 76px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--teal-deep);
}

.detail-hero {
  max-width: 980px;
}

.detail-hero h1 {
  color: var(--ink);
  font-size: clamp(3rem, 5.5vw, 5.2rem);
}

.lede {
  max-width: 860px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.44;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
}

.repo-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 30px;
  padding: 0 14px;
  border: 1px solid rgba(22, 140, 114, 0.28);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
}

.wip-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--orange-soft);
  color: #b37020;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-top: 72px;
}

.detail-grid article {
  min-height: 260px;
  padding: 23px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal-deep);
  border-radius: 16px;
  background: #fff;
}

.detail-grid article:nth-child(2) { border-top-color: var(--blue); }
.detail-grid article:nth-child(3) { border-top-color: var(--purple); }

.detail-grid small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-grid h2 {
  margin-top: 14px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: -0.026em;
}

.detail-grid p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.42;
}

/* ── Technical sections ── */

.technical-section {
  margin-top: 72px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.section-title {
  max-width: 860px;
}

.section-title h2 {
  color: var(--ink);
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.section-title code {
  color: var(--teal);
}

.technical-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.technical-grid article {
  min-height: 200px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.technical-grid article:nth-child(2) { background: var(--teal-soft); border-color: #9bded5; }
.technical-grid article:nth-child(3) { background: var(--blue-soft); border-color: #acd0ec; }
.technical-grid article:nth-child(4) { background: var(--purple-soft); border-color: #cfc2fb; }

.technical-grid h3 {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.technical-grid p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

/* ── Package list (ontology page) ── */

.pkg-list {
  margin-top: 28px;
}

.pkg-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 24px;
  padding: 18px 22px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 0 12px 12px 0;
  background: #fff;
}

.pkg-item h3 {
  grid-row: 1;
  color: var(--ink);
  font-size: 1.04rem;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.pkg-label {
  grid-row: 1;
  grid-column: 2;
  color: var(--teal-deep);
  font-size: 0.84rem;
  font-weight: 800;
  font-style: italic;
}

.pkg-item p {
  grid-row: 2;
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

/* ── Link table (ontology page) ── */

.link-table {
  margin-top: 28px;
}

.link-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.link-domain {
  min-width: 140px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

.link-names {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

/* ── Terminal block ── */

.terminal-block {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0d1b2a;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #162536;
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3b4f63;
}

.terminal-dot:first-child { background: #e05d6f; }
.terminal-dot:nth-child(2) { background: #ef9b51; }
.terminal-dot:nth-child(3) { background: #2dd4a8; }

.terminal-title {
  margin-left: 8px;
  color: rgba(255,255,255,0.3);
  font-size: 0.76rem;
  font-weight: 700;
}

.terminal-body {
  margin: 0;
  padding: 20px 22px;
  color: rgba(255, 255, 255, 0.7);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.84rem;
  line-height: 1.7;
  overflow-x: auto;
}

.t-prompt { color: var(--teal); }
.t-cmd { color: #fff; font-weight: 700; }
.t-out { color: rgba(255,255,255,0.5); }
.t-err { color: #e05d6f; font-weight: 700; }
.t-warn { color: #ef9b51; font-weight: 700; }
.t-dim { color: rgba(255,255,255,0.3); }

/* ── Modes grid (architect page) ── */

.modes-section {
  margin-top: 72px;
}

.modes-section .eyebrow {
  margin-left: 0;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.mode-card {
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  transition: all 0.15s;
}

.mode-card:hover {
  border-color: #9bded5;
  box-shadow: 0 6px 16px rgba(12, 43, 73, 0.06);
}

.mode-icon {
  font-size: 1.6rem;
  color: var(--teal);
  margin-bottom: 8px;
}

.mode-card h3 {
  color: var(--ink);
  font-size: 0.94rem;
}

.mode-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.36;
}

/* ── Responsive ── */

@media (max-width: 1080px) {
  .stack-grid,
  .standards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resources-groups {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .modes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 920px) {
  main {
    box-shadow: none;
  }

  .cover-copy,
  .problem,
  .thread-section,
  .stack-section,
  .standards-section,
  .resources-section,
  .cta-section,
  .detail {
    padding-inline: 28px;
  }

  .problem,
  .detail-grid,
  .technical-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid,
  .standards-grid {
    grid-template-columns: 1fr;
  }

  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pkg-item {
    grid-template-columns: 1fr;
  }

  .pkg-label {
    grid-column: 1;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  nav {
    gap: 14px;
    flex-wrap: wrap;
  }

  .cover {
    min-height: auto;
  }

  .cover-copy,
  .problem,
  .thread-section,
  .stack-section,
  .standards-section,
  .resources-section,
  .cta-section,
  .detail {
    padding-inline: 18px;
  }

  .cover-copy {
    padding-top: 78px;
  }

  .pronounce {
    position: static;
    display: inline-flex;
    margin: 18px 18px 0;
  }

  h1,
  .detail-hero h1 {
    font-size: 2.8rem;
  }

  .problem h2,
  .thread-section h2,
  .stack-section h2,
  .standards-section h2,
  .cta-section h2,
  .section-title h2 {
    font-size: 2.2rem;
  }

  .thread-chain {
    gap: 4px;
  }

  .thread-node {
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  .cover-actions {
    flex-direction: column;
  }

  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
