/* ==========================================================================
   SITE — the marketing pages (/, the five intent pages, privacy, terms,
   imprint). The editor has its own stylesheet; this one never loads there.

   Both link ../editor/css/tokens.css first, so the palette, the type and the
   spacing scale come from one place. Nothing in this file may re-declare a
   ramp value — if a colour is missing, add it to tokens.css.

   Visual language comes from the brand handoff's marketing set: full-bleed
   purple bands carrying white Aleo display type, red used sparingly as the
   accent inside them, generous white between. See docs/design-system.md.

   ORDER, and it matters — there is no build step, so source order breaks
   specificity ties: base elements -> layout -> buttons -> components ->
   page-specific -> media queries last.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Marketing-only tokens. These are compositions of ramp steps, never new
   colours. Section rhythm is much larger than the app's --space-* scale,
   which is tuned for a dense control panel, so it gets its own steps.
   -------------------------------------------------------------------------- */
:root {
  --measure: 68ch;          /* readable line length for prose */
  --page-max: 72rem;        /* the content column */
  --page-gutter: 1.5rem;

  --band-y: 5.5rem;         /* vertical padding of a full-bleed section */
  --band-y-sm: 3.5rem;
  --stack: 1.5rem;          /* gap between blocks inside a section */

  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-lift: 0 1px 2px rgba(27, 0, 89, .08), 0 12px 32px rgba(27, 0, 89, .12);
  --shadow-float: 0 2px 8px rgba(27, 0, 89, .10), 0 24px 64px rgba(27, 0, 89, .18);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  /* Anchors from the in-page nav must not land under the sticky header. */
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* Sticky footer. A short page — the 404, and the legal pages once their
   placeholders are cut down — otherwise ends mid-viewport with a strip of
   white below the dark footer, which reads as the page having failed to
   finish loading. `main` takes the slack so the footer is always on the
   bottom edge; on a long page this changes nothing.
   `flex: 1 0 auto` rather than `1`: the shorthand's `flex-basis: 0` would
   ignore the content's own height and let a tall main be compressed. */
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font: 400 1rem/1.65 var(--font-ui);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body > main { flex: 1 0 auto; }
body > .sitefooter { flex: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0; }

a { color: var(--purple-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--purple-darker); }

img, svg, picture { max-width: 100%; }
img { height: auto; display: block; }

ul, ol { margin: 0; padding-left: 1.25rem; }
li + li { margin-top: 0.4rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 2px;
}

/* On any dark ground the default purple focus ring is invisible against its own
   background. `.hero` is in this list because it is purple without carrying
   .band-purple — it is its own section type, and leaving it out made every
   focusable thing in the hero unreachable by eye when tabbing. */
.band-purple :focus-visible,
.hero :focus-visible,
.sitefooter :focus-visible { outline-color: #ffffff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--purple);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Layout: bands and the content column
   A "band" is a full-bleed horizontal stripe; `.wrap` is the column inside it.
   Every section on every page is one of these, which is what keeps the
   rhythm identical from the home page to the imprint.
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.wrap-narrow { max-width: 48rem; }

.band { padding-block: var(--band-y); }
.band-sm { padding-block: var(--band-y-sm); }

.band-light   { background: var(--surface); }
.band-purple  { background: var(--purple); color: #fff; }
.band-dark    { background: var(--surface-dark); color: var(--on-dark); }

.band-purple h1, .band-purple h2, .band-purple h3 { color: #fff; }
.band-purple p { color: var(--purple-light); }

/* `:not(.btn)` is load-bearing. This rule is for prose links inside a purple
   band; without the exclusion it also matches the CTA buttons, and at 0-2-0 it
   outranks `.btn-invert`'s 0-1-0 — painting a white label on a white button.
   That shipped once and the CTAs were invisible rectangles. Scoping the button
   rule up to `.band-purple .btn-invert` would also work, but excluding buttons
   here says what is actually meant: buttons are not prose links. */
.band-purple a:not(.btn) { color: #fff; }

/* A hairline between two same-coloured bands, so sections do not merge. */
.band + .band-light,
.band-light + .band { border-top: 1px solid var(--border); }
.band-purple + .band-light,
.band-light + .band-purple,
.band-purple + .band,
.band + .band-purple { border-top: 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 46rem;
  margin-bottom: 2.75rem;
}
.section-head p { font-size: 1.075rem; color: var(--muted); }
.band-purple .section-head p { color: var(--purple-light); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-dark);
}
.band-purple .eyebrow { color: var(--purple-light-active); }

/* --------------------------------------------------------------------------
   Buttons
   Sits above the components on purpose: an element-level rule here would
   otherwise beat a component rule further down on a specificity tie.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-lg { padding: 1.05rem 2rem; font-size: 1.075rem; }

.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-hover); color: #fff; }
.btn-primary:active { background: var(--purple-active); }

/* For use on a purple band: white fill, purple ink — the inverse. */
.btn-invert { background: #fff; color: var(--purple-dark); }
.btn-invert:hover { background: var(--purple-light); color: var(--purple-darker); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple-dark); }

/* Outline on purple. Border is the light ramp step, not white at low alpha —
   a transparency would shift against anything placed behind the band. */
.btn-outline-invert {
  background: transparent;
  border-color: var(--purple-light-active);
  color: #fff;
}
.btn-outline-invert:hover { background: var(--purple-dark); color: #fff; border-color: #fff; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.cta-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.9rem;
}
.band-purple .cta-note { color: var(--purple-light-active); }

/* The small "Try it →" that closes each feature section. */
.try-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--purple-dark);
  text-decoration: none;
}
.try-link:hover { text-decoration: underline; }
.try-link::after { content: "\2192"; transition: transform .15s; }
.try-link:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */
.siteheader {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.siteheader > .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 4.25rem;
}

.brand {
  --wordmark-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  text-decoration: none;
  flex: none;
}
/* Ramp tokens, not --accent: the logo is identity, not role. Same reasoning
   as the editor's copy of this rule — see docs/design-system.md. */
.brand-mark { width: calc(var(--wordmark-size) * 1.33); height: calc(var(--wordmark-size) * 1.33); flex: none; }
.brand-mark-page    { fill: var(--purple); }
.brand-mark-overlay { fill: var(--red); }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--wordmark-size);
  letter-spacing: -0.01em;
  color: var(--purple);
  line-height: 1;
}
.brand:hover .brand-word { color: var(--purple-dark); }

.badge-beta {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  line-height: 1;
}

.sitenav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
/* `:not(.btn)` for the same reason as `.band-purple a:not(.btn)` above, and
   this one had teeth on :hover specifically. `.sitenav a:hover` is 0-2-1 and
   beat `.btn-primary:hover` at 0-2-0, so hovering "Open the tool" painted
   --purple-dark text onto a --purple-hover fill: legible at rest, unreadable
   the moment you pointed at it.
   Excluding buttons is the fix rather than out-specifying them — a nav link
   and a nav button are different components that happen to share a tag. */
.sitenav a:not(.btn) {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.sitenav a:not(.btn):hover { color: var(--purple-dark); }

/* Size only. Colour comes from .btn-primary — re-declaring it here is what
   masked the bug above at rest. */
.sitenav .btn { padding: 0.6rem 1.1rem; font-size: 0.925rem; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background: var(--purple);
  color: #fff;
  padding-block: 4.5rem 0;
  overflow: hidden;
}

/* A hero with no .hero-shot under it. The zero bottom padding above exists so
   the screenshot can overhang the band edge; without a screenshot the last
   control sits flush on that edge and looks clipped. */
.hero-plain { padding-block: 5.5rem; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero-sub {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--purple-light);
  max-width: 46rem;
  margin-top: 1.25rem;
}
.hero .cta-group { margin-top: 2rem; }
.hero .cta-note { color: var(--purple-light-active); }

/* The screenshot straddles the purple/white boundary: it sits in the hero but
   its lower half overhangs the section below, which is what gives the band a
   product to hold rather than just type. The negative margin is cancelled by
   matching padding on the following section (.after-hero). */
.hero-shot {
  margin-top: 3.5rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  background: #fff;
  line-height: 0;
}
.hero-shot img { width: 100%; }

/* --------------------------------------------------------------------------
   Trust strip
   -------------------------------------------------------------------------- */
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.trust-item { display: flex; flex-direction: column; gap: 0.4rem; }
.trust-item h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
}
.trust-item p { color: var(--muted); font-size: 0.95rem; }
.trust-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: var(--purple);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Feature rows — screenshot one side, copy the other, alternating
   -------------------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 3rem;
  align-items: center;
}
.feature + .feature { margin-top: 5rem; }

/* Flip every other row. `order` rather than `direction` so the DOM order stays
   copy-then-image on a phone, where the heading must come first. */
.feature-flip .feature-media { order: -1; }

.feature-body { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.feature-body p { color: var(--muted); }
.feature-body ul { color: var(--fg); }
.feature-body li::marker { color: var(--red); }

.feature-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  line-height: 0;
  background: #fff;
}

/* --------------------------------------------------------------------------
   Steps, audience cards, FAQ
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem;
  counter-reset: step;
}
.step { display: flex; flex-direction: column; gap: 0.6rem; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--purple-light);
  color: var(--purple-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.step p { color: var(--muted); font-size: 0.95rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.card p { color: var(--muted); font-size: 0.95rem; }

/* Native <details>, so the FAQ needs no JavaScript. */
.faq { display: flex; flex-direction: column; }
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary:hover { color: var(--purple-dark); }
.faq-answer { padding: 0 0 1.25rem; color: var(--muted); max-width: var(--measure); }
.faq-answer p + p { margin-top: 0.75rem; }

/* --------------------------------------------------------------------------
   Mid-page and closing CTA bands
   -------------------------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band .wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.cta-band h2 { max-width: 20ch; }
.cta-band p { max-width: 46rem; }
.cta-band .cta-group { margin-top: 0.75rem; justify-content: center; }

/* --------------------------------------------------------------------------
   Prose — legal pages and intent-page body copy.
   Deliberately plain: privacy and terms are read for precision, not delight.
   -------------------------------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 2.75rem; font-size: 1.6rem; }
.prose h3 { margin-top: 2rem; font-size: 1.2rem; }
.prose h2 + p, .prose h3 + p { margin-top: 0.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: 0.35rem; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-sunken);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th { font-weight: 700; background: var(--surface); }

.page-head { display: flex; flex-direction: column; gap: 0.85rem; }
.page-head .lede { font-size: 1.1rem; color: var(--muted); max-width: var(--measure); }
.page-meta { font-size: 0.875rem; color: var(--muted); }

/* Unfilled legal details. Deliberately loud: an Impressum that ships with a
   placeholder in it is a legal problem, not a cosmetic one, so these must be
   impossible to miss in a casual read-through. Delete the markup, not the
   style, once the real value is in. */
.needs-input {
  background: var(--red-light);
  color: var(--red-darker);
  border: 1px dashed var(--red);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  font-weight: 700;
  font-size: 0.9em;
}
.draft-notice {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: var(--red-light);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--red-darker);
  font-size: 0.95rem;
}
.draft-notice strong { display: block; }

/* Breadcrumb on inner pages — orientation, and it earns the sitelinks. */
.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--purple-dark); text-decoration: underline; }
.crumbs span { margin-inline: 0.4rem; }

/* Cross-links between the intent pages. */
.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.related a {
  display: block;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}
.related a:hover { border-color: var(--purple); color: var(--purple-dark); }

/* --------------------------------------------------------------------------
   Footer — the app's dark band, repeated, so the two halves of the site end
   the same way.
   -------------------------------------------------------------------------- */
.sitefooter {
  background: var(--surface-dark);
  color: var(--on-dark-muted);
  padding-block: 3rem 2rem;
  font-size: 0.9rem;
}
/* Same exclusion, pre-emptively: the footer holds no button today, but it is
   the obvious place for one, and this rule would swallow its label. */
.sitefooter a:not(.btn) { color: var(--on-dark); text-decoration: none; }
.sitefooter a:not(.btn):hover { text-decoration: underline; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #333;
}
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.footer-col h4 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.footer-brand .brand-word { color: #fff; }
.footer-brand p { max-width: 22rem; margin-top: 0.25rem; }

.footer-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
}
.footer-privacy { display: inline-flex; align-items: center; gap: 0.45rem; }
.footer-privacy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }

/* --------------------------------------------------------------------------
   Media queries LAST, so their overrides win on an equal-specificity tie.
   (The editor's stylesheet learned this the hard way — a max-width block
   placed before the component rules is silently dead.)
   -------------------------------------------------------------------------- */
@media (max-width: 52rem) {
  :root { --band-y: 3.5rem; --band-y-sm: 2.5rem; }

  /* The nav collapses to the CTA alone. A hamburger for three links would be
     more chrome than content, and the links all repeat in the footer. */
  .sitenav a:not(.btn) { display: none; }

  .hero { padding-block: 2.75rem 0; }
  .hero-shot { margin-top: 2.5rem; }

  .feature + .feature { margin-top: 3rem; }
  .feature { gap: 2rem; }
  /* Image below copy on a phone regardless of which side it takes on desktop. */
  .feature-flip .feature-media { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
