/* Public pages: the landing (/) and the teaching example (/exemple). */

/* Clue graphs. graphview embeds a <style> element that the CSP blocks, so
   public.go strips it and these rules replace it with design tokens. */
.graphview { display: block; width: 100%; height: auto; color: var(--color-ink); font-family: var(--font-mono); }
.graphview text { fill: var(--color-ink); font-size: 14px; }
.graphview .heading { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.graphview .muted { fill: var(--color-muted); }
.graphview .node { fill: var(--color-surface); stroke: var(--color-line-strong); stroke-width: 1.5; }
.graphview .edge { fill: none; stroke: var(--color-primary); stroke-width: 2.5; }
.graphview .arrow { fill: var(--color-primary); }
.graphview .label-bg { fill: var(--color-bg); stroke: var(--color-line-strong); stroke-width: 1; }
.graphview .chip-text { font-size: 13px; }
.graphview .stub { stroke: var(--color-accent); stroke-dasharray: 8 6; }
.graphview .stub-label { fill: var(--color-accent); font-size: 12px; }
.graphview .issue .node, .graphview .issue .edge, .graphview .issue .label-bg { stroke: var(--color-danger); }
.graphview .issue .node { fill: var(--color-danger-soft); }
.graphview .marker { fill: var(--color-danger); font-weight: 700; }
.graphview a:focus-visible .node { stroke: var(--color-focus); stroke-width: 4; }

/* A plate is the paper card a graph sits on. */
.plate {
  position: relative;
  margin: 0;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.plate--flat { box-shadow: var(--shadow-sm); padding: var(--space-3); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.tag--issue { background: var(--color-danger-soft); color: var(--color-danger); }

/* Slim header that stays reachable while scrolling, from tablet width up. */
@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .site-header__inner { padding-block: var(--space-2); }
}

/* Hero */
.landing { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-9); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.hero__copy { max-width: 68rem; }
.hero__copy .actions { margin-block: var(--space-5) var(--space-3); }
.hero__title { margin-bottom: var(--space-4); font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); }
.hero__title em { color: var(--color-primary); font-style: italic; }
.hero__trial {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.hero__trial .icon { color: var(--color-accent-strong); }
.hero__figure { margin: 0; }
/* The hero fixture's viewBox keeps wide empty margins; crop them so the
   cards read larger. Tied to heroScenario in public.go. */
.plate__graph { overflow: hidden; }
.plate__graph svg { width: 122%; max-width: none; margin: -4% 0 -3% -5%; }
.plate__verdict {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
}
.plate__check { display: inline-flex; }
.plate__check .icon { width: 1.4rem; height: 1.4rem; }
.plate__caption { max-width: var(--measure); margin-top: var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }
@media (min-width: 48rem) {
  .plate { padding: var(--space-5); }
  .plate__verdict { position: absolute; right: var(--space-5); bottom: var(--space-5); margin: 0; box-shadow: var(--shadow-sm); }
}

/* Sections */
.band__header { max-width: 46rem; margin-bottom: var(--space-6); }
.band__header h2 { margin-bottom: var(--space-3); }
.band__header .lede { margin-bottom: 0; }

.how { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.how__step { margin: 0; padding-top: var(--space-4); border-top: 2px solid var(--color-ink); }
.how__step + .how__step { margin-top: 0; }
.how__number { display: block; margin-bottom: var(--space-2); color: var(--color-accent); font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; }
.how__step p { margin: 0; }
.how__step .badge { margin-block: var(--space-1); }

.tour { display: grid; gap: var(--space-8); }
.tour .band__header { margin-bottom: 0; }
.tour__row { display: grid; gap: var(--space-5); align-items: center; }
.tour__text { max-width: 30rem; }
.tour__text p { margin: 0; color: var(--color-muted); }

.browser {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-line);
}
.browser__dots { display: inline-flex; gap: 6px; }
.browser__dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--color-line-strong); opacity: 0.6; }
.browser__url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0.1rem var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.browser img { width: 100%; height: auto; background: var(--color-bg); }

.checks { display: grid; gap: var(--space-5); margin: 0 0 var(--space-7); padding: 0; list-style: none; }
.check { margin: 0; padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-line); border-left: 3px solid var(--color-accent); border-radius: var(--radius-lg); }
.check + .check { margin-top: 0; }
.check p { margin: 0; color: var(--color-muted); }
.compare { display: grid; gap: var(--space-6); }
.compare__item { margin: 0; }
.compare__item figcaption { max-width: var(--measure); margin-bottom: var(--space-3); }
.compare__item figcaption .tag, .compare__item figcaption .badge { margin-right: var(--space-2); }
.validator__note { margin-top: var(--space-7); }

.features { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
@media (min-width: 36rem) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature { margin: 0; padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); }
.feature + .feature { margin-top: 0; }
.feature h3 { margin-top: var(--space-3); }
.feature p { margin: 0; color: var(--color-muted); }
.feature__icon { width: 2rem; height: 2rem; color: var(--color-primary); }

.offers { display: grid; gap: var(--space-5); max-width: 52rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.offer { display: flex; flex-direction: column; padding: var(--space-6); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.offer--pack { border-color: var(--color-primary); }
.offer p { color: var(--color-muted); }
.offer .btn { margin-top: auto; }
.offer__label { margin-bottom: var(--space-2); color: var(--color-accent); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.offer p.offer__price { margin-bottom: var(--space-3); color: var(--color-ink); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: var(--leading-tight); }
.offer p.offer__price--muted { color: var(--color-muted); }
.offer p.offer__price, .offer__figure { font-variant-numeric: lining-nums tabular-nums; }
.pricing__note { max-width: var(--measure); margin: var(--space-5) 0 0; font-size: var(--text-sm); }

.faq__list { max-width: 48rem; border-top: 1px solid var(--color-line-strong); }
.faq__item { border-bottom: 1px solid var(--color-line-strong); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--touch-target);
  padding-block: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  flex: none;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  transition: transform var(--duration-base) var(--ease-out);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item summary:hover { color: var(--color-primary); }
.faq__item p { max-width: var(--measure); margin: 0 0 var(--space-5); color: var(--color-muted); }

.final-cta {
  display: grid;
  justify-items: center;
  padding: var(--space-8) var(--space-5);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.final-cta > .icon { width: 2.5rem; height: 2.5rem; margin-bottom: var(--space-4); color: var(--color-accent); }
.final-cta p { max-width: 36rem; color: var(--color-muted); }
.final-cta .actions { justify-content: center; }
.final-cta__fineprint { margin: var(--space-4) 0 0; font-size: var(--text-sm); }

@media (min-width: 56rem) {
  .how, .checks { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
  .tour__row { grid-template-columns: 4fr 8fr; gap: var(--space-7); }
  .tour__row:nth-child(odd) { grid-template-columns: 8fr 4fr; }
  .tour__row:nth-child(odd) .tour__text { order: 2; }
}

/* /exemple */
.example { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.example .page-header--hero { margin-bottom: 0; }
.example__step { display: grid; gap: var(--space-5); }
.example__text { max-width: var(--measure); }
.example__text .eyebrow .badge, .example__text .eyebrow .tag { text-transform: none; letter-spacing: 0.02em; }
.example__graph { max-width: 64rem; }
.example__narrow { max-width: 24rem; margin-inline: auto; }
@media (max-width: 39.99rem) { .example__wide { display: none; } }
@media (min-width: 40rem) { .example__narrow { display: none; } }
.example .table tr:target td { background: var(--color-accent-soft); }

/* Motion. The resting state is the final state: without JS or with reduced
   motion, everything is visible and nothing moves. */
@media (prefers-reduced-motion: no-preference) {
  .hero-graph .scene { animation: landing-fade var(--duration-slow) var(--ease-out) both; }
  .hero-graph .scene:nth-of-type(1) { animation-delay: 100ms; }
  .hero-graph .scene:nth-of-type(2) { animation-delay: 250ms; }
  .hero-graph .scene:nth-of-type(3) { animation-delay: 400ms; }
  .hero-graph .scene:nth-of-type(4) { animation-delay: 550ms; }

  .hero-graph .clue { animation: landing-fade 1ms linear both; }
  .hero-graph .draw-edge { animation: landing-draw 700ms var(--ease-in-out) both; }
  .hero-graph .chip { animation: landing-fade var(--duration-slow) var(--ease-out) both; }
  .hero-graph .clue:nth-of-type(1), .hero-graph .edge-0 { animation-delay: 900ms; }
  .hero-graph .clue:nth-of-type(2), .hero-graph .edge-1 { animation-delay: 1300ms; }
  .hero-graph .clue:nth-of-type(3), .hero-graph .edge-2 { animation-delay: 1800ms; }
  .hero-graph .clue:nth-of-type(4), .hero-graph .edge-3 { animation-delay: 2200ms; }
  .hero-graph .clue:nth-of-type(5) { animation: landing-fade var(--duration-slow) var(--ease-out) 2700ms both; }
  .hero-graph .chip:nth-of-type(6) { animation-delay: 1250ms; }
  .hero-graph .chip:nth-of-type(7) { animation-delay: 1650ms; }
  .hero-graph .chip:nth-of-type(8) { animation-delay: 2150ms; }
  .hero-graph .chip:nth-of-type(9) { animation-delay: 2550ms; }
  .hero-graph .chip:nth-of-type(10) { animation-delay: 2700ms; }

  .hero__figure.is-waiting .hero-graph *, .hero__figure.is-waiting .plate__verdict, .hero__figure.is-waiting .plate__check path { animation-play-state: paused; }
  .plate__verdict { animation: landing-rise var(--duration-slow) var(--ease-out) 3100ms both; }
  .plate__check path { stroke-dasharray: 20; animation: landing-tick 420ms var(--ease-out) 3400ms both; }

  [data-reveal], [data-reveal-group] > * {
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  }
  [data-reveal].is-pending, [data-reveal-group].is-pending > * { opacity: 0; transform: translateY(1rem); }
  [data-reveal-group] > :nth-child(2) { transition-delay: 90ms; }
  [data-reveal-group] > :nth-child(3) { transition-delay: 180ms; }
  [data-reveal-group] > :nth-child(4) { transition-delay: 270ms; }
  [data-reveal-group] > :nth-child(5) { transition-delay: 360ms; }
  [data-reveal-group] > :nth-child(6) { transition-delay: 450ms; }
}
@keyframes landing-fade { from { opacity: 0; } }
@keyframes landing-draw { from { stroke-dashoffset: 100; } }
@keyframes landing-rise { from { opacity: 0; transform: translateY(0.5rem) scale(0.96); } }
@keyframes landing-tick { from { stroke-dashoffset: 20; } }
