/* easo-web — design system from the brand book (Pitch 1). Tokens: brand/easo/tokens.md;
   components: brand/easo/components.md. System fonts only, WCAG 2.2 AA, light + dark. */

:root {
  /* Colour — light */
  --page: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #edf0f4;
  --ink: #12151b;
  --muted: #565d69;
  --brand: #0f4c91;
  --brand-strong: #0b3a72;
  --accent-proof: #0e6e77;
  --success: #1e7a3b;
  --warning: #8a5a00;
  --danger: #b42318;
  --border: #d6dce4;
  --border-strong: #7c848f;
  --badge-bg: #e9f1fa;
  --hero-wash: #e9f1fa;
  --focus: #1565d8;

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  /* Spacing — 4px rhythm */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;
  --space-9: 6rem; --space-10: 8rem;

  /* Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-pill: 999px;

  /* Layout */
  --content: 75rem;   /* 1200 */
  --measure: 45rem;   /* 720  */
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1116;
    --surface: #161a21;
    --surface-raised: #1e242d;
    --ink: #edeff3;
    --muted: #a6aebb;
    --brand: #6ea8f0;
    --brand-strong: #8fbef5;
    --accent-proof: #46c7bd;
    --success: #65d08c;
    --warning: #e7b24d;
    --danger: #f19289;
    --border: #2a313c;
    --border-strong: #6b7380;
    --badge-bg: #16233b;
    --hero-wash: #16233b;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.625;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); margin: 0 0 var(--space-4); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.375rem); line-height: 1.14; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; line-height: 1.21; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.3125rem; line-height: 1.33; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
a:visited { color: var(--brand-strong); }

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

strong { font-weight: 600; }
/* German auto-hyphenation helps body copy but breaks display type at ugly points —
   keep it for text, switch it off for headings (they wrap at word boundaries instead). */
:lang(de) { hyphens: auto; }
:lang(de) h1, :lang(de) h2, :lang(de) h3 { hyphens: manual; }

.overline {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 20; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* --- Layout --- */
.container { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: var(--gutter); }
.site-main { padding-block: var(--space-7) var(--space-8); }
.site-main section + section { margin-top: var(--space-8); }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem 1.5rem; padding-block: 0.8rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-lockup { height: 2.25rem; width: auto; display: block; flex: none; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

/* Hamburger nav (mobile), inline (desktop) */
.nav-menu { position: relative; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; list-style: none;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; left: 0; top: -6px; }
.nav-toggle-icon::after { position: absolute; left: 0; top: 6px; }
.nav-menu[open] .nav-toggle-icon { background: transparent; }
.nav-menu[open] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-menu[open] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }
.nav-menu > .site-nav { display: none; }
.nav-menu[open] > .site-nav {
  display: flex; flex-direction: column; gap: 0.25rem;
  position: absolute; right: 0; top: calc(100% + 0.6rem); min-width: 210px; padding: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(18, 21, 27, 0.14); z-index: 20;
}
.site-nav a { color: var(--muted); text-decoration: none; }
.nav-menu[open] > .site-nav a { padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); }
.site-nav a:hover { color: var(--brand); }
.nav-menu[open] > .site-nav a:hover { background: var(--surface-raised); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Primary CTA in the nav — filled brand pill (stands out from the plain nav links) */
.site-nav a.nav-cta,
.nav-menu[open] > .site-nav a.nav-cta {
  color: var(--page); background: var(--brand); font-weight: 600; text-decoration: none;
  padding: 0.4rem 0.95rem; border-radius: var(--radius-pill);
}
.site-nav a.nav-cta:hover,
.nav-menu[open] > .site-nav a.nav-cta:hover { color: var(--page); background: var(--brand-strong); }
.site-nav a.nav-cta[aria-current="page"] { color: var(--page); text-decoration: none; }

/* Language pill */
.lang-pill { position: relative; }
.lang-pill > summary {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--ink); font-size: 0.9rem; cursor: pointer; list-style: none;
}
.lang-pill > summary::-webkit-details-marker { display: none; }
.lang-globe, .lang-chevron { flex: none; }
.lang-chevron { transition: transform 0.15s ease; }
.lang-pill[open] .lang-chevron { transform: rotate(180deg); }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 0.4rem); margin: 0; padding: 0.35rem;
  min-width: 160px; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(18, 21, 27, 0.14); z-index: 20;
}
.lang-pill[open] > .lang-menu { display: block; }
.lang-menu a { display: block; padding: 0.45rem 0.6rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.lang-menu a:hover { background: var(--surface-raised); color: var(--ink); }
.lang-menu a[aria-current="true"] { color: var(--ink); font-weight: 600; }

@media (max-width: 60.99rem) {
  .header-actions .lang-pill { order: -1; }
}
@media (min-width: 61rem) {
  .header-actions { gap: 1.75rem; }
  /* Precise alignment: nav CTA pill + language pill share the exact 36px logo height */
  .site-nav a.nav-cta { display: inline-flex; align-items: center; height: 2.25rem; padding-block: 0; }
  .lang-pill > summary { height: 2.25rem; padding-block: 0; }
  .nav-toggle { display: none; }
  .nav-menu::details-content { content-visibility: visible; contain-intrinsic-size: auto none; }
  .nav-menu > .site-nav, .nav-menu[open] > .site-nav {
    display: flex; flex-direction: row; align-items: center; gap: 1.5rem; position: static; min-width: 0;
    padding: 0; background: none; border: none; box-shadow: none;
  }
  .nav-menu[open] > .site-nav a { padding: 0; }
  .nav-menu[open] > .site-nav a:hover { background: none; }
}

/* --- Buttons --- */
.cta {
  display: inline-block; background: var(--brand); color: var(--page); text-decoration: none;
  font-weight: 500; padding: 0.7rem 1.4rem; border-radius: var(--radius-md);
}
.cta:link, .cta:visited { color: var(--page); }
.cta:hover { background: var(--brand-strong); color: var(--page); }
.cta svg { vertical-align: -0.2em; margin-right: 0.5em; }

/* Download page — button row + "coming soon" (disabled) state */
.dl-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.cta-soon { background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); cursor: default; }
.cta-soon:hover { background: var(--surface); color: var(--muted); }
.dl-platform { color: var(--muted); font-size: 0.95rem; }
.hero-note { color: var(--muted); font-size: 0.95rem; margin-left: 0.5rem; }

/* Newsletter form (native, first-party) */
.nl-form { max-width: 30rem; }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nl-field { margin-bottom: 0.9rem; }
.nl-field label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.nl-field input {
  width: 100%; padding: 0.6rem 0.7rem; font: inherit;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
}
.nl-field input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nl-consent { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 1.1rem; }
.nl-form button.cta { border: none; cursor: pointer; }

/* --- Hero (banner) --- */
/* Contextual back-link on the git explainer — hidden until nav.js reveals it (see there). */
.back-ref {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 500; color: var(--brand);
}
.back-ref[hidden] { display: none; }
.back-ref:hover { text-decoration: underline; }
.back-ref-arrow { flex: none; }

.hero { padding: var(--space-7) 0 var(--space-5); }

/* Knowledge-hub search (Pagefind UI, self-hosted). Themed to the site tokens, so it follows
   light/dark automatically. See ADR-0004. */
.hub-search {
  margin-block: var(--space-6) var(--space-8); max-width: var(--measure);
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--brand);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--surface);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-tag: var(--badge-bg);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: var(--radius-md);
  --pagefind-ui-font: inherit;
}
.hub-search-note { color: var(--muted); font-size: 0.95rem; margin: 0.85rem 0 0; }

/* Knowledge clause pages (rendered from the exported ADR-0022 nodes). */
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: var(--space-4); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-hidden] { margin: 0 0.3rem; }
.clause-easo {
  background: var(--hero-wash); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px); padding: var(--space-5) var(--space-6);
}
.clause-easo > h2 { margin-top: 0; }
.hero .lead { font-size: 1.125rem; line-height: 1.61; color: var(--muted); margin: 0; max-width: 46ch; }

.hero--banner {
  background: var(--hero-wash); border-radius: 16px; padding: clamp(1.75rem, 4vw, 3.25rem);
  display: grid; gap: var(--space-6); margin: var(--space-6) 0 var(--space-8);
}
.hero-content h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.03em; hyphens: manual; }
.hero-content .lead { margin-bottom: var(--space-5); }
.hero-media { display: flex; justify-content: center; align-items: center; }
.hero-media svg { width: 100%; height: auto; max-width: 520px; }

/* Lifecycle diagram: gentle looping build-in (Draft -> Review -> Released, then the check).
   Static for reduced-motion / no-JS. Connectors + check draw via pathLength=1. */
@media (prefers-reduced-motion: no-preference) {
  .hero-diagram .hm-conn,
  .hero-diagram .hm-check { stroke-dasharray: 1; }
  .hero-diagram .hm-node-1 { animation: hm-n1 8s ease-in-out infinite; }
  .hero-diagram .hm-node-2 { animation: hm-n2 8s ease-in-out infinite; }
  .hero-diagram .hm-node-3 { animation: hm-n3 8s ease-in-out infinite; }
  .hero-diagram .hm-conn-1 { animation: hm-c1 8s ease-in-out infinite; }
  .hero-diagram .hm-conn-2 { animation: hm-c2 8s ease-in-out infinite; }
  .hero-diagram .hm-check  { animation: hm-ck 8s ease-in-out infinite; }
  .hero-diagram .hm-arrow-1 { animation: hm-a1 8s ease-in-out infinite; }
  .hero-diagram .hm-arrow-2 { animation: hm-a2 8s ease-in-out infinite; }
  .hero-diagram .hm-confetti { animation: hm-cf 8s ease-out infinite; }
}
.hero-diagram .hm-arrow { fill: var(--muted); }
.hero-diagram .hm-confetti { transform-box: fill-box; transform-origin: center; opacity: 0; }
@keyframes hm-n1 { 0%,3%{opacity:0} 9%,88%{opacity:1} 95%,100%{opacity:0} }
@keyframes hm-n2 { 0%,17%{opacity:0} 23%,88%{opacity:1} 95%,100%{opacity:0} }
@keyframes hm-n3 { 0%,31%{opacity:0} 37%,88%{opacity:1} 95%,100%{opacity:0} }
@keyframes hm-c1 { 0%,9%{stroke-dashoffset:1;opacity:0} 12%,88%{stroke-dashoffset:0;opacity:1} 95%{opacity:0} 100%{stroke-dashoffset:1;opacity:0} }
@keyframes hm-c2 { 0%,23%{stroke-dashoffset:1;opacity:0} 26%,88%{stroke-dashoffset:0;opacity:1} 95%{opacity:0} 100%{stroke-dashoffset:1;opacity:0} }
@keyframes hm-ck { 0%,37%{stroke-dashoffset:1;opacity:0} 40%,88%{stroke-dashoffset:0;opacity:1} 95%{opacity:0} 100%{stroke-dashoffset:1;opacity:0} }
@keyframes hm-a1 { 0%,15%{opacity:0} 20%,88%{opacity:1} 95%,100%{opacity:0} }
@keyframes hm-a2 { 0%,29%{opacity:0} 34%,88%{opacity:1} 95%,100%{opacity:0} }
@keyframes hm-cf {
  0%,42%   { opacity: 0; transform: translate(0, 0) scale(0.3); }
  46%      { opacity: 1; transform: translate(0, 0) scale(1); }
  60%,100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.85) rotate(var(--rot, 0)); }
}
@media (min-width: 52rem) {
  .hero--banner { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: var(--space-8); }
}

/* --- Cards / trust grid --- */
.trust ul {
  list-style: none; margin: var(--space-6) 0; padding: 0; display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.trust li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem; box-shadow: 0 1px 3px rgba(18, 21, 27, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.trust li:hover { border-color: var(--border-strong); box-shadow: 0 4px 12px rgba(18, 21, 27, 0.08); }
.trust h2 { font-size: 1.3125rem; line-height: 1.33; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.trust p { font-size: 1rem; color: var(--muted); margin: 0; max-width: none; }

/* --- Badge --- */
.badge {
  display: inline-block; font-size: 0.8125rem; font-weight: 600; color: var(--brand);
  background: var(--badge-bg); border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  border-radius: var(--radius-pill); padding: 0.25rem 0.9rem; margin: 0 0 1.25rem;
}

.lead { font-size: 1.125rem; line-height: 1.61; color: var(--muted); }

/* --- Notify CTA --- */
.notify { border-top: 1px solid var(--border); margin-top: var(--space-8); padding-top: var(--space-7); }
.notify-pending { color: var(--muted); }

/* --- Legal --- */
.legal { padding: var(--space-6) 0 var(--space-4); }
.legal h1 { margin-bottom: var(--space-5); }
.legal h2 { font-size: 1.3125rem; margin: var(--space-6) 0 var(--space-2); }
.legal p { margin: 0 0 var(--space-3); }

/* --- FAQ --- */
.faq-item { border-top: 1px solid var(--border); padding: var(--space-5) 0; max-width: var(--measure); }
.faq-item:last-of-type { border-bottom: 1px solid var(--border); }
.faq-item h2, .faq-item h3 { font-size: 1.3125rem; line-height: 1.33; margin: 0 0 0.5rem; }
.faq-item p { margin: 0; color: var(--muted); }

/* --- Footer (fixed dark, both modes) --- */
.site-footer { background: #0c1e38; color: #a7b2c4; margin-top: var(--space-9); font-size: 0.95rem; }
.site-footer a, .site-footer a:visited { color: #a7b2c4; text-decoration: none; }
.site-footer a:hover { color: #ffffff; text-decoration: underline; }
.footer-inner {
  display: grid; gap: var(--space-6) var(--space-7); grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  align-items: start; padding-block: var(--space-7) var(--space-6);
}
.footer-brand { max-width: 22rem; }
.footer-logo-link { display: inline-block; line-height: 0; }
.footer-logo { height: 44px; width: auto; display: block; }
.footer-tagline { margin: 1.1rem 0 0; color: #a7b2c4; line-height: 1.55; max-width: none; }
.footer-product { margin: 0.75rem 0 0; color: #8595ad; }
.footer-product a:hover { color: #fff; }
.footer-heading {
  margin: 0.35rem 0 1rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #eef2f7;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.footer-social { display: flex; gap: 0.85rem; }
.footer-social a { display: inline-flex; color: #a7b2c4; }
.footer-social a:hover { color: #ffffff; }
.footer-bar { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.footer-bar-inner {
  padding-block: 1.1rem; font-size: 0.875rem; color: #8595ad;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap;
}
.footer-copy { margin: 0; max-width: none; }
@media (max-width: 52rem) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .footer-inner { grid-template-columns: 1fr; }
}
