html { scroll-behavior: smooth; }
body {
  text-wrap: pretty;
  background:
    radial-gradient(1200px 720px at 82% -160px, color-mix(in srgb, var(--color-accent-900) 75%, transparent), transparent 60%),
    radial-gradient(1100px 800px at -10% 100%, color-mix(in srgb, black 30%, transparent), transparent 55%),
    var(--color-bg);
}
a { color: var(--color-accent-300); text-decoration: none; }
a:hover { color: var(--color-accent-200); }
.btn-primary, .btn-ghost { color: var(--color-accent); }

.page { min-height: 100vh; color: var(--color-text); font-family: var(--font-body); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.mono { font-family: 'Ubuntu Mono', ui-monospace, monospace; }
.btn { white-space: nowrap; flex: none; }
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: 32px; }
.rule {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--color-neutral-700) 48px calc(100% - 48px), transparent);
}

.eyebrow {
  display: block; font-family: 'Ubuntu Mono', ui-monospace, monospace;
  font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px;
}
.eyebrow.muted { margin: 56px 0 0; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.eyebrow.light { color: var(--color-accent-200); }
.eyebrow.accent { color: var(--color-accent); }

/* nav */
.site-nav {
  padding-inline: clamp(20px, 5vw, 72px); position: sticky; top: 0; z-index: 10;
  height: 48px; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
}
.site-nav a { white-space: nowrap; }
.site-nav .nav-brand { color: var(--color-text); font-size: 19px; font-weight: 400; letter-spacing: 0; }
.site-nav .btn-primary:hover { color: var(--color-accent); }

/* hero */
.hero { min-height: calc(100svh - 48px); padding: 48px 0; display: flex; flex-direction: column; justify-content: center; }
.hero h1 {
  font-size: clamp(44px, 7.4vw, 96px); line-height: 1.04; letter-spacing: -0.022em; margin: 0 0 0 -0.06em;
}
.hero h1 span { display: block; }
.hero-sub {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; letter-spacing: -0.01em;
  max-width: 30ch; margin: 28px 0 0; color: var(--color-accent-200);
}
.hero-copy { font-size: 17px; line-height: 27px; max-width: 50ch; margin: 20px 0 0; color: color-mix(in srgb, var(--color-text) 72%, transparent); }
.hero-copy span { color: var(--color-text); }

/* lifecycle */
.lifecycle {
  background: radial-gradient(900px 420px at 85% -40%, color-mix(in srgb, var(--color-section-glow) 70%, transparent), transparent 64%), var(--color-section);
  padding: clamp(64px, 8vw, 104px) 0;
}
.lifecycle h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
.lifecycle-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 20px; }
.lifecycle .tag-accent { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.1em; }
.timeline { margin-top: clamp(24px, 4vw, 48px); }
.timeline-svg { display: block; overflow: visible; }
/* three equal columns, no gap: column centres sit under the SVG nodes (1/6, 1/2, 5/6) */
.timeline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; text-align: center; }
.stage-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 clamp(8px, 2vw, 28px); color: var(--color-text); }
.stage-phase {
  font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 14px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--color-accent-300); font-feature-settings: 'tnum' 1;
}
.stage-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.15; letter-spacing: -0.015em; }
.stage-verb { font-size: 15px; line-height: 23px; max-width: 28ch; color: color-mix(in srgb, var(--color-text) 72%, transparent); }
/* narrow screens: the SVG can't line up with stacked columns, so stack and hide it */
@media (max-width: 720px) {
  .timeline-svg { display: none; }
  .timeline-grid { grid-template-columns: 1fr; gap: 32px; text-align: left; }
  .stage-link { align-items: flex-start; padding: 0; }
}

/* faq */
.faq {
  padding: clamp(40px, 6vw, 72px) 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px clamp(24px, 5vw, 80px); scroll-margin-top: 72px;
}
.faq h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 0; }
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--color-divider); }
.faq-q {
  all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between;
  align-items: center; gap: 24px; padding: 22px 0; cursor: pointer;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; line-height: 26px; color: var(--color-text);
}
.faq-q:hover { color: var(--color-accent-200); }
.faq-q:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.faq-icon { font-size: 22px; line-height: 1; color: var(--color-accent); flex: none; }
.faq-a { margin: 0 0 24px; font-size: 16px; line-height: 26px; max-width: 58ch; color: color-mix(in srgb, var(--color-text) 80%, transparent); }


/* cta + footer */
.cta { padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 6vw, 80px); scroll-margin-top: 72px; }
.cta h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0 -0.04em; max-width: 16ch; }
.cta p { font-size: 17px; line-height: 28px; max-width: 52ch; margin: 24px 0 0; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.footer {
  padding: 32px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-size: 14px; color: color-mix(in srgb, var(--color-text) 55%, transparent); position: relative;
}
.footer .rule { background: linear-gradient(to right, transparent, var(--color-divider) 48px calc(100% - 48px), transparent); }

/* FAQ smooth open/close */
.faq-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.faq-panel > div { overflow: hidden; }
.faq-q[aria-expanded='true'] + .faq-panel { grid-template-rows: 1fr; }
.faq-icon { transition: transform 0.3s ease; }

/* ── Animations (motion only for users who haven't opted out) ── */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes node-in { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 16px color-mix(in srgb, var(--color-accent) 70%, transparent); }
  50% { box-shadow: 0 0 26px 4px color-mix(in srgb, var(--color-accent) 90%, transparent); }
}

@media (prefers-reduced-motion: no-preference) {
  /* hero entrance */
  .hero h1 span, .hero-sub, .hero-copy, .hero .actions, .hero .eyebrow {
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero h1 span:nth-child(1) { animation-delay: 0.05s; }
  .hero h1 span:nth-child(2) { animation-delay: 0.18s; }
  .hero-sub { animation-delay: 0.38s; }
  .hero-copy { animation-delay: 0.5s; }
  .hero .actions { animation-delay: 0.62s; }
  .hero .eyebrow { animation-delay: 0.78s; }

  /* scroll reveals (only hidden when JS is running) */
  .js [data-reveal] {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }

  /* timeline draw-in */
  .tl-node { transform-box: fill-box; transform-origin: center; }
  .js .tl-line { transform-box: fill-box; transform-origin: left; transform: scaleX(0); }
  .js .tl-node, .js .tl-loop { opacity: 0; }
  .js .timeline-grid .stage-link { opacity: 0; transform: translateY(12px); }
  .js .timeline.in .tl-line { animation: draw 1.2s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
  .js .timeline.in .tl-node { animation: node-in 0.5s ease forwards; }
  .js .timeline.in .n1 { animation-delay: 0.2s; }
  .js .timeline.in .n2 { animation-delay: 0.6s; }
  .js .timeline.in .n3 { animation-delay: 1.0s; }
  .js .timeline.in .tl-loop { opacity: 1; transition: opacity 0.8s ease 1.4s; }
  .js .timeline.in .stage-link { opacity: 1; transform: none; transition: opacity 0.6s ease var(--d, 0s), transform 0.6s ease var(--d, 0s), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
  .js .timeline.in .stage-link:nth-child(1) { --d: 0.3s; }
  .js .timeline.in .stage-link:nth-child(2) { --d: 0.7s; }
  .js .timeline.in .stage-link:nth-child(3) { --d: 1.1s; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-panel, .faq-icon { transition: none; }
}

/* example visuals (trace / checks) */
.trace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.9; color: var(--color-neutral-400); margin-top: 6px; }
.trace > div { display: flex; gap: 10px; }
.trace .t { color: var(--color-neutral-600); min-width: 68px; }
.trace .k { color: var(--color-accent-400); width: 34px; }
.trace .flag { background: var(--color-accent-900); border-radius: 4px; margin: 0 -8px; padding: 0 8px; color: var(--color-accent-200); }
.trace .flag .t { color: var(--color-neutral-500); }
.trace .flag .k { color: var(--color-accent-300); }
.checks { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; font-size: 15px; }
.checks > div { display: flex; justify-content: space-between; align-items: center; color: var(--color-neutral-300); }
.checks .tag { font-size: 12px; padding: 2px 10px; }


/* Evaluation made in Europe */
.safe { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); }
.safe h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 0 0 16px; }
.safe > p { font-size: 17px; line-height: 28px; max-width: 52ch; margin: 0; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.safe-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px; margin-top: 28px; max-width: 760px;
}
.safe .card { padding: 22px; gap: 10px; }
.safe .card-kicker { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }
.safe .card-title { font-size: 20px; }
.safe .card-body { font-size: 15px; line-height: 23px; }
.safe .safe-close { margin-top: 24px; font-size: 17px; line-height: 28px; color: var(--color-accent-300); }
@media (prefers-reduced-motion: no-preference) {
  .js .safe .card { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .safe.in .card { opacity: 1; transform: none; }
  .js .safe.in .card:nth-child(2) { transition-delay: 0.12s; }
}

/* stage detail content: question, example visuals */
.stage-q { margin: 0; font-size: 18px; line-height: 26px; color: var(--color-accent-300); }
.stage-visual { padding: 18px; gap: 12px; width: 100%; text-align: left; }
.stage-visual .card-kicker { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }
.stage-visual .checks { margin-top: 0; font-size: 15px; }
.stage-visual .trace { margin-top: 0; }
.visual-foot {
  font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; letter-spacing: 0.04em;
  color: var(--color-accent-300); padding-top: 12px; border-top: 1px solid var(--color-divider);
}


/* the Tailwind class used by logo.tsx; a class (not an inline style) so media queries can still hide the logo */
.inline-block { display: inline-block; }

/* hero logo: right of the headline block, its base aligned with the last text line */
.hero-top { position: relative; width: fit-content; max-width: 100%; }
.hero-logo {
  position: absolute; right: 0; bottom: 5px; color: var(--color-accent-400);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.9s both;
}
@media (max-width: 940px) { .hero-logo { display: none; } } /* below ~920px it would overlap the body text */
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }

/* footer links + legal pages */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: inherit; }
.footer-links a:hover { color: var(--color-accent-200); }
.legal { max-width: 720px; padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 6vw, 80px); }
.legal h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 32px; }
.legal h2 { font-size: 22px; line-height: 1.25; margin: 40px 0 10px; }
.legal p, .legal li { font-size: 16px; line-height: 26px; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.legal address { font-style: normal; font-size: 16px; line-height: 26px; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.legal ul { padding-left: 20px; margin: 0 0 var(--space-3); }
.legal .back { display: inline-block; margin-top: 40px; }

/* archived-run record: compact two-column key/value grid */
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rec-grid dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-500); }
.rec-grid dd { margin: 2px 0 0; font-size: 13px; color: var(--color-neutral-300); }
.rec-grid .flag { background: var(--color-accent-900); border-radius: 4px; margin: -6px -8px; padding: 6px 8px; }
.rec-grid .flag dt { color: var(--color-accent-300); }
.rec-grid .flag dd { color: var(--color-accent-200); }

/* Lifecycle: expandable details */
.lc-toggle-wrap { display: flex; justify-content: center; margin-top: 40px; }
.lc-toggle { gap: 10px; }
.lc-chev { display: inline-block; transition: transform 0.4s ease; }
.lifecycle.open .lc-chev { transform: rotate(180deg); }
/* set by the toggle script from the free room beside the section:
   --spread: outward move of the detail columns; --widen: extra width of the detail row per side;
   --shift: outward move of the timeline columns (= 2/3 widen + spread); --node-shift: --shift in SVG units */
.lifecycle { --spread: 0px; --widen: 0px; --shift: 0px; --node-shift: 0px; }
.lc-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.5s ease, visibility 0s 0.5s; }
/* inner box is widened by --spread each side so the columns can move outward without being clipped */
.lc-inner { overflow: hidden; min-height: 0; margin-inline: calc((var(--spread) + var(--widen)) * -1); padding-inline: calc(var(--spread) + var(--widen)); }
.lifecycle.open .lc-panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.5s ease, visibility 0s; }
/* same three equal columns as the timeline above, so each detail sits under its stage */
.lc-details { margin-inline: calc(var(--widen) * -1); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 36px; text-align: center; }
.lc-detail { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 clamp(8px, 1.5vw, 20px); scroll-margin-top: 72px; }
.lc-label { display: none; font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-accent-300); }
.lc-detail .stage-q { font-size: 16px; line-height: 24px; }
.lc-detail > p { font-size: 15px; line-height: 24px; margin: 0; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.lc-detail .tags { justify-content: center; }
.lc-detail .stage-visual { margin-top: 6px; }
.lc-detail .rec-grid { grid-template-columns: 1fr; }
@media (max-width: 720px) {
  .lc-details { grid-template-columns: 1fr; gap: 56px; text-align: left; }
  .lc-detail { align-items: flex-start; padding: 0; }
  .lc-label { display: block; }
  .lc-detail .tags { justify-content: flex-start; }
  .lc-detail .rec-grid { grid-template-columns: 1fr 1fr; }
  .lc-toggle-wrap { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .lc-detail { opacity: 0; transform: translateY(16px); translate: 0 0; transition: opacity 0.4s ease, transform 0.4s ease, translate 0.4s ease; }
  .lifecycle.open .lc-detail { opacity: 1; transform: none; transition: opacity 0.6s ease 0.25s, transform 0.6s ease 0.25s, translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
  .lifecycle.open .lc-detail:nth-child(2) { transition-delay: 0.4s; }
  .lifecycle.open .lc-detail:nth-child(3) { transition-delay: 0.55s; }
}
@media (prefers-reduced-motion: reduce) { .lc-panel, .lc-chev { transition: none; } }

/* badges (were part of the removed vertical section) */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags .tag { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }

/* compact cards inside the three narrow detail columns */
.lc-detail .stage-visual .card-kicker { font-size: 12px; letter-spacing: 0.06em; }
.lc-detail .trace { font-size: 12px; }
.lc-detail .trace .t { min-width: 58px; }
.lc-detail .trace .k { width: 32px; }
.lc-detail .checks { font-size: 14px; gap: 10px; }
.lc-detail .rec-grid { gap: 8px; }
.lc-detail .rec-grid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lc-detail .rec-grid dd { margin: 0; text-align: right; }
.lc-detail .rec-grid .flag { margin: 0 -8px; padding: 4px 8px; }
@media (max-width: 720px) {
  .lc-detail .rec-grid > div { display: block; }
  .lc-detail .rec-grid dd { margin: 2px 0 0; text-align: left; }
  .lc-detail .rec-grid .flag { margin: -6px -8px; padding: 6px 8px; }
}
/* desktop: the three detail columns share rows (subgrid), so question, headline, text, badges and card line up across columns */
@media (min-width: 721px) {
  .lc-details { grid-template-rows: repeat(4, auto); row-gap: 14px; }
  .lc-detail { display: grid; grid-template-rows: subgrid; grid-row: span 4; justify-items: center; align-items: start; }
  .lc-detail .stage-visual { justify-self: stretch; align-self: stretch; }
  /* equal-height cards: spare space sits above the footer, so its separator line stays level across the three */
  .lc-detail .visual-foot { margin-top: auto; }
}

/* open: the outer two columns move apart from the centre one (desktop only) */
@media (min-width: 721px) {
  .lifecycle.open .lc-detail:nth-child(1) { translate: calc(var(--spread) * -1) 0; }
  .lifecycle.open .lc-detail:nth-child(3) { translate: var(--spread) 0; }
}

/* open: the original timeline columns and their nodes move apart too, staying above their details.
   --node-shift is --spread converted to SVG user units by the toggle script. */
.tl-node { translate: 0 0; }
.stage-link { translate: 0 0; }
@media (min-width: 721px) {
  .lifecycle.open .timeline-grid .stage-link:nth-child(1) { translate: calc(var(--shift) * -1) 0; }
  .lifecycle.open .timeline-grid .stage-link:nth-child(3) { translate: var(--shift) 0; }
  .lifecycle.open .tl-node.n1 { translate: calc(var(--node-shift) * -1) 0; }
  .lifecycle.open .tl-node.n3 { translate: var(--node-shift) 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .tl-node { transition: translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
  .stage-link { transition: translate 0.4s ease; }
}

/* badges: tighter so all of a stage's badges can share one row in a wide column */
.lc-detail .tags { gap: 6px; }
.lc-detail .tags .tag { padding: 3px 9px; font-size: 12px; }

/* archived-run card: switch to two label-over-value columns whenever the card is wide enough for the longest value */
.lc-detail .stage-visual { container-type: inline-size; padding: 16px; }
@container (min-width: 310px) {
  .lc-detail .rec-grid { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .lc-detail .rec-grid > div { display: block; }
  .lc-detail .rec-grid dd { margin: 2px 0 0; text-align: left; }
  .lc-detail .rec-grid .flag { margin: -6px -8px; padding: 6px 8px; }
}
/* keep the highlighted decision cell off the footer separator */
.lc-detail .rec-grid { margin-bottom: 6px; }

/* Life card: flagged drift row with a detail hint underneath, in one highlighted block */
.trace > .flagged { display: block; background: var(--color-accent-900); border-radius: 4px; margin: 0 -8px; padding: 0 8px 6px; color: var(--color-accent-200); }
.trace .flagged .line { display: flex; gap: 10px; }
.trace .flagged .t { color: var(--color-neutral-500); }
.trace .flagged .k { color: var(--color-accent-300); }
.trace .flagged .hint { margin-top: -2px; font-size: 12px; line-height: 1.5; color: var(--color-accent-300); }

/* equal-height cards: let the rows of the two shorter cards share the spare height evenly */
@media (min-width: 721px) {
  .lc-detail .checks { flex: 1; justify-content: space-between; }
  .lc-detail .trace { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
}
