/* Layout Styles - Page Structure, Sections, and Grid Systems */

/* ===== PAGE STRUCTURE ===== */

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ===== HEADER =====
 * The site header is the <mgt-header> web component — its sticky nav lives in its own
 * shadow DOM. We must NOT style the bare `header` element globally: content pages use
 * <header> for their title block, and making those sticky/blurred makes them float over
 * and overlap the page text. So: no global header rule here. */

/* Navigation + brand mark live entirely in the <mgt-header> web component
   (shadow DOM); no light-DOM .nav/.brand styles are needed here. */

/* ===== MAIN CONTENT ===== */

main {
  margin-block: clamp(2rem, 4vw, 4rem);
  margin-inline: auto;
  max-width: var(--container-wide);   /* was 72rem — pages now use the space */
  padding-inline: var(--gutter);       /* fluid gutter (was fixed 1rem) */
  width: 100%;
}

/* ===== WIDTH-REGIME UTILITIES (pages/sections opt in) ===== */
.u-wide        { max-width: var(--container-wide);  margin-inline: auto; }
.u-full        { max-width: var(--container-full);  margin-inline: auto; }
.u-measure     { max-width: var(--measure);         margin-inline: auto; }
.u-measure-wide{ max-width: var(--measure-wide);    margin-inline: auto; }

/* ===== SECTIONS ===== */

section {
  margin: 2.5rem auto 0;
  text-align: start;
}

section.hero {
  display: grid;
  place-items: center;
  gap: var(--space-lg);
  margin: 2rem 0 2.5rem;
  text-align: center;
}

section.hero img {
  width: min(400px, 70vw);
  height: auto;
}

section.intro {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin: 2.5rem 0;
}

@media (min-width: 48rem) {
  section.intro {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

/* ===== ARTICLES & CARDS ===== */

article {
  margin-bottom: var(--space-xl);
}

.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

/* Mobile card improvements */
@media (max-width: 640px) {
  .card {
    padding: var(--space-md);
  }

  .btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 0.875rem 1.5rem;
  }

  .cta {
    flex-direction: column;
  }

  .cta .btn {
    width: 100%;
  }
}

/* ===== FOOTER ===== */

footer {
  margin-top: 3rem;
  margin-bottom: 0;
  padding: 3rem var(--space-md);
  background: color-mix(in srgb, #000 40%, transparent);
  border-top: 1px solid var(--color-border);
  text-align: start;
  color: var(--color-muted);
  font-size: var(--font-size-sm);
}

footer .container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

footer h4 {
  margin: 1.25rem 0 0.25rem;
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-fg-secondary);
}

footer h4:first-child {
  margin-top: 0;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--color-muted);
}

footer a {
  color: var(--color-accent);
}

/* ===== TWO-COLUMN LAYOUT ===== */

/* Fluid card grids — columns reflow continuously with width (no fixed breakpoints,
   no overflow at 320px thanks to min(100%, …)). */
.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
/* Let grid items shrink below their content (prevents wide code/long words from overflowing) */
.grid > * { min-width: 0; }

/* ===== SIDEBAR LAYOUT ===== */

.sidebar-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 64rem) {
  .sidebar-layout {
    grid-template-columns: minmax(0, 1fr) clamp(16rem, 22vw, 22rem);
  }
}

.sidebar {
  position: sticky;
  top: var(--scroll-offset);
}

/* ===== HEADER STYLES ===== */

.page-header {
  margin-bottom: var(--space-2xl);
}

.page-header h1 {
  margin-bottom: var(--space-md);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}

/* ===== BREADCRUMBS ===== */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  padding-inline-start: 0;        /* align breadcrumb text to the content-column left edge */
  margin-inline-start: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 var(--space-sm);
  color: var(--color-muted);
}

.breadcrumbs a {
  color: var(--color-link);
}

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

/* ===== HERO SECTION ===== */

.hero {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: var(--space-2xl);
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: var(--font-size-3xl);
  }
}

.hero h1 {
  margin-top: 0.5rem;
  margin-bottom: var(--space-md);
}

.hero .tag {
  color: var(--color-muted);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-top: 0.25rem;
}

/* ===== BUTTONS ===== */

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--color-brand-light), var(--color-brand));
  color: #fff;
  font-weight: var(--font-weight-bold);
  padding: 0.7rem 1.1rem;
  min-height: 2.75rem;            /* >=44px tap target */
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  font-family: inherit;
  font-size: var(--font-size-base);
}

.btn:hover {
  filter: brightness(1.07);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.btn--secondary {
  background: var(--color-bg-secondary);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

/* ===== CTA SECTION ===== */

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-md);
}

.cta-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ===== CONTENT WRAPPER ===== */

.content {
  max-width: var(--measure);   /* prose measure by default; pages opt into wider via .u-wide / .article-layout */
  margin-inline: auto;
}

.content > * + * {
  margin-top: var(--space-md);
}

.content section + section {
  margin-top: 2rem;
}

/* ===================================================================== *
 * PAGE-HERO SEPARATOR (site-wide, consistent) — a hairline under every page's
 * hero/header block so the title area is clearly set off from the body. Applies
 * to article <header>s AND every marketing/hub/home hero. Sub-section heads
 * (.section-head, .cm-head, .head-centred, .step-header) are deliberately excluded.
 * ===================================================================== */
.content > header,
.hub-head, .products-head, .learn-head, .start-head,
.community-head, .res-head, .say-head,
.build-hero, .advisor-hero, .cm-hero, .lp-hero, .home-section.hero {
  position: relative;
  padding-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}
/* The full-bleed line only spans the window if the hero element is full-width of its
   (centred) wrapper. `main ` prefix beats per-page `max-width` caps on these heads. */
main .hub-head, main .products-head, main .learn-head, main .start-head,
main .community-head, main .res-head, main .say-head,
main .build-hero, main .advisor-hero, main .cm-hero, main .lp-hero { max-width: none; }
/* the line itself — full window width (edge to edge), centred on the viewport, clearly visible */
.content > header::after,
.hub-head::after, .products-head::after, .learn-head::after, .start-head::after,
.community-head::after, .res-head::after, .say-head::after,
.build-hero::after, .advisor-hero::after, .cm-hero::after, .lp-hero::after, .home-section.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  height: 1px;
  background: color-mix(in srgb, var(--color-fg) 24%, transparent);
}
/* leads stay at a readable measure even though their head now spans full width */
.products-head .lede, .learn-head .lede, .hub-head .lede, .start-head .lede,
.community-head .lede, .res-head .lede, .say-head .lede, .cm-hero .lede,
.build-hero .lede, .advisor-hero .lede { max-width: var(--measure-wide); }

/* ===== ARTICLE WIDE LAYOUT: [TOC | prose(measure) | aside] =====
   Opt-in via .content.article-layout. Below lg it's a plain centered measure
   (identical to mobile/tablet today). At lg+ it becomes a 3-rail grid; ALL
   authored children default to the prose rail, so existing markup needs no
   per-element changes — only .toc / .page-aside jump to the side rails. */
@media (min-width: 64rem) {
  .content.article-layout {
    max-width: var(--container-wide);
    display: grid;
    /* symmetric side rails keep the prose (and its full-window hero separator) centred on the viewport */
    grid-template-columns: var(--toc-col) minmax(0, var(--measure)) var(--toc-col);
    grid-template-areas: "toc prose aside";
    column-gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
    justify-content: center;
  }
  .content.article-layout > *          { grid-column: prose; min-width: 0; }
  .content.article-layout > .toc        { grid-area: toc; }
  .content.article-layout > .page-aside { grid-area: aside; }
}
@media (min-width: 90rem) {
  .content.article-layout { max-width: var(--container-full); }
}

/* Headings get an anchor offset so jumps clear the sticky header */
.content h2[id], .content h3[id] { scroll-margin-top: var(--scroll-offset); }

/* ===== IN-PAGE TABLE OF CONTENTS (built by /assets/js/toc.js) ===== */
.toc { display: none; }                       /* hidden until JS marks it ready */
@media (min-width: 64rem) {
  .toc.is-ready {
    display: block;
    position: sticky;
    top: var(--scroll-offset);
    max-height: calc(100vh - var(--scroll-offset) - 2rem);
    overflow-y: auto;
    font-size: var(--font-size-sm);
    border-inline-start: 1px solid var(--color-border);
    padding-inline-start: var(--space-md);
  }
}
.toc__title {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-muted);
  margin: 0 0 var(--space-sm);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 var(--space-xs); line-height: 1.4; }
.toc a {
  display: block;
  padding: 0.25rem 0 0.25rem var(--space-sm);
  margin-inline-start: -2px;
  color: var(--color-muted);
  border-inline-start: 2px solid transparent;
  text-decoration: none;
}
.toc a:hover { color: var(--color-fg); }
/* "You are here" = accent text + a soft, dimmed indicator (not a loud green bar). */
.toc a[aria-current="true"] { color: var(--color-accent); border-inline-start-color: color-mix(in srgb, var(--color-accent) 50%, transparent); }

/* Narrow/medium fallback: a collapsible "On this page" injected at top of prose */
.toc--inline {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
}
.toc--inline summary { cursor: pointer; font-weight: var(--font-weight-semibold); }
.toc--inline ol { margin: var(--space-sm) 0 0; padding-inline-start: var(--space-lg); }
.toc--inline a { color: var(--color-accent); text-decoration: none; }
@media (min-width: 64rem) { .toc--inline { display: none; } }  /* sidebar takes over */

/* ===== RESPONSIVE PADDING ===== */

@media (max-width: 640px) {
  main {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
  }

  section {
    margin-top: var(--space-xl);
  }

  .card {
    padding: var(--space-md);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  main {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS VISIBLE STYLES ===== */

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

a:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

button:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* ===== MNEMONIC MEDIUM — <mgt-recall> page furniture (banner + review CTA) ===== */

.recall-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.recall-banner__icon {
  font-size: 1.4rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.recall-banner p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-fg-secondary);
  line-height: 1.6;
}

.recall-banner__stat {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
}

.recall-cta {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.recall-cta p { margin-top: 0; }
.recall-cta .cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ===== 99/100 CONTENT RUBRIC — shared components (enduring idea, worked example, misconception, try-it) ===== */

/* The one enduring understanding, stated up front. The site's ONE deliberately-accented
   callout — a soft tint, no loud left bar (the green bar is no longer repeated everywhere). */
.enduring {
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-bg-secondary));
  border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.75rem 0;
}
.enduring p { margin: 0; }
.enduring strong { color: var(--color-accent); }

/* Concrete worked example, shown before generalising */
.worked {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.worked h3 { margin: 0 0 0.75rem; color: var(--color-fg); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
.split .col {
  background: color-mix(in srgb, #000 20%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-width: 0;            /* let long content shrink instead of forcing the grid wider */
  overflow-wrap: anywhere;
}
.split .col h4 { margin: 0 0 0.5rem; font-size: var(--font-size-sm); text-transform: uppercase; letter-spacing: 0.05em; }
.split .machine h4 { color: var(--color-brand-lighter); }
.split .human h4 { color: var(--color-accent); }
.split .col p { font-size: var(--font-size-sm); margin-bottom: 0.5rem; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }

/* "Show the data" artifact panel (monospace) */
.artifact {
  font-family: var(--font-mono, "Courier New", monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  background: #0a0814;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--color-muted);
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
}
.artifact .edit { color: var(--color-accent); }

/* Misconception-buster */
.misconception {
  background: color-mix(in srgb, var(--color-error) 7%, var(--color-bg-secondary));
  border: 1px solid color-mix(in srgb, var(--color-error) 22%, var(--color-border));
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.misconception h3 { margin: 0 0 0.5rem; color: var(--color-error); font-size: var(--font-size-lg); }
.misconception p { margin-bottom: 0; }

/* "Try it on your own work" transfer prompt */
.tryit {
  background: color-mix(in srgb, var(--color-accent) 6%, var(--color-bg-secondary));
  border: 1px solid color-mix(in srgb, var(--color-accent) 20%, var(--color-border));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2.5rem 0;
}
.tryit h2 { margin-top: 0; }
.tryit ol, .tryit ul { margin-bottom: 1rem; }
.tryit p:last-child { margin-bottom: 0; }

/* ===== /notes/ — evergreen idea web ===== */
.content.note { max-width: var(--measure); margin: 0 auto; padding: 2rem 0; }  /* <main> already supplies the inline gutter */
.note-body { line-height: 1.8; }
.note-body p { margin-bottom: 1.25rem; line-height: 1.8; }
.note-body h2 { margin-top: 2rem; }
.note-body ul, .note-body ol { margin-bottom: 1.25rem; padding-inline-start: 1.5rem; }
.note-body li { margin-bottom: 0.5rem; line-height: 1.7; }
.note-body blockquote {
  border-inline-start: 2px solid color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
  background: color-mix(in srgb, var(--color-bg-secondary) 60%, transparent);
  margin: 1.5rem 0; padding: 0.9rem 1.25rem; border-radius: var(--radius-sm);
  color: var(--color-fg-secondary);
}
a.wikilink { color: var(--color-accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent); }
a.wikilink:hover { border-bottom-color: var(--color-accent); }
.note-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }
.note-tags span {
  font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-brand-lighter); background: color-mix(in srgb, var(--color-brand-lighter) 10%, var(--color-bg-secondary));
  border: 1px solid color-mix(in srgb, var(--color-brand-lighter) 35%, transparent); border-radius: 999px;
  padding: 0.2rem 0.7rem; font-weight: var(--font-weight-semibold);
}
.backlinks {
  margin-top: 2.5rem; padding: 1.15rem 1.35rem; position: relative; overflow: hidden;
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg-secondary);
}
.backlinks::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: linear-gradient(var(--color-accent), var(--color-brand-lighter)); opacity: 0.5; }
.backlinks h2 { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-brand-lighter); margin: 0 0 0.6rem; font-weight: var(--font-weight-bold); }
.backlinks h2::before { content: "\21C4  "; }
.backlinks ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.backlinks a { color: var(--color-fg); font-weight: var(--font-weight-semibold); }
.backlinks a:hover { color: var(--color-accent); }
.note-foot { margin-top: 2rem; font-size: var(--font-size-sm); color: var(--color-muted); }
.note-foot a { color: var(--color-accent); }

/* notes index */
.notes-index { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.note-card {
  position: relative; overflow: hidden;
  background: var(--color-bg-secondary); border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
/* a warm idea-rail down the side — the cards read as a tended collection, not stubs */
.note-card::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: linear-gradient(var(--color-accent), var(--color-brand-lighter));
  opacity: 0.45; transition: opacity 0.18s ease;
}
.note-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border)); box-shadow: var(--shadow-md); }
.note-card:hover::before { opacity: 1; }
.note-card a { text-decoration: none; display: flex; flex-direction: column; gap: 0.5rem; height: 100%; padding: 1.2rem 1.35rem 1.05rem; }
.note-card__title { color: var(--color-fg); font-weight: var(--font-weight-bold); font-size: var(--font-size-lg); line-height: 1.3; letter-spacing: -0.01em; }
.note-card:hover .note-card__title { color: var(--color-accent); }
.note-card__sum { color: var(--color-muted); font-size: var(--font-size-sm); line-height: 1.55; flex: 1; }
.note-card__meta { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); color: var(--color-brand-lighter); letter-spacing: 0.02em; margin-top: 0.15rem; }
.note-card__meta::before { content: "\21C4"; font-size: 0.95em; }   /* ⇄ — links in: this note's connectedness */

/* ===== SHARED UI: status pills + card link (one vocabulary site-wide) ===== */
.pill {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}
.pill--live { color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 50%, transparent); }
.pill--new  { color: var(--color-brand-lighter); border-color: color-mix(in srgb, var(--color-brand-lighter) 55%, transparent); }
.pill--soon { color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 45%, transparent); }
.card-link { font-weight: var(--font-weight-bold); color: var(--color-link); text-decoration: none; }
.card-link:hover { color: var(--color-accent); text-decoration: none; }

/* ===================================================================== *
 * WARM, INVITING DESIGN LANGUAGE — shared across the site (calm, low cognitive
 * load, encouraging). Use these on every page so the experience is one thing.
 * ===================================================================== */
.section-pad { padding-block: clamp(3rem, 8vw, 6.5rem); }              /* restful vertical rhythm */
.section-head { text-align: center; max-width: var(--measure-wide); margin: 0 auto var(--space-2xl); }
.section-head h2 { margin: 0; }
.section-head > p, .section-head .muted { margin: var(--space-sm) auto 0; }

/* ===================================================================== *
 * THE CONTENT COLUMN — the single source of horizontal alignment.
 * Breadcrumb, page head, and card grids ALL live inside .content-col so they
 * share one left/right edge. No more breadcrumb-far-left / head-centred /
 * cards-full-width mismatch. Centres on wide screens for calm side space.
 * ===================================================================== */
.content-col { max-width: var(--content-col); margin-inline: auto; width: 100%; }

/* Left-aligned page head (editorial; aligns with breadcrumb + grid, never floats centred in a void) */
.page-head { max-width: 46rem; margin: 0 0 var(--space-2xl); }
.page-head .eyebrow { margin-bottom: var(--space-sm); }
.page-head h1 { margin: 0 0 var(--space-md); }
.page-head .lede { margin: 0; margin-inline: 0; text-align: start; max-width: 46rem; }

/* Breadcrumb sits at the column's left edge with breathing room below */
.content-col > .breadcrumbs,
.content-col > nav[aria-label="Breadcrumb"] { margin-bottom: var(--space-xl); }
.eyebrow {
  display: inline-block; font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent); margin-bottom: var(--space-md);
}
.lede { max-width: 38rem; margin-inline: auto; color: var(--color-fg-secondary); font-size: var(--font-size-lg); line-height: 1.75; }

/* The journey: a numbered path of step cards (a path, not a menu of choices) */
/* Shared calm card grid — uniform tracks, left-aligned, fills the content column.
 * auto-fill + 1fr keeps every card the same width; ~3-up in a 68rem column; wraps to a
 * left-aligned next row (empty slot bottom-right is the normal, accepted pattern). */
.card-grid, .path {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1.25rem, 2vw, 2rem);
  margin: 0; padding: 0; list-style: none;
}
.card-grid > *, .path > * { min-width: 0; }
.step {
  position: relative; list-style: none;
  background: color-mix(in srgb, var(--color-bg-secondary) 82%, transparent);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: clamp(1.85rem, 3vw, 2.6rem); display: flex; flex-direction: column; gap: 0.85rem;
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
.step:hover { border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step__num { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--color-accent); opacity: 0.9; letter-spacing: 0.04em; }
.step h3 { margin: 0; font-size: var(--font-size-xl); line-height: 1.3; }
.step p { margin: 0; color: var(--color-fg-secondary); line-height: 1.75; flex: 1; }

/* A feature panel framed by a soft gradient border */
/* Hub "what's next" panel — capped + centred so it isn't a cavernous full-width box */
.hub-next { max-width: 52rem; margin-inline: auto; }

/* ===================================================================== *
 * GROUPING SYSTEM (site-wide, consistent) — Gestalt: a visible shared region,
 * EVEN internal spacing, and clear separation from surrounding content. Every
 * interactive/grouped block (explorables, and any .group-box) obeys this so a
 * reader can always tell where one component ends and the next begins.
 * ===================================================================== */
.explorable, .group-box {
  display: flex; flex-direction: column; gap: var(--space-md);   /* even internal rhythm */
  background: color-mix(in srgb, var(--color-bg-secondary) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 18%, var(--color-border));
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 3vw, 1.9rem);
  margin-block: var(--space-2xl);                                /* clear separation between blocks */
}
.explorable > *, .group-box > * { margin-block: 0; min-width: 0; }  /* gap owns the spacing — kill ad-hoc margins */
.explorable figcaption, .explorable > h3:first-child {
  font-family: var(--font-display); letter-spacing: 0.02em; font-size: var(--font-size-xl); color: var(--color-fg);
}
/* tap targets: interactive controls inside explorables meet the 44px minimum on small screens */
.explorable button, .explorable [role="button"], .explorable input[type="range"] { min-height: 2.75rem; }

.gradient-card { border-radius: var(--radius-lg); padding: 1px; background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 55%, transparent), color-mix(in srgb, var(--color-brand-light) 55%, transparent)); }
.gradient-card__inner { background: var(--color-bg-secondary); border-radius: calc(var(--radius-lg) - 1px); padding: clamp(1.5rem, 4vw, 2.5rem); }

/* Gentle scroll reveal — transform only, never hides content (progressive) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
    @keyframes reveal-rise { from { transform: translateY(22px); } to { transform: translateY(0); } }
  }
}

.notes-group { display: flex; align-items: center; gap: 0.7rem; margin: var(--space-3xl) 0 var(--space-md); font-size: var(--font-size-xl); color: var(--color-fg); }
.notes-group::before { content: ""; flex: 0 0 auto; width: 1.4rem; height: 3px; border-radius: 2px; background: var(--color-accent); }
.notes-group:first-of-type { margin-top: var(--space-xl); }
