/* ════════════════════════════════════════════════
   MYTHOCLAST PAGE
   Reuses tokens, nav, footer, eyebrow, hero, buttons
   and CTA from site.css + athelion.css. This file holds
   the page-specific layout + the signature interactive
   diagnostic (a question distilled through evidence into
   a single graded diagnosis).
   ════════════════════════════════════════════════ */

/* The funnel motif — strata, drifting beads — is rendered
   on a <canvas> by mythoclast.js (see .myth-funnel-canvas below). */

/* ════ HERO — fly standing in for the "M" in MYTHOCLAST ════
   (mirrors Athelion's aspen "i": sits on the baseline, scales with the title) */
.myth-hero-m {
  height: 0.72em;
  width: auto;
  margin-right: 0.02em;
  flex-shrink: 0;
  display: block;
}

/* ════ INTRO / WHAT IT IS ════ */
.myth-intro {
  background: var(--white);
  padding: 7rem 5rem;
}

.myth-intro-inner {
  max-width: 980px;
  margin: 0 auto;
}

.myth-intro-head {
  max-width: 820px;
  margin-bottom: 3rem;
}

/* the eyebrow rule draws itself in when the intro reveals */
.myth-intro-head .ath-eyebrow-rule { width: 0; }
.myth-intro-head.visible .ath-eyebrow-rule { animation: mythRuleDraw 0.8s ease 0.15s forwards; }
@keyframes mythRuleDraw { to { width: 32px; } }

.myth-lead {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.myth-lead .accent {
  color: var(--teal);
  /* font-style: italic; */
}

.myth-intro .eco-video-card {
  max-width: 920px;
  margin: 0 auto 3rem;
}

.myth-prose {
  max-width: 920px;
}

.myth-prose p {
  font-size: 16px;
  font-weight: 400;
  color: var(--mauve);
  line-height: 1.9;
  break-inside: avoid;
}

.myth-prose p strong {
  color: var(--ink);
  font-weight: 700;
}

/* ════ HOW IT WORKS — THE INTERACTIVE DIAGNOSTIC ════ */
.myth-diagnostic {
  background: #FAFAFA;
  padding: 7rem 5rem;
}

.myth-diagnostic-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.myth-diagnostic-head {
  max-width: 760px;
  margin-bottom: 4rem;
}

.myth-diagnostic-hint {
  display: block;
  margin-top: 0.9rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

/* funnel (left, pinned) + scrolling stages (right) */
.myth-diagnostic-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 1rem;
}

/* the funnel pins and stays centred in the viewport while the stages scroll */
.myth-funnel-media {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── the funnel graphic (canvas-rendered: strata, beads) ── */
.myth-funnel { position: relative; }

.myth-funnel-canvas {
  display: block;
  width: 100%;
  max-width: 1100px;
  height: min(82vh, 860px);
  margin: 0 auto;
}

/* ── scrolling stages: scroll position dictates the active one ── */
.myth-steps { list-style: none; margin: 0; padding: 0; }

.myth-steps::after {
  content: '';
  display: block;
  height: 8vh;
}

.myth-step {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 2rem;
  border-left: 2px solid var(--rule);
  opacity: 0.4;
  transition: opacity 0.45s ease, border-color 0.45s ease;
}

.myth-step.is-active { opacity: 1; border-left-color: var(--teal); }

.myth-step-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(114, 159, 167, 0.14);
  border: 1px solid rgba(114, 159, 167, 0.25);
  padding: 5px 11px;
  border-radius: 2px;
}

.myth-step-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 1rem 0;
}

.myth-step-text {
  font-size: 15.5px;
  font-weight: 400;
  color: var(--mauve);
  line-height: 1.85;
  max-width: 48ch;
}

.myth-step-text strong { color: var(--ink); font-weight: 700; }

/* ── the four investigation areas: icon + name, expands on hover/tap ──
   desktop reveals the paragraph on hover/focus; touch devices tap to
   toggle (.is-open, managed in mythoclast.js). Mirrors the old recap grid
   so it drops to 2-up then 1-up on smaller screens. */
.myth-areas-block {
  margin-top: 0;
}

.myth-areas-head {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.myth-areas-title {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.myth-areas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 205px;
  gap: 1rem;
}

.myth-area {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.35rem 1.15rem;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.myth-area:hover,
.myth-area:focus-visible,
.myth-area.is-open {
  border-color: rgba(114, 159, 167, 0.5);
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 16px 36px rgba(50, 55, 52, 0.07);
}

.myth-area:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.myth-area-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(114, 159, 167, 0.12);
  color: var(--teal);
  flex-shrink: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

.myth-area-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.myth-area:hover .myth-area-icon,
.myth-area:focus-visible .myth-area-icon,
.myth-area.is-open .myth-area-icon {
  background: rgba(114, 159, 167, 0.22);
  color: var(--ink);
}

.myth-area-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.myth-area-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--mauve);
  line-height: 1.6;
  max-width: 32ch;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: max-height 0.35s ease, opacity 0.3s ease 0.05s, margin-top 0.35s ease, transform 0.35s ease;
}

.myth-area:hover .myth-area-text,
.myth-area:focus-visible .myth-area-text,
.myth-area.is-open .myth-area-text {
  max-height: 120px;
  opacity: 1;
  margin-top: 0.15rem;
  transform: translateY(0);
}

/* ════ WHAT YOU GET — OUTPUT GRID ════ */
.myth-output {
  background: var(--white);
  padding: 7rem 5rem;
}

.myth-output-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.myth-output-head {
  max-width: 760px;
  margin-bottom: 3.5rem;
}

/* ════ ARTEFACT LEDGER — a register of the diagnostic record ════
   Not cards: a single document-like index. One body of evidence,
   five connected entries, each filed under its type. */
.myth-ledger {
  border-top: 1.5px solid var(--ink);
}

/* tiny register caption — sells "this is a formal record", kept quiet */
.myth-ledger-cap {
  display: grid;
  grid-template-columns: 1fr clamp(8rem, 14vw, 11rem);
  gap: 2rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mauve);
}

.myth-ledger-cap span:last-child { text-align: right; }

.myth-row {
  display: grid;
  grid-template-columns: 1fr clamp(8rem, 14vw, 11rem);
  gap: 2rem;
  align-items: baseline;
  padding: 1.85rem 0.9rem 1.85rem 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: background 0.28s ease, padding-left 0.28s ease;
}

/* accent spine slides in on hover — the row steps aside to reveal it */
.myth-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--teal);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.myth-row:hover {
  background: rgba(114, 159, 167, 0.05);
  padding-left: 1.1rem;
}

.myth-row:hover::before { transform: scaleY(1); }

/* staggered reveal — entries file in one after another */
.myth-ledger .myth-row {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease, background 0.28s ease, padding-left 0.28s ease;
}

.myth-ledger.visible .myth-row { opacity: 1; transform: translateY(0); }
.myth-ledger.visible .myth-row:nth-child(1) { transition-delay: 0.06s; }
.myth-ledger.visible .myth-row:nth-child(2) { transition-delay: 0.14s; }
.myth-ledger.visible .myth-row:nth-child(3) { transition-delay: 0.22s; }
.myth-ledger.visible .myth-row:nth-child(4) { transition-delay: 0.30s; }
.myth-ledger.visible .myth-row:nth-child(5) { transition-delay: 0.38s; }

/* title carries the diamond motif as a leading marker */
.myth-row-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.myth-row-title::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--teal);
  transform: rotate(45deg);
  flex-shrink: 0;
  position: relative;
  top: -1px;
  transition: transform 0.35s ease;
}

.myth-row:hover .myth-row-title::before { transform: rotate(135deg) scale(1.18); }

.myth-row-text {
  font-size: 14.5px;
  font-weight: 400;
  color: var(--mauve);
  line-height: 1.7;
  max-width: 56ch;
  /* align with the title text, clearing the diamond marker (7px + 12px gap) */
  padding-left: 19px;
}

/* classification label — the filing tag, replaces a generic badge */
.myth-row-type {
  justify-self: end;
  text-align: right;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mauve);
  white-space: nowrap;
}

/* ════ PRINCIPLES / WHY IT MATTERS ════ */
.myth-principles {
  background: var(--ink);
  padding: 7rem 5rem;
  position: relative;
  overflow: hidden;
}

/* drifting dot grid — bookends the hero */
.myth-principles::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image: radial-gradient(circle, rgba(114, 159, 167, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  animation: athGridDrift 60s linear infinite;
}

.myth-principles-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.myth-principles-head {
  max-width: 760px;
  margin-bottom: 3.5rem;
}

.myth-principles-head .ath-section-heading { color: var(--white); }
.myth-principles-head .ath-section-sub { color: rgba(255, 255, 255, 0.72); }

.myth-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.myth-pillar {
  position: relative;
  padding-top: 1.5rem;
}

/* evidence line draws across the top on reveal */
.myth-pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s ease;
}

.myth-pillars.visible .myth-pillar::before { transform: scaleX(1); }
.myth-pillars.visible .myth-pillar:nth-child(1)::before { transition-delay: 0.1s; }
.myth-pillars.visible .myth-pillar:nth-child(2)::before { transition-delay: 0.25s; }
.myth-pillars.visible .myth-pillar:nth-child(3)::before { transition-delay: 0.4s; }

.myth-pillar-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 0.9rem;
}

.myth-pillar-text {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
}

/* ════ RESPONSIVE ════ */
@media (min-width: 769px) and (max-width: 1100px) {
  .myth-intro,
  .myth-diagnostic,
  .myth-output,
  .myth-principles { padding: 5rem 3rem; }

  .myth-diagnostic-body { gap: 2.5rem; }
}

/* tablet / mobile: drop the pinned funnel; stages scroll as a normal column */
@media (max-width: 900px) {
  .myth-diagnostic-body {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 1.75rem;
  }

  .myth-funnel-media { display: none; }

  .myth-steps::after { display: none; }

  .myth-step { min-height: 0; padding: 2.25rem 0 2.25rem 1.5rem; }

  .myth-areas { grid-template-columns: repeat(2, 1fr); }

  .myth-pillars { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .myth-intro,
  .myth-diagnostic,
  .myth-output,
  .myth-principles { padding: 4rem 1.5rem; }

  .myth-intro-head,
  .myth-diagnostic-head,
  .myth-output-head,
  .myth-principles-head { margin-bottom: 2.25rem; }

  .myth-prose { column-count: 1; max-width: 760px; }

  .myth-pillars { gap: 2rem; }
}

@media (max-width: 640px) {
  /* ledger entries reflow: type sits as a tag above the entry, body spans full width */
  .myth-ledger-cap { display: none; }

  .myth-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.5rem 0.9rem 1.5rem 0;
  }

  .myth-row-type {
    order: -1;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .myth-areas { grid-template-columns: 1fr; }
}

/* ════ REDUCED MOTION ════ */
@media (prefers-reduced-motion: reduce) {
  /* the funnel canvas drops its bead/pulse motion via JS (matchMedia) */
  .myth-principles::before { animation: none; }

  .myth-intro-head.visible .ath-eyebrow-rule { animation: none; width: 32px; }

  .myth-step { transition: opacity 0.001s linear; }

  .myth-ledger .myth-row,
  .myth-ledger.visible .myth-row {
    opacity: 1;
    transform: none;
    transition: background 0.28s ease, padding-left 0.28s ease;
  }

  .myth-pillar::before,
  .myth-pillars.visible .myth-pillar::before { transform: scaleX(1); transition: none; }

  /* area cards still reveal, just without the lift/transition */
  .myth-area { transition: none; transform: none; }
  .myth-area:hover,
  .myth-area:focus-visible,
  .myth-area.is-open { transform: none; }
  .myth-area-text { transition: none; }
}

/* ── Type system: display face (see site.css) ── */
.myth-lead {
  font-family: var(--font-display);
  font-weight: 600;
}
