/* aeo-academy — site.css (page-level only)
   Loads AFTER styles/tokens.css and styles/components.css (the kit).
   Rules: reference composite tokens only; components react via container
   queries where possible; @media is reserved for user preferences and
   forced-colors (site-design-spec.md §3). Motion is transform/opacity only
   and double-guarded by prefers-reduced-motion + @supports. */

/* ---- cross-page view transitions (spec §5 marketing-site priority) ---- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

html { scroll-behavior: smooth; }   /* the kit's reduced-motion guard resets this */

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

.hero {
  padding-block: clamp(3rem, 2rem + 6vw, 6rem) clamp(2rem, 1.5rem + 4vw, 4rem);
  max-inline-size: 46rem;   /* narrower than .container; margin-inline: auto survives */
}

.kicker {
  margin: 0 0 var(--space-3);
  color: var(--color-brand);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin-block: 0 var(--space-4);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);   /* mixed units, ratio 1.6 ≤ 2.5 */
}

.brand-text { color: var(--color-brand); }

.hero__lead {
  margin: 0 0 var(--space-5);
  font-size: 1.125rem;
  color: var(--color-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}

.hero__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

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

.section { padding-block: var(--space-6); }

.section__intro {
  max-inline-size: 65ch;
  margin-block: 0 var(--space-5);
  color: var(--color-muted);
}

/* ---- cards (kit .card extended) ---- */

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-items: safe center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.card__title a {
  color: inherit;
  text-decoration: none;
}
.card__title a:hover,
.card__title a:focus-visible {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- navbar CTA link ---- */

.navbar__link--cta {
  color: var(--color-brand);
  font-weight: 600;
}

/* ---- breadcrumbs ---- */

.breadcrumbs {
  padding-block: var(--space-3) 0;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-items: safe center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--color-muted);
}

.breadcrumbs a {
  color: var(--color-muted);
}
.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--color-text);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

/* ---- article page ---- */

.article {
  padding-block: var(--space-4) var(--space-6);
}

.article__header {
  max-inline-size: 80ch;
  margin-block-end: var(--space-6);
}

.article__meta-top { margin: 0 0 var(--space-3); }

.article__header h1 {
  font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem);   /* ratio 1.47 ≤ 2.5 */
}

.article__dek {
  font-size: 1.125rem;
  color: var(--color-muted);
}

.article__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* running text rhythm on top of the kit base */
.prose h2 { margin-block-start: var(--space-6); }

.prose > ul,
.prose > ol {
  margin-block: 0 var(--space-4);
  padding-inline-start: 1.5rem;
}

.prose li { margin-block-end: var(--space-2); }

/* data table (aeo-vs-seo) — a scroll region on narrow screens (spec §3) */
.table-wrap {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  margin-block: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

.table-wrap table {
  border-collapse: collapse;
  inline-size: 100%;
  min-inline-size: 34rem;
}

.table-wrap caption {
  text-align: start;
  padding: var(--space-3);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.table-wrap th,
.table-wrap td {
  padding: var(--space-2) var(--space-3);
  text-align: start;
  border-block-end: 1px solid var(--color-border);
}

.table-wrap thead th {
  background: var(--color-raised);
  font-size: 0.875rem;
}

.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-block-end: 0;
}

.table-wrap tbody th { font-weight: 600; }

/* ---- CTA / waitlist boxes ---- */

.cta-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.cta-box {
  padding: var(--space-5);
  background: var(--color-brand-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
}

.cta-box h3 { margin-block: 0 var(--space-2); }
.cta-box p { color: var(--color-muted); }
.cta-box .btn { margin-block-start: var(--space-2); }

.article > .cta-box {
  max-inline-size: 80ch;
  margin-block-start: var(--space-7);
}

/* ---- footer ---- */

.site-footer {
  margin-block-start: var(--space-8);
  padding-block: var(--space-6);
  border-block-start: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.footer-brand {
  margin: 0 0 var(--space-2);
  font-weight: 700;
  font-size: 1.125rem;
}

.footer-note {
  margin: 0;
  max-inline-size: 34ch;
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.footer-heading {
  margin: 0 0 var(--space-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-legal {
  margin-block-start: var(--space-6);
  color: var(--color-muted);
}
.footer-legal p { margin: 0; }

/* ---- reading progress (article pages, pure CSS scroll-driven) ----
   Decorative: hidden in forced-colors mode; double-guarded by
   prefers-reduced-motion + @supports; animates transform only. */

@media (forced-colors: active) {
  body::before { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body:has(.prose)::before {
      content: "";
      position: fixed;
      inset-block-start: 0;
      inset-inline: 0;
      block-size: 3px;
      background: var(--color-brand);
      transform-origin: 0 50%;
      transform: scaleX(0);
      z-index: 10;
      animation: progress-grow linear both;
      animation-timeline: scroll(root block);
    }

    @keyframes progress-grow {
      to { transform: scaleX(1); }
    }
  }
}
