/* ── Granid — style.css — website-specific layer on top of granid-designsystem ──
   Tokens (colors, type, spacing, radii) come from vendor/granid-ds via
   css/granid-imports.css. This file only contains website-specific layout,
   nav/footer chrome, and page shells. See GWEB-37 audit and GWEB-38. */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

/* ── Typography ── */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: 3.25rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

p {
  color: var(--muted);
  max-width: 640px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Layout ── */

.container {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* ── Navigation ── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

/* DS .btn sets color via var(--on-ink); without this override the
   .nav-links a rule above wins on specificity and the nav CTA reads
   as muted-gray on a dark button. */
.nav-links a.btn,
.nav-links a.btn:hover {
  color: var(--on-ink);
}

.nav-lang {
  display: flex;
  gap: 0.375rem;
}

.nav-lang a {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-lang a:hover,
.nav-lang a.active {
  color: var(--ink);
  background: var(--surface);
}

/* Disabled language on English-only pages (blog, terms) */
.nav-lang .lang-off {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: default;
}

/* Visually-hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Coming-soon badges now use DS .badge (vendor/granid-ds/components/feedback.css). */

/* Nav submenu */
.has-submenu {
  position: relative;
}

.submenu-trigger {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: default;
  padding: 0;
  transition: color 0.2s;
}

.submenu-trigger:hover,
.has-submenu:hover .submenu-trigger,
.has-submenu:focus-within .submenu-trigger {
  color: var(--ink);
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 0.5rem 0;
  min-width: 220px;
  list-style: none;
  z-index: 100;
  box-shadow: var(--shadow-3);
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  display: block;
}

.submenu li {
  margin: 0;
}

.submenu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.submenu a:hover {
  color: var(--ink);
  background: var(--surface);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  transition: all 0.3s;
}

/* ── Hero: every hero on the site uses DS .mk-hero
   (vendor/granid-ds/patterns/marketing.css). The website doesn't use
   the right-column .figure pattern (the trust strip below the hero
   serves that role), so override the DS 2-col grid to single-column
   on every .mk-hero. The .mk-hero--compact variant below is used on
   /hardware/* and /products/*. The .hero-tagline rule remains because
   ~50 non-homepage pages still use it as the page eyebrow. ── */

/* Force single-column hero site-wide — the .figure column is unused. */
.mk-hero {
  grid-template-columns: 1fr;
}

/* Mobile collapse — tighten padding + smaller h1 below 768px. */
@media (max-width: 768px) {
  .mk-hero {
    padding: 5rem 1.5rem 3rem;
    gap: 32px;
  }
  .mk-hero h1 {
    font-size: 2.5rem;
  }
  /* DS .mk-pricing ships no media query either; collapse 3-col grid below 768px. */
  .mk-pricing .grid {
    grid-template-columns: 1fr;
  }
  /* DS .mk-features is 4-col with no media query; collapse to 2-col at 768px. */
  .mk-features {
    grid-template-columns: 1fr 1fr;
  }
  /* The .mk-hero--compact rule below has higher specificity than the
     global .mk-hero h1 media rule, so override its padding + h1 size
     explicitly here. */
  .mk-hero--compact {
    padding: 5rem 1.5rem 3rem;
  }
  .mk-hero--compact h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 480px) {
  .mk-features {
    grid-template-columns: 1fr;
  }
}

/* Single-column compact hero variant (no .figure column).
   Used by /hardware/* and /products/*. */
.mk-hero--compact {
  grid-template-columns: 1fr;
  padding: 6rem 32px 3rem;
}
.mk-hero--compact::before {
  display: none;
}
.mk-hero--compact h1 {
  font-size: 48px;
  margin: 12px 0 20px;
  max-width: 24ch;
}
/* When the eyebrow holds both a product name and a status badge
   (e.g. "Voice Intelligence by Granid · Coming soon"), wrap on
   narrow viewports so the badge drops below instead of overflowing. */
.mk-hero--compact .eyebrow {
  flex-wrap: wrap;
}

.hero-tagline {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* ── Buttons: see vendor/granid-ds/components/buttons.css for .btn .btn--sec
   .btn--ghost .btn--danger .btn--sm .btn--lg. The .btn--full modifier below
   is a website-specific full-width extension (used on form submits and
   pricing-card CTAs) — not part of the DS. ── */

.btn--full {
  width: 100%;
  text-align: center;
}

/* ── Highlights (3-col under hero) ── */

.highlights {
  padding: 0 0 5rem;
  border-bottom: 1px solid var(--line);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.highlight-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.highlight-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 1.25rem;
}

.highlight-card .title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.highlight-card p {
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ── Problem / Solution ── */

.problem {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.problem .container,
.solution .container {
  text-align: center;
}

.problem h2,
.solution h2 {
  margin-bottom: 1.5rem;
}

.problem p,
.solution p {
  margin: 0 auto;
  font-size: 1.0625rem;
}

/* Expanded "problem with cloud AI" block: centered lead + close, with a
   left-aligned 2-col grid of exposure points capped for readability. */
/* Scoped under .problem so these beat the `.problem p { margin: 0 auto }`
   rule above (which would otherwise shadow the close paragraph's margin). */
.problem .problem-lead,
.problem .problem-close {
  max-width: 720px;
}
.problem .problem-close {
  margin-top: 2rem;
}
.problem-points {
  list-style: none;
  text-align: left;
  max-width: 720px;
  margin: 2rem auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
}
.problem-points li {
  font-size: 0.9375rem;
  line-height: 1.55;
}
/* Seven points in two columns leave a lone tail item; let it span the
   full width so the grid closes cleanly. */
.problem-points li:last-child {
  grid-column: 1 / -1;
}
.problem-points strong {
  color: var(--ink);
}
@media (max-width: 768px) {
  .problem-points {
    grid-template-columns: 1fr;
  }
}

/* ── Features: now via DS .mk-features + .feat
   (vendor/granid-ds/patterns/marketing.css). ── */

/* Site override: DS ships .mk-features as a 4-col grid; the homepage now
   carries six feature cards, so render a balanced 3-col grid (2×3). The
   768px / 480px breakpoints above still collapse it to 2-col / 1-col. */
.mk-features {
  grid-template-columns: repeat(3, 1fr);
}

/* DS styles .feat h4; the website uses <h3> to keep the heading
   hierarchy under the section <h2> contiguous (no h2→h4 skip). */
.mk-features .feat h3 {
  font-size: var(--t-lg);
  font-weight: 500;
}

/* ── Pricing: now via DS .mk-pricing + .tier
   (vendor/granid-ds/patterns/marketing.css). Site-specific overrides below. ── */

/* The pricing .head is content-heavy (heading + lede paragraph). The DS
   2-col grid splits them awkwardly on desktop; render as a single column. */
.mk-pricing .head {
  grid-template-columns: 1fr;
}

/* Trial-promotion alert above the grid: the DS .alert defaults to
   --t-xs and opacity 0.85 (built for transient feedback). This is a
   persistent CTA strip, so lift to body weight + drop the icon column. */
.mk-pricing .alert {
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 720px;
  text-align: center;
}
.mk-pricing .alert .body {
  font-size: var(--t-sm);
  opacity: 1;
}
.mk-pricing .alert a {
  font-weight: 500;
}

/* Enterprise / inquiry-style tier: no fixed price, so shrink .price
   from the DS 40px down to a body-level prompt. Avoids the locale
   asymmetry of "Auf Anfrage" / "Sur devis" / "Su richiesta" ballooning. */
.mk-pricing .tier--inquiry .price {
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

/* ── Contact ── */

.contact .container {
  max-width: 560px;
  text-align: center;
}

.contact h2 {
  margin-bottom: 0.75rem;
}

.contact > .container > p {
  margin: 0 auto 2.5rem;
}

/* ── Form layout: see vendor/granid-ds/components/forms.css for .field
   .input .check .radio (DS owns the atoms). The rules below are
   website-specific extensions: 2-col field row, inline error chrome,
   global error banner, "(optional)" label hint, fieldset reset. ── */

.field .optional {
  font-weight: 400;
  color: var(--muted);
}

/* ── Footer ── */

footer {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-right {
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-right > * + * {
  margin-left: 1.5rem;
}

.footer-right a {
  color: var(--muted);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-right a:hover {
  color: var(--ink);
}

.footer-right svg {
  width: 15px;
  height: 15px;
}

/* ── Trial form page ── */

.trial-page {
  padding: 8rem 0 5rem;
}

.trial-page .container {
  max-width: 640px;
}

.trial-page h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  max-width: none;
}

.trial-intro {
  margin-bottom: 3rem;
  font-size: 1rem;
  max-width: none;
}

.trial-form {
  display: grid;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

fieldset.field {
  margin: 0;
  border: none;
  padding: 0;
  min-width: 0;
}

fieldset.field legend {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

/* Layout wrapper for grouped radios — DS .radio styles each option,
   this just lays them out horizontally with wrap. */
.form-radio-group {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* Restore pill-style tap targets around DS .radio inside a radio group.
   DS .radio on its own is ~20px tall, below WCAG 2.5.8 (24x24 min).
   Padding+border bring each option to ~36px and recreate the affordance
   the website had before the migration. */
.form-radio-group .radio {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--paper);
  transition: border-color 0.2s, background 0.2s;
}
.form-radio-group .radio:hover {
  border-color: var(--line-hover);
  background: var(--surface);
}

/* DS .check/.radio set appearance:none with no :focus-visible ring.
   Add one so keyboard users can see where focus is. Track upstream in GDS. */
.check input:focus-visible,
.radio input:focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
}

/* The privacy-acknowledgement .check label is a multi-line paragraph;
   anchor the box to the first line. DS .check defaults to align-items:
   center which floats the box mid-paragraph. */
.field > .check {
  align-items: flex-start;
}
.field > .check input {
  margin-top: 2px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.375rem;
  display: none;
}

.form-error.active {
  display: block;
}

.form-error-global {
  font-size: 0.875rem;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid color-mix(in oklch, var(--danger) 30%, transparent);
  border-radius: var(--r-lg);
  padding: 0.875rem 1rem;
  display: none;
}

.form-error-global.active {
  display: block;
}


@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.trial-sent .container {
  text-align: center;
}

.trial-sent .trial-intro {
  margin-left: auto;
  margin-right: auto;
}

/* ── Checkout (fake Stripe-like) ── */

.checkout-page {
  padding: 7rem 0 5rem;
}

.checkout-page .container {
  max-width: 960px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 4rem;
  align-items: start;
}

.checkout-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 2rem;
  position: sticky;
  top: 5rem;
}

.checkout-summary .hero-tagline {
  margin-bottom: 0.75rem;
}

.checkout-summary h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.checkout-tier-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--line);
  max-width: none;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
  color: var(--muted);
  padding: 0.5rem 0;
}

.checkout-line strong {
  color: var(--ink);
  font-weight: 600;
}

.checkout-total {
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-size: 1.0625rem;
  color: var(--ink);
}

.checkout-total span:last-child strong {
  font-size: 1.25rem;
}

.checkout-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 1rem 0 0;
  max-width: none;
}

.checkout-form-wrapper h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  max-width: none;
}

.checkout-intro {
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
  max-width: none;
}

@media (max-width: 800px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .checkout-summary {
    position: static;
  }
}

/* ── Thank you page ── */

.thankyou {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.thankyou h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.thankyou p {
  margin: 0 auto 2rem;
}

/* ── Hardware spec pages: website-specific section shells consuming
   DS tokens. DS has no exact equivalents for full-bleed coloured
   bands or the cross-link CTA strip. ── */

/* .disclaimer — full-bleed warning band (used on /hardware/trial to
   warn that trial data leaves the office). Danger-bg + danger borders. */
.disclaimer {
  background: var(--danger-bg);
  border-top: 1px solid color-mix(in oklch, var(--danger) 30%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--danger) 30%, transparent);
}

.disclaimer .container {
  text-align: center;
  max-width: 720px;
}

.disclaimer h2 {
  color: var(--danger);
  margin-bottom: 1.25rem;
}

.disclaimer p {
  margin: 0 auto 1rem;
  font-size: 1rem;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

.disclaimer strong {
  color: var(--ink);
  font-weight: 600;
}

/* .selling-point — full-bleed positive-emphasis band (used on
   /hardware/production to reinforce data sovereignty). Success-bg +
   success borders and heading. */
.selling-point {
  background: var(--success-bg);
  border-top: 1px solid color-mix(in oklch, var(--success) 30%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--success) 30%, transparent);
}

.selling-point .container {
  text-align: center;
  max-width: 720px;
}

.selling-point h2 {
  color: var(--success-text);
  margin-bottom: 1.25rem;
}

.selling-point p {
  margin: 0 auto 1rem;
  font-size: 1rem;
}

.selling-point p:last-child {
  margin-bottom: 0;
}

.selling-point strong {
  color: var(--ink);
  font-weight: 600;
}

/* .cross-link — centred CTA strip at the bottom of hardware pages. */
.cross-link {
  text-align: center;
}

.cross-link h2 {
  margin-bottom: 1rem;
}

.cross-link p {
  margin: 0 auto 2rem;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.5rem; }
  section { padding: 3.5rem 0; }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

}

/* Nav collapses to the burger at ≤1024px. The pre-launch teaser nav is five
   items + the language switcher, no CTA (GWEB-64 removed Plans + the trial
   button); the 1024px breakpoint predates that and can be revisited when the
   commercial nav returns. The typography/grid breakpoints above stay at 768px
   — only the nav moves up. (GWEB-55, GWEB-64) */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  /* Mobile: collapse submenu inline, hide trigger button */
  .submenu-trigger {
    display: none;
  }
  .submenu {
    display: block;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 0 1rem;
    min-width: 0;
  }
  .submenu a {
    padding: 0.375rem 0;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
}

/* ── Legal page (Terms & Conditions) ── */

.legal .container {
  max-width: 720px;
}

.legal h2 {
  font-size: 1.375rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.legal p {
  max-width: none;
  margin-bottom: 1rem;
}

.legal-preamble {
  margin-bottom: 1.5rem;
}

.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  color: var(--ink);
}

.legal-defs {
  margin: 0 0 1rem;
}

.legal-defs dt {
  color: var(--ink);
  font-weight: 600;
  margin-top: 1rem;
}

.legal-defs dt:first-child {
  margin-top: 0;
}

.legal-defs dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: none;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

.legal-table thead th {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}

.legal-table tbody th {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.legal-contact {
  font-style: normal;
  margin-top: 1rem;
  color: var(--muted);
  line-height: 1.8;
}

.legal-contact a {
  color: var(--accent);
}

@media (max-width: 600px) {
  .legal-table {
    font-size: 0.875rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.6rem 0.5rem;
  }
}

/* ── Blog (GWEB-55) ──────────────────────────────────────────────────────
   Two shells: the blog index (topics sidebar + featured + grid + pager) and
   .article (single post). Both index and posts are emitted by tools/ scripts:
   render_blog.py builds the index, render_post.py builds each post.
   Topic filtering + pagination are client-side in js/blog.js (no build step).
   Tokens come from vendor/granid-ds. */

/* Index header */
.blog-index-head {
  padding-top: 8rem;
  padding-bottom: 1.5rem;
}

.blog-index-head h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Section wrapper: defer vertical rhythm to .blog-layout */
.blog-list {
  padding-top: 0;
}

/* Layout: single main column (topics sidebar removed pre-launch, GWEB-68). */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-top: 1rem;
  padding-bottom: 6rem;
  align-items: start;
}

/* Blog topics sidebar: markup removed pre-launch (GWEB-68, single-post blog);
   rules retained for when the topic filter returns. */
.blog-sidebar {
  position: sticky;
  top: 6rem;
}

.blog-sidebar h2 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.blog-topics {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.blog-topics button {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
}

.blog-topics button:hover {
  background: var(--surface);
  color: var(--ink);
}

.blog-topics button.active {
  background: var(--ink);
  color: var(--on-ink);
}

/* Card grid */
.blog-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.blog-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.blog-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.blog-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.blog-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.blog-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-card__meta {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.blog-card h3 {
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--ink);
}

.blog-card p {
  color: var(--muted);
  font-size: var(--t-sm);
  margin: 0;
  max-width: none;
}

/* Featured = first visible card, spans the full row */
.blog-card.is-featured {
  grid-column: 1 / -1;
}

.blog-card.is-featured a {
  flex-direction: row;
}

.blog-card.is-featured .blog-card__media {
  width: 55%;
  aspect-ratio: 16 / 9;
  border-bottom: none;
  border-right: 1px solid var(--line);
}

.blog-card.is-featured .blog-card__body {
  padding: 2.5rem;
  justify-content: center;
  gap: 0.75rem;
}

.blog-card.is-featured h3 {
  font-size: 1.9rem;
}

.blog-card.is-featured p {
  font-size: 1.0625rem;
}

/* Empty state (no posts match the selected topic) */
.blog-empty {
  grid-column: 1 / -1;
  padding: 3rem 0;
  color: var(--muted);
}

/* Pagination */
.blog-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3rem;
}

.blog-pager button {
  appearance: none;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.blog-pager button:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--line-strong);
}

.blog-pager button.active {
  background: var(--ink);
  color: var(--on-ink);
  border-color: var(--ink);
}

.blog-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .blog-sidebar {
    position: static;
  }
  .blog-topics {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .blog-topics button {
    width: auto;
    border: 1px solid var(--line);
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-card.is-featured a {
    flex-direction: column;
  }
  .blog-card.is-featured .blog-card__media {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .blog-card.is-featured .blog-card__body {
    padding: 1.5rem;
  }
  .blog-card.is-featured h3 {
    font-size: 1.4rem;
  }
}

@media (max-width: 520px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Article hero (top of a single post) */
.article-hero {
  margin: 0 0 2rem;
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}

/* Article shell */
.article {
  padding-top: 8rem;
  padding-bottom: 6rem;
}

.article-inner {
  max-width: var(--col-narrow);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-header h1 {
  font-size: 2.75rem;
  margin: 0.75rem 0 1rem;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.article-tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-tag {
  font-size: var(--t-xs);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

/* Article body — editorial typography */
.article-body > * {
  max-width: none;
}

.article-body p,
.article-body ul,
.article-body ol {
  color: var(--ink-soft);
  font-size: 1.125rem;
  line-height: 1.75;
  margin: 0 0 1.5rem;
  max-width: none;
}

.article-body h2 {
  font-size: 1.6rem;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
}

.article-body h3 {
  font-size: 1.25rem;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* Lede */
.article-body .lede {
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 2rem;
}

/* Figure (responsive image) */
.article-figure {
  margin: 2.5rem 0;
}

.article-figure img,
.article-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.article-figure figcaption {
  margin-top: 0.75rem;
  font-size: var(--t-sm);
  color: var(--muted);
  text-align: center;
}

/* Responsive 16:9 video — self-hosted only, no third-party iframe */
.article-video {
  margin: 2.5rem 0;
}

.article-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  background: var(--ink);
}

/* Callout (blockquote) */
.article-callout {
  margin: 2.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
}

.article-callout p {
  margin: 0;
  color: var(--ink);
  font-size: 1.125rem;
}

/* Code */
.article-body pre {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  line-height: 1.6;
}

.article-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* Back-to-blog footer link inside an article */
/* End-of-article conversion block */
.article-cta {
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}

.article-cta p {
  color: var(--ink);
  font-size: 1.125rem;
  max-width: none;
  margin: 0 0 1.25rem;
}

.article-cta .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.article-back {
  margin-top: 2rem;
  text-align: center;
}

.article-back a {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 768px) {
  .article-header h1 { font-size: 2.1rem; }
  .blog-index-head h1 { font-size: 2rem; }
  .article-body p,
  .article-body ul,
  .article-body ol { font-size: 1.0625rem; }
}

@media (max-width: 480px) {
  .blog-card a { padding: 1.5rem; }
}
