/* ============================================================================
   Trionic Courses — landing.css
   Governs: PLAN.md §9 (Landing Page Outline)
   Contents: hero, persona picker, catalog grid, "why this exists",
             "how it works", FAQ, footer. Landing-page-only.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Hero
   ---------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: 64px 56px;
  background: linear-gradient(
    180deg,
    var(--brand-soft) 0%,
    color-mix(in srgb, var(--brand-soft) 40%, var(--paper)) 100%
  );
  overflow: hidden;
}

[data-theme="dark"] .hero {
  background: linear-gradient(
    180deg,
    var(--paper-soft) 0%,
    var(--paper) 100%
  );
}

@media (min-width: 768px) {
  .hero {
    padding-block: 96px 80px;
  }
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.hero h1 .accent {
  color: var(--brand);
}

.hero__subhead {
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem);
  color: var(--ink-muted);
  max-width: 620px;
  margin-inline: auto;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-block-start: var(--space-3);
}

/* ----------------------------------------------------------------------------
   2. Persona picker — "Pick your path"
   ---------------------------------------------------------------------------- */

.persona-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  padding-block: var(--space-4);
}

.persona-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  background-color: var(--paper);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.persona-picker__chip:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.persona-picker__chip[aria-pressed="true"],
.persona-picker__chip.is-active {
  background-color: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* ----------------------------------------------------------------------------
   3. Catalog grid
   ---------------------------------------------------------------------------- */

.catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 641px) {
  .catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1025px) {
  .catalog {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* ----------------------------------------------------------------------------
   4. "Why this exists" — 3-column feature grid
   ---------------------------------------------------------------------------- */

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .why-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.why-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 24px;
  background-color: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.why-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: var(--radius-md);
}

.why-card__icon svg {
  width: 22px;
  height: 22px;
}

.why-card h3 {
  font-size: 1.125rem;
}

.why-card p {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* ----------------------------------------------------------------------------
   5. "How it works" — 4 numbered steps
   ---------------------------------------------------------------------------- */

.how-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  counter-reset: how-step;
}

@media (min-width: 641px) {
  .how-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .how-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.how-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 20px;
  background-color: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  counter-increment: how-step;
}

.how-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.how-step__num::before {
  content: counter(how-step);
}

.how-step h3 {
  font-size: 1.0625rem;
}

.how-step p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ----------------------------------------------------------------------------
   6. FAQ — <details> / <summary>
   ---------------------------------------------------------------------------- */

.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 760px;
  margin-inline: auto;
}

.faq details {
  background-color: var(--paper-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  color: var(--ink);
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* Chevron — rotates open */
.faq summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--ink-muted);
  border-block-end: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-inline-start: var(--space-3);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq details[open] summary {
  border-block-end: 1px solid var(--border);
}

.faq details > *:not(summary) {
  padding: 16px 20px 20px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* ----------------------------------------------------------------------------
   7. Section headers (utility-style headings inside landing sections)
   ---------------------------------------------------------------------------- */

.section-eyebrow {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-block-end: var(--space-2);
}

.section-heading {
  text-align: center;
  margin-block-end: var(--space-6);
}

.section-heading p {
  max-width: 620px;
  margin-inline: auto;
  margin-block-start: var(--space-3);
  color: var(--ink-muted);
}

/* ----------------------------------------------------------------------------
   8. Footer
   ---------------------------------------------------------------------------- */

.site-footer {
  background-color: var(--paper-soft);
  border-block-start: 1px solid var(--border);
  padding-block: 40px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

[data-theme="dark"] .site-footer {
  background-color: var(--paper-sunken);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: start;
  }
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
}

.site-footer__links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-footer__links a:hover {
  color: var(--brand);
}

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

/* ============================================================================
   9. Hero layout (two-column desktop) + illustration
   ============================================================================ */

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  max-width: var(--container);
  margin-inline: auto;
  text-align: start;
}

@media (min-width: 769px) {
  .hero__inner {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: start;
  align-items: flex-start;
  order: 2;
}

@media (min-width: 769px) {
  .hero__copy {
    order: 1;
  }
}

@media (max-width: 768px) {
  .hero__copy {
    text-align: center;
    align-items: center;
  }
  .hero__copy h1,
  .hero__copy .hero__subhead {
    margin-inline: auto;
  }
}

.hero__art {
  display: flex;
  justify-content: center;
  align-items: center;
  order: 1;
}

@media (min-width: 769px) {
  .hero__art {
    order: 2;
  }
}

.hero__art svg.hero-illustration {
  width: 100%;
  height: auto;
  max-width: 480px;
  filter: drop-shadow(0 18px 32px color-mix(in srgb, var(--brand) 20%, transparent));
}

@media (max-width: 768px) {
  .hero__art svg.hero-illustration {
    max-width: 280px;
  }
}

/* Override the centering set by the original .hero__subhead rule
   so the subhead can left-align on desktop without being constrained.
   The 620px max-width is preserved. */
.hero__copy .hero__subhead {
  margin-inline: 0;
}

@media (max-width: 768px) {
  .hero__copy .hero__subhead {
    margin-inline: auto;
  }
}

.hero__copy .hero__cta {
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .hero__copy .hero__cta {
    justify-content: center;
  }
}

/* Initial state for animated SVG lines (visible by default for reduced-motion users) */
.hero-illustration__line {
  stroke-dasharray: 200;
  stroke-dashoffset: 0;
}

/* ============================================================================
   10. Entrance + ambient animations (motion-safe only)
   ============================================================================ */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 {
    animation: trionic-fade-up var(--dur-4) var(--ease-out) both;
  }
  .hero__subhead {
    animation: trionic-fade-up var(--dur-4) var(--ease-out) both;
    animation-delay: 120ms;
  }
  .hero__cta {
    animation: trionic-fade-up var(--dur-4) var(--ease-out) both;
    animation-delay: 220ms;
  }

  /* Hero illustration motion */
  .hero-illustration__ring {
    transform-origin: 240px 210px;
    transform-box: fill-box;
    animation: trionic-spin-slow 30s linear infinite;
  }
  .hero-illustration__orb-a {
    animation: trionic-float-y 6s var(--ease-in-out) infinite alternate;
  }
  .hero-illustration__orb-b {
    animation: trionic-float-x 7s var(--ease-in-out) infinite alternate;
  }
  .hero-illustration__dot-pulse {
    transform-origin: 60px 260px;
    transform-box: fill-box;
    animation: trionic-pulse-brand 3.6s var(--ease-soft) infinite;
  }
  .hero-illustration__line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: trionic-draw-line 2.4s var(--ease-out) both;
  }
}

/* Local fallback keyframe in case base.css ships a slightly different name.
   This keyframe matches the spec described in the build contract: animates
   stroke-dashoffset from 200 to 0. Safe to keep — base.css can override it. */
@keyframes trionic-draw-line {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}

/* ============================================================================
   11. Why-card hover lift + persona chip micro-bounce
   ============================================================================ */

@media (prefers-reduced-motion: no-preference) {
  .why-card {
    transition:
      transform var(--dur-2) var(--ease-out),
      box-shadow var(--dur-2) var(--ease-soft);
  }
  .why-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .persona-picker__chip {
    transition:
      background-color var(--dur-2) var(--ease-out),
      color var(--dur-2) var(--ease-out),
      border-color var(--dur-2) var(--ease-out),
      transform var(--dur-2) var(--ease-back);
  }
  .persona-picker__chip:hover {
    transform: translateY(-1px);
  }
}

/* ============================================================================
   12. Section dividers — small row of brand-tinted dots
   ============================================================================ */

.u-divider-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-block: var(--space-5);
}

.u-divider-dots span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border);
}

.u-divider-dots span:nth-child(3) {
  background: var(--brand);
}

/* ============================================================================
   13. Footer decoration — small row of 3 brand dots above the wordmark
   ============================================================================ */

.site-footer__dots {
  display: block;
  width: 36px;
  height: 8px;
  margin-block-end: var(--space-2);
}

@media (max-width: 767px) {
  .site-footer__dots {
    margin-inline: auto;
  }
}
