/* Contentify Sites — the published-site stylesheet.
 *
 * Hand-written, not a Tailwind build: published pages are static HTML from Jinja
 * with no build step and no runtime JS, and keeping it that way is what makes a
 * page a single cached file at the edge.
 *
 * EVERY design decision lives in a token below. That is deliberate — per-site
 * theming (SITES-6) becomes "write a different :root block into this site's
 * stylesheet", with the renderer, the blocks, and every layout rule unchanged.
 * Tokens are the theme API; nothing else needs to become configurable.
 *
 * Rules for editing:
 *  - No raw colour, size, or duration below the token block. If you need a new
 *    value, add a token.
 *  - Interactive elements need a visible :focus-visible state. Keyboard users
 *    are not optional.
 *
 * Known limit: CSS custom properties cannot be used inside media-query
 * conditions, so breakpoints are the one design value that stays literal.
 * A theme can restyle everything; it cannot move a breakpoint.
 */

:root {
  /* --- colour ------------------------------------------------------------ */
  --ink:          #0f172a;   /* primary text */
  --ink-soft:     #52627a;   /* secondary text — AA on --surface */
  --ink-faint:    #5f6e85;   /* meta text — AA on both surfaces (see contrast test) */
  --line:         #e4e9f0;   /* hairlines */
  --line-strong:  #cbd5e1;
  --surface:      #ffffff;
  --surface-alt:  #f7f9fc;   /* alternating section band */
  --surface-deep: #0f172a;   /* inverted section (CTA) */
  --on-deep:      #ffffff;   /* text on --surface-deep */
  --on-deep-soft: #c7d2e5;
  --deep-line:    #33415c;
  --deep-raise:   #1e293b;   /* hover fill on inverted surfaces */
  --deep-line-hi: #475569;
  --accent:       #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft:  #eef2ff;   /* tinted chips, icon wells */
  --accent-ink:   #ffffff;
  /* full-bleed hero (D-V5): a strong dark scrim over the background image keeps
     overlaid text readable whatever the image; --on-scrim is the text on it. */
  --hero-scrim:   linear-gradient(180deg, rgba(2, 6, 23, 0.45), rgba(2, 6, 23, 0.7));
  --on-scrim:     #ffffff;

  /* --- type -------------------------------------------------------------- */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  /* Display font for headings — defaults to the body font; a theme can pair a
     distinct heading face (e.g. a serif display) with the body text. */
  --font-heading: var(--font);
  /* Modular scale, fluid between a 360px and a 1280px viewport. */
  --text-xs:   0.78rem;
  --text-sm:   0.9rem;
  --text-base: 1rem;
  --text-lg:   clamp(1.05rem, 0.99rem + 0.28vw, 1.2rem);
  --text-xl:   clamp(1.2rem,  1.1rem  + 0.5vw,  1.45rem);
  --text-2xl:  clamp(1.5rem,  1.3rem  + 1vw,   2.1rem);
  --text-3xl:  clamp(2.1rem,  1.6rem  + 2.4vw, 3.4rem);
  --leading-tight: 1.12;
  --leading-snug:  1.35;
  --leading-body:  1.65;
  --tracking-tight: -0.022em;
  --measure: 62ch;           /* readable line length for prose */

  /* --- space ------------------------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: clamp(56px, 4vw + 32px, 96px);   /* vertical section rhythm */
  --gap: var(--space-5);
  --container: 1120px;
  --container-narrow: 720px;
  --gutter: clamp(20px, 4vw, 32px);

  /* --- form -------------------------------------------------------------- */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --icon-well: 44px;
  --card-min:  230px;   /* grid track minimum before wrapping */
  --logo-h:    34px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow:    0 2px 4px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 18px 40px rgba(15, 23, 42, 0.10);
  /* Derived from --accent so a theme change carries through automatically. */
  --ring:  0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
  --glow:  color-mix(in srgb, var(--accent) 50%, transparent);
  --motion: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

/* Headings use the themeable display font. Grouped here so a theme's `--font-heading`
   restyles every heading at once, with no per-block change. */
.hero__headline, .section__heading, .cta-band__headline, .vp-card__title,
.fg-item__title, .article__title, .post-card__title,
.prose h2, .prose h3, .article__body h2, .article__body h3 {
  font-family: var(--font-heading);
}

a { color: var(--accent); text-underline-offset: 0.18em; }

/* Keyboard focus is visible everywhere, once. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  background: var(--ink);
  color: var(--on-deep);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 20;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

/* --- sections ------------------------------------------------------------ */

.section { padding: var(--section-y) 0; }

/* Alternating bands give the page rhythm; without them every section reads as
   one undifferentiated column. */
.feature-grid,
.faq { background: var(--surface-alt); }

.section__heading {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
.section__subhead {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 var(--space-6);
  font-size: var(--text-lg);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  margin: 0 0 var(--space-4);
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--motion), border-color var(--motion),
              transform var(--motion), box-shadow var(--motion);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--ink-faint); }
.btn:active { transform: translateY(1px); }

/* --- site chrome --------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 64px;
}
.site-header__brand {
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-decoration: none;
}
.site-header__right { display: flex; align-items: center; gap: var(--space-5); }
.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-nav__link {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  transition: color var(--motion);
}
.site-nav__link:hover { color: var(--ink); }

.lang-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.lang-switch__link {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background var(--motion), color var(--motion);
}
.lang-switch__link:hover { background: var(--surface-alt); color: var(--ink); }
.lang-switch__link.is-current { background: var(--accent); color: var(--accent-ink); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  padding: var(--space-7) 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-footer__nav a { color: var(--ink-soft); text-decoration: none; }
.site-footer__nav a:hover { color: var(--ink); }

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding: calc(var(--section-y) + var(--space-5)) 0 var(--section-y);
  background:
    radial-gradient(60ch 40ch at 15% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--surface-alt), var(--surface));
  border-bottom: 1px solid var(--line);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}
.hero__headline {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
.hero__subhead {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 var(--space-6);
  text-wrap: pretty;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero__media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) {
  .hero--standard .hero__inner { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-8); }
}

/* hero variants (D-V5) — same content, different arrangement. `standard` is the
   base rules above; these modifiers restyle without touching a token. */
.hero--centered { text-align: center; }
.hero--centered .hero__inner { grid-template-columns: 1fr; justify-items: center; }
.hero--centered .hero__content { max-width: 62ch; }
.hero--centered .hero__subhead { margin-left: auto; margin-right: auto; }
.hero--centered .hero__ctas { justify-content: center; }
.hero--centered .hero__media { width: 100%; margin-top: var(--space-5); }

/* full-bleed: copy overlaid on a background image, or a solid deep surface when
   there is no image. The scrim carries the text contrast (image content, not a
   token pair), so it is deliberately strong; the no-image case falls back to the
   AA-guaranteed --on-deep / --surface-deep pair. */
.hero--full-bleed {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface-deep); color: var(--on-deep); border-bottom: 0;
}
.hero--full-bleed .hero__inner { grid-template-columns: 1fr; }
.hero--full-bleed .hero__content { max-width: 62ch; }
.hero--full-bleed .hero__subhead,
.hero--full-bleed .eyebrow { color: inherit; }
.hero--full-bleed .hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero--full-bleed .hero__bg img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none;
}
.hero--full-bleed.hero--has-bg { color: var(--on-scrim); }
.hero--full-bleed.hero--has-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-scrim);
}
/* On the full-bleed scrim the eyebrow pill and the ghost button must flip to the light treatment:
   the default accent-soft pill and --ink button text are unreadable over the dark image. Tie them to
   the overlaid text colour via currentColor so both scrim and no-image (deep-surface) cases work. */
.hero--full-bleed .eyebrow {
  background: transparent; border: 1px solid currentColor; color: inherit;
}
.hero--full-bleed .btn--ghost { color: inherit; border-color: currentColor; }
.hero--full-bleed .btn--ghost:hover { background: var(--deep-raise); border-color: currentColor; }

/* --- value props --------------------------------------------------------- */

.vp-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
}
.vp-card {
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--motion), transform var(--motion),
              border-color var(--motion);
}
.vp-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.vp-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-well);
  height: var(--icon-well);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.vp-card__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}
.vp-card__body { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); }
/* value_props variant (D-V5.2): `cards` is the base; `plain` strips the card chrome. */
.value-props--plain .vp-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.value-props--plain .vp-card:hover { box-shadow: none; transform: none; border-color: transparent; }

/* --- feature grid -------------------------------------------------------- */

.fg-grid {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: var(--space-6);
}
.fg-item__media img {
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.fg-item__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}
.fg-item__body { margin: 0; color: var(--ink-soft); }

/* feature-grid variants (D-V5). `plain` is the base rules above; `cards` fills each
   item, `bordered` outlines it — both token-only, text stays AA on --surface-alt. */
.feature-grid--cards .fg-item,
.feature-grid--bordered .fg-item {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}
.feature-grid--cards .fg-item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.feature-grid--bordered .fg-item { border: 1px solid var(--line-strong); }

/* --- stats band (D-V4) --------------------------------------------------- */
.stats-band { background: var(--surface-alt); }
.section__heading--center { text-align: center; }
.stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-6) var(--space-5);
  text-align: center;
}
.stat { margin: 0; }
.stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: var(--tracking-tight);
  color: var(--accent);
}
.stat__label { margin: var(--space-2) 0 0; color: var(--ink-soft); font-size: var(--text-sm); }
/* stats variant (D-V5.2): `plain` is the base; `bordered` boxes each metric. */
.stats-band--bordered .stat { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }

/* --- steps (D-V4) -------------------------------------------------------- */
.steps {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: var(--gap);
}
.step { display: flex; gap: var(--space-4); align-items: flex-start; }
.step__num {
  flex: none;
  width: var(--icon-well);
  height: var(--icon-well);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.step__title { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-weight: 600; }
.step__text { margin: 0; color: var(--ink-soft); }

/* --- feature rows (alternating image/text) (D-V4) ------------------------ */
.feature-rows { display: grid; gap: var(--space-8); margin-top: var(--space-6); }
.feature-row { display: grid; grid-template-columns: 1fr; gap: var(--space-5); align-items: center; }
.feature-row__title { margin: 0 0 var(--space-3); font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); }
.feature-row__body { margin: 0; color: var(--ink-soft); font-size: var(--text-lg); }
.feature-row__media img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
/* feature_rows variant (D-V5.2): `alternating` is the base; `boxed` cards each row. */
.feature-rows--boxed .feature-row {
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-6);
}
@media (min-width: 720px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .feature-row--reverse .feature-row__text { order: 2; }
}

/* --- gallery (D-V4) ------------------------------------------------------ */
.gallery {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: var(--gap);
}
.gallery__item { margin: 0; }
.gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.gallery__caption { margin: var(--space-2) 0 0; color: var(--ink-faint); font-size: var(--text-sm); }

/* --- pricing (D-V4) ------------------------------------------------------ */
.section__subhead--center { text-align: center; margin-left: auto; margin-right: auto; }
.pricing {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  align-items: start;
}
.price-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.price-card--featured { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.price-card__badge {
  position: absolute; top: calc(-1 * var(--space-3)); left: var(--space-6);
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: var(--space-1) var(--space-3); border-radius: 999px;
}
.price-card__name { margin: 0; font-size: var(--text-lg); }
.price-card__price {
  font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 700;
  line-height: 1; letter-spacing: var(--tracking-tight);
}
.price-card__period { font-size: var(--text-sm); font-weight: 400; color: var(--ink-faint); margin-left: var(--space-1); }
.price-card__desc { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); }
.price-card__features { list-style: none; margin: var(--space-2) 0; padding: 0; display: grid; gap: var(--space-2); }
.price-card__features li { position: relative; padding-left: var(--space-5); color: var(--ink-soft); font-size: var(--text-sm); }
.price-card__features li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.price-card__cta { margin-top: auto; text-align: center; }

/* --- testimonial spotlight (D-V4) ---------------------------------------- */
.testimonial-spotlight { text-align: center; }
.spotlight { margin: 0; }
.spotlight__quote {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.spotlight__quote::before { content: "\201C"; }
.spotlight__quote::after { content: "\201D"; }
.spotlight__author { margin-top: var(--space-4); }
.spotlight__name { font-weight: 700; }
.spotlight__meta { display: block; color: var(--ink-faint); font-size: var(--text-sm); }

/* --- social proof -------------------------------------------------------- */

.logo-strip {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  align-items: center;
}
.logo-strip__item span {
  font-weight: 700;
  color: var(--ink-faint);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}
.logo-strip__item img { max-height: var(--logo-h); width: auto; filter: grayscale(1); opacity: 0.7; }

.testimonials {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: var(--space-6);
}
.testimonial {
  margin: 0;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.testimonial__quote {
  margin: 0 0 var(--space-4);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--ink);
}
.testimonial__quote::before { content: "\201C"; }
.testimonial__quote::after  { content: "\201D"; }
.testimonial__author { display: block; font-weight: 700; font-size: var(--text-sm); }
.testimonial__meta { color: var(--ink-faint); font-size: var(--text-sm); }

/* --- FAQ ----------------------------------------------------------------- */

.faq-list { margin-top: var(--space-6); border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item__q {
  cursor: pointer;
  padding: var(--space-5) var(--space-6) var(--space-5) 0;
  font-weight: 600;
  font-size: var(--text-lg);
  list-style: none;
  position: relative;
  transition: color var(--motion);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q:hover { color: var(--accent); }
/* CSS chevron — rotates on open, no JS and no icon font. */
.faq-item__q::after {
  content: "";
  position: absolute;
  right: var(--space-2);
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--motion);
}
.faq-item[open] .faq-item__q::after { transform: translateY(-30%) rotate(225deg); }
.faq-item__a {
  padding: 0 var(--space-6) var(--space-5) 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* --- CTA band ------------------------------------------------------------ */

.cta-band {
  background:
    radial-gradient(50ch 30ch at 85% 110%, var(--glow), transparent 70%),
    var(--surface-deep);
  color: var(--on-deep);
}
.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
  justify-content: space-between;
}
.cta-band__headline {
  margin: 0;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.cta-band__subhead { margin: var(--space-2) 0 0; color: var(--on-deep-soft); }
.cta-band__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.cta-band .btn--ghost { border-color: var(--deep-line); color: var(--on-deep); }
.cta-band .btn--ghost:hover { background: var(--deep-raise); border-color: var(--deep-line-hi); }
/* cta variant (D-V5.2): `banner` is the base full-width deep band; `boxed` contains the deep panel
   in a card on the page surface. The panel keeps --surface-deep, so --on-deep text stays AA. */
.cta-band--boxed { background: var(--surface); color: var(--ink); }
.cta-band--boxed .cta-band__inner {
  background:
    radial-gradient(50ch 30ch at 85% 110%, var(--glow), transparent 70%),
    var(--surface-deep);
  color: var(--on-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-8);
}

/* --- text / prose -------------------------------------------------------- */

.text-section__inner {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: 1fr;
  align-items: start;
}
.text-section--left .text-section__media { order: -1; }
@media (min-width: 900px) {
  .text-section--left .text-section__inner,
  .text-section--right .text-section__inner {
    grid-template-columns: 1fr 1fr;
    max-width: var(--container);
  }
}
.prose { font-size: var(--text-lg); max-width: var(--measure); }
.prose h2 {
  font-size: var(--text-xl);
  margin: 1.6em 0 0.4em;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}
.prose h3 { font-size: var(--text-lg); margin: 1.3em 0 0.3em; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.25em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--accent); }
.prose a { text-decoration: underline; }
.prose a:hover { color: var(--accent-hover); }
.text-section__media img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* --- article (content-engine pages) -------------------------------------- */

.article { padding: var(--section-y) 0; }
.article__header { margin-bottom: var(--space-6); }
.article__meta {
  color: var(--ink-faint);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.article__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
.article__byline { color: var(--ink-soft); margin: 0; font-size: var(--text-base); }
.article__meta-sep { color: var(--line-strong); }
.article__hero { margin: 0 0 var(--space-7); }
.article__hero img {
  width: 100%;
  /* A fixed ratio so every article opens the same way regardless of what the
     image model returned — otherwise a tall generation pushes the first
     paragraph below the fold and a wide one reads as a banner. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
/* Let the hero out of the prose measure. The text wants ~720px; an image held to
   the same width reads as an illustration dropped into the column rather than
   the article's opening. Gated well above the width it needs (--container plus
   gutters) so it can never cause a horizontal scrollbar. */
@media (min-width: 1200px) {
  .article__hero {
    margin-inline: calc((var(--container-narrow) - var(--container)) / 2);
  }
}
.article__hero figcaption {
  color: var(--ink-faint);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}
.article__body img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: var(--space-7) 0;
  background: var(--accent-soft);   /* soft tint while a flat illustration loads */
}
/* A markdown image renders as a lone <img> inside its own <p>; strip that
   paragraph's spacing so the figure sits on its own with even rhythm. */
.article__body p:has(> img:only-child) { margin: 0; }
.article__body blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-5);
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
.article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}
.article__body th, .article__body td {
  border: 1px solid var(--line);
  padding: var(--space-3);
  text-align: left;
}
.article__body th { background: var(--surface-alt); font-weight: 600; }
.article__body pre {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  overflow-x: auto;
  font-size: var(--text-sm);
}
.article__body code { font-size: 0.92em; }

/* --- article prose -------------------------------------------------------- */
/* Markdown emits bare h2/h3/p/ul/hr with no class hooks, so these rules are the
 * only thing between a generated article and browser defaults — and browser
 * defaults are what made articles read as unstyled: symmetric heading margins
 * that leave a heading floating between two paragraphs instead of bound to the
 * one it introduces, and an h3 barely distinguishable from bold text. A typical
 * generated article carries 6 h2s, 11 h3s and 6 rules, so the hierarchy *is* the
 * reading experience.
 *
 * Scoped to .article__body throughout: the marketing blocks style themselves and
 * must not inherit prose rhythm.
 */

/* Long-form wants slightly more than UI text; the container already holds the
   line to a readable measure. */
.article__body { font-size: var(--text-lg); }

.article__body p,
.article__body ul,
.article__body ol,
.article__body figure { margin: 0 0 var(--space-5); }

/* More air above a heading than below it. This one asymmetry does most of the
   work: it groups a heading with its own section instead of splitting the
   difference between two. */
.article__body h2,
.article__body h3,
.article__body h4 {
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  margin: var(--space-7) 0 var(--space-3);
}
.article__body h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
/* Generated articles habitually put a `---` before every h2, which renders as an
   <hr>. Left alone that draws the section rule twice, a few pixels apart. The
   h2 rule stays for articles that don't use the separator. */
.article__body hr + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.article__body h3 { font-size: var(--text-xl); }
.article__body h4 { font-size: var(--text-lg); color: var(--ink-soft); }

/* The first heading opens the body — no rule, no gap above it. */
.article__body > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.article__body ul,
.article__body ol { padding-left: var(--space-5); }
.article__body li + li { margin-top: var(--space-2); }
.article__body li::marker { color: var(--ink-faint); }

/* Prose links are read at speed inside a sentence, so they need to be
   distinguishable without shouting. */
.article__body a {
  text-decoration: underline;
  text-decoration-thickness: from-font;
}
.article__body a:hover { color: var(--accent-hover); }

/* A section break should read as a pause. The default <hr> groove is the
   loudest thing on the page, and there are six of them. */
.article__body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-8) 0;
}

.article__body strong { font-weight: 650; color: var(--ink); }

/* A wide table must scroll in its own box rather than widening the page.
   Markdown gives no wrapper to put the overflow on, so the table carries it. */
.article__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* --- editorial polish ----------------------------------------------------- */
/* A text-heavy article reads as a wall. These give the eye entry points and
   rhythm from structure the articles already have — a lead paragraph, an opening
   summary, bold-led bullets, quotes — without a single generated image. */

/* Lead paragraph — the first paragraph draws the reader in. */
.article__body > p:first-of-type {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

/* Summary callout — the opening "Quick Summary" section, lifted into a tinted box
   so a reader gets the payoff before committing. Wrapped at render time. */
.article__summary {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  margin: 0 0 var(--space-7);
}
.article__summary > :first-child { margin-top: 0; }
.article__summary > :last-child { margin-bottom: 0; }
.article__summary h2 {
  font-size: var(--text-lg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-top: 0;
  padding-top: 0;
  margin: 0 0 var(--space-3);
}

/* Bold-led bullets ("**The 10-minute rule:** …") — the lead term is a label. */
.article__body li > strong:first-child { color: var(--ink); }

/* Blockquotes as pull-quotes, not just indented text. Overrides the base rule. */
.article__body blockquote {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--ink-soft);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding: var(--space-1) 0 var(--space-1) var(--space-5);
  margin: var(--space-7) 0;
}

/* --- blog index ----------------------------------------------------------- */

.post-list { list-style: none; margin: var(--space-7) 0 0; padding: 0; display: grid; gap: var(--space-7); }
.post-card {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}
.post-card:last-child { border-bottom: 0; padding-bottom: 0; }
.post-card__media img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: opacity var(--motion);
}
/* The whole card is one target: the title carries the link, but hovering the
   image should read as the same action rather than a separate one. */
.post-card:hover .post-card__media img { opacity: 0.92; }
.post-card__meta {
  color: var(--ink-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--space-2);
}
.post-card__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.post-card__title a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--motion);
}
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt {
  margin: 0;
  color: var(--ink-soft);
  /* Excerpts are a scanning aid, not the article. A hard cap keeps every card
     the same shape regardless of how long the opening paragraph runs. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 720px) {
  /* Only the cards that actually have an image get the image column. Applied
     unconditionally, a text-only post put its body in the 220px track and left
     the 1fr empty — the whole index rendered as a narrow strip beside a void. */
  .post-card--media { grid-template-columns: 220px 1fr; align-items: start; }
}

/* theme: bold */
:root {
  --ink: #0a0a0a;
  --ink-soft: #3d3d3d;
  --ink-faint: #484848;
  --line: #e6e6e6;
  --line-strong: #cccccc;
  --surface: #ffffff;
  --surface-alt: #f4f4f4;
  --surface-deep: #0a0a0a;
  --on-deep: #ffffff;
  --on-deep-soft: #c9c9c9;
  --deep-line: #2a2a2a;
  --deep-raise: #1a1a1a;
  --deep-line-hi: #3a3a3a;
  --accent: #1f4fe0;
  --accent-hover: #1a44c4;
  --accent-soft: #eaeeff;
  --accent-ink: #ffffff;
  --radius-sm: 2px;
  --radius: 3px;
  --radius-lg: 4px;
}

/* theme: custom */
:root {
  --section-y: clamp(40px, 3vw + 20px, 68px);
  --gap: var(--space-4);
}
