/* Base: reset, layout frame and the components every page shares. */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-sm);
  font-weight: 600;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-sm); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { margin: 0 0 var(--space-sm); padding-left: 1.15em; }
li + li { margin-top: 0.35em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Layout ---------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.wrap--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(2.5rem, 6vw, var(--space-2xl)); }
.section--tight { padding-block: clamp(1.75rem, 4vw, var(--space-xl)); }
.section--paper { background: var(--paper); }
.section--surface { background: var(--surface); }
.section--band {
  background: var(--navy);
  color: var(--on-navy);
}
.section--band a { color: var(--on-navy); }
.section--band p { color: var(--on-navy-muted); }

.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.stack--sm { gap: var(--space-sm); }
.stack--lg { gap: var(--space-xl); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.grid--sidebar {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 62rem) {
  .grid--sidebar { grid-template-columns: 17rem minmax(0, 1fr); }
  .grid--sidebar--right { grid-template-columns: minmax(0, 1fr) 20rem; }
}

/* ---- Type helpers ---------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-xs);
}
.section--band .eyebrow { color: var(--accent-tint); }
.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 58ch;
}
.meta {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.model-code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-lg); font-size: var(--text-2xl); }
.prose h3 { margin-top: var(--space-md); }
.prose img { border-radius: var(--radius); margin-block: var(--space-md); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin-block: var(--space-md); }
.prose th, .prose td { border: var(--border); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-deep); font-weight: 600; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Buttons and links ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #9a4712; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--quiet { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--quiet:hover { border-color: var(--line-strong); }
.btn--block { width: 100%; }
.section--band .btn--ghost { border-color: var(--on-navy-muted); color: var(--on-navy); }
.section--band .btn--ghost:hover { border-color: var(--on-navy); background: rgba(255, 255, 255, 0.08); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}
.link-arrow::after { content: "→"; transition: transform 0.15s ease; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---- Tags and chips -------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-radius: var(--radius-sm);
}
.tag--accent { background: var(--accent-tint); color: #8a3f10; }
.tag--on-navy { background: rgba(255, 255, 255, 0.12); color: var(--on-navy); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.4rem 0.8rem;
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-pill);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-current="page"],
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip__count { font-family: var(--font-mono); font-size: var(--text-xs); opacity: 0.7; }

/* ---- Cards ----------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card__media {
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--contain img { object-fit: contain; padding: var(--space-md); }
.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-md);
  flex: 1;
}
.card__title { margin: 0; font-size: var(--text-lg); line-height: 1.25; }
.card__text { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
.card__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--space-2xs); align-items: center; }
.card__foot { padding: 0 var(--space-md) var(--space-md); }

/* ---- Section heading ------------------------------------------------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.section-head__title { margin: 0; font-size: var(--text-2xl); }
.section-head__text { margin: var(--space-2xs) 0 0; color: var(--ink-soft); font-size: var(--text-sm); }

/* ---- Breadcrumbs ----------------------------------------------------- */
.crumbs { font-size: var(--text-sm); color: var(--muted); margin-block: var(--space-sm) var(--space-md); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45em; padding: 0; margin: 0; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.45em; opacity: 0.45; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); }

/* ---- Data display ---------------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.spec-table caption { text-align: left; font-size: var(--text-sm); color: var(--muted); padding-bottom: var(--space-2xs); }
.spec-table th,
.spec-table td { padding: 0.65rem 0.75rem; text-align: left; vertical-align: top; border-bottom: var(--border); }
.spec-table th { width: 38%; font-weight: 500; color: var(--ink-soft); }
.spec-table td { font-family: var(--font-mono); font-size: 0.82rem; }
.spec-table tr:first-child th,
.spec-table tr:first-child td { border-top: var(--border); }

.fact-list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.5rem var(--space-md); font-size: var(--text-sm); }
.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; }

.limit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2xs); }
.limit-list li {
  padding: 0.6rem 0.8rem;
  background: var(--warn-tint);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
}

/* ---- Blocks ---------------------------------------------------------- */
.plan-note {
  margin-block: var(--space-md);
  padding: var(--space-md);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, rgba(181, 87, 24, 0.05) 0 10px, transparent 10px 20px), var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.plan-note__title {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.plan-note ul { margin: 0; padding-left: 1.1em; }
.plan-note li { margin-top: 0.3em; }
.plan-note strong { color: var(--ink); }

.cta-band {
  display: grid;
  gap: var(--space-md);
  align-items: center;
  padding: clamp(1.75rem, 4vw, var(--space-xl));
  background: var(--navy);
  color: var(--on-navy);
  border-radius: var(--radius-lg);
}
.cta-band h2 { color: #fff; font-size: var(--text-2xl); margin-bottom: var(--space-2xs); }
.cta-band p { color: var(--on-navy-muted); margin: 0; }
@media (min-width: 48rem) {
  .cta-band { grid-template-columns: minmax(0, 1fr) auto; }
}

.empty-state {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}
.empty-state h2 { font-size: var(--text-xl); color: var(--ink); }

.pagination { display: flex; gap: var(--space-2xs); margin-top: var(--space-xl); flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex;
  min-width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding-inline: 0.6rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  font-size: var(--text-sm);
}
.pagination .current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Forms ----------------------------------------------------------- */
.form-grid { display: grid; gap: var(--space-sm); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--text-sm); font-weight: 500; }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: var(--text-sm);
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field__hint { font-size: var(--text-xs); color: var(--muted); }
.form-note { font-size: var(--text-xs); color: var(--muted); }
[data-status] { font-size: var(--text-sm); color: var(--ink-soft); margin: var(--space-xs) 0 0; }

/* ---- Site header ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: var(--space-md); min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand__logo { display: block; max-height: 34px; width: auto; }
.brand__name { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-xs); }

.site-nav { display: none; }
.nav-list { display: flex; align-items: center; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }
.nav-list > li { margin: 0; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.5rem 0.7rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-link:hover { background: rgba(15, 27, 36, 0.06); color: var(--ink); }
.nav-link[aria-current="page"], .nav-link.is-current { color: var(--ink); }
.nav-link[data-trigger] { border: 0; background: none; font: inherit; cursor: pointer; }
.nav-link[data-trigger]::after { content: "▾"; font-size: 0.7em; opacity: 0.6; }

.nav-drop { position: relative; }
/* One label, two targets: the word goes to the catalogue, the caret opens the families. */
.nav-drop--split { display: inline-flex; align-items: center; }
.nav-drop--split .nav-link--lead { padding-right: 0.2rem; }
.nav-drop--split .nav-link--toggle { padding: 0.5rem 0.55rem 0.5rem 0.2rem; }
.nav-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 30;
  width: min(46rem, 82vw);
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-panel[hidden] { display: none; }
.nav-panel__grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.nav-panel__group h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-panel__list { list-style: none; margin: 0; padding: 0; }
.nav-panel__list li { margin: 0; }
.nav-panel__list a { display: block; padding: 0.22rem 0; font-size: var(--text-sm); color: var(--ink-soft); text-decoration: none; }
.nav-panel__list a:hover { color: var(--accent); }
.nav-panel__all { margin-top: var(--space-sm); padding-top: var(--space-2xs); border-top: var(--border); }

.menu-toggle { display: inline-flex; }
.drawer-nav { padding: 0; border: 0; width: min(22rem, 88vw); height: 100dvh; max-height: none; margin: 0 0 0 auto; border-radius: 0; }
.drawer-nav::backdrop { background: rgba(12, 31, 45, 0.45); }
.drawer-nav__inner { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-md); }
.drawer-nav__group h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer-nav__list { list-style: none; padding: 0; margin: 0; }
.drawer-nav__list a { display: block; padding: 0.45rem 0; text-decoration: none; border-bottom: var(--border); }

@media (min-width: 62rem) {
  .site-nav { display: block; }
  .menu-toggle { display: none; }
}

/* ---- Site footer ----------------------------------------------------- */
.site-footer { background: var(--navy-deep); color: var(--on-navy); padding-block: var(--space-xl) var(--space-md); }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.footer-col h2, .footer-col h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}
.footer-list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.footer-list li { margin: 0.3rem 0; }
.footer-col p { color: var(--on-navy-muted); font-size: var(--text-sm); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: var(--text-xs);
  color: var(--on-navy-muted);
}

/* ---- Page furniture -------------------------------------------------- */
.hero { padding-block: clamp(2rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid { display: grid; gap: clamp(1.75rem, 4vw, 3rem); align-items: center; }
.hero__body h1 { font-size: var(--text-4xl); max-width: 22ch; }
.hero__body p { color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-md); }
.hero__media { position: relative; }
.hero__media img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--border);
}
.hero__stat-value { font-family: var(--font-mono); font-size: var(--text-xl); display: block; }
.hero__stat-label { font-size: var(--text-xs); color: var(--muted); }
@media (min-width: 62rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.page-head { padding-block: var(--space-md) var(--space-lg); border-bottom: var(--border); margin-bottom: var(--space-lg); }
.page-head h1 { margin-bottom: var(--space-xs); }
.page-head .lede { margin: 0; }

.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--radius); }
.figure figcaption { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-2xs); }

.rule { border: 0; border-top: var(--border); margin-block: var(--space-lg); }

.panel {
  padding: var(--space-md);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}
.panel--sticky { position: sticky; top: calc(var(--header-height) + 1rem); }
.panel__title { margin: 0 0 var(--space-xs); font-size: var(--text-sm); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.split { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 52rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { margin: 0; padding: 0.5rem 0; border-bottom: var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain a { text-decoration: none; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-md); }
.steps li { counter-increment: step; position: relative; padding-left: 2.75rem; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-pill);
}
@media (min-width: 52rem) { .steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Header extras --------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.search-form { display: flex; gap: var(--space-2xs); }
.search-form input[type="search"] {
  font: inherit;
  font-size: var(--text-sm);
  padding: 0.55rem 0.7rem;
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.nav-panel--search { width: min(24rem, 88vw); padding: var(--space-sm); }

.locale-switch { display: flex; gap: 0.35rem; list-style: none; margin: 0; padding: 0; font-size: var(--text-xs); }
.locale-switch li { margin: 0; }
.locale-switch a {
  display: inline-flex;
  padding: 0.25rem 0.45rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.locale-switch a:hover { color: var(--ink); border-color: var(--line); }
.locale-switch a[aria-current="true"] { color: var(--ink); border-color: var(--line-strong); }

@media (max-width: 61.99rem) {
  .site-header__actions > .nav-drop,
  .site-header__actions > .locale-switch { display: none; }
}
