/* ─── Nofira marketing site · base stylesheet ─────────────────────────
   Brand: ink #0D1730 (backgrounds), text #101a2b · accent #2c5be3 (light) / #4f7dff (on dark) · line #e6e9ef
   Type: Geist for everything, system mono for labels. The wordmark keeps Space
   Grotesk (brand kit), subset down to the six letters the logo needs.
   This file holds the design tokens and the shared components (header, buttons,
   forms, privacy dialog, FAQ, footer, legal pages). Page sections live in site.css.
   Both files are minified and inlined by scripts/build.py; the legal pages load
   this file directly. */

/* Self-hosted fonts (GDPR: no Google Fonts hotlink, visitor IPs stay here).
   Geist is a variable font under the SIL Open Font License. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/geist-latin.woff2') format('woff2');
}

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

:root {
  --ink: #0D1730;
  --ink-deep: #0b1220;
  --bg-0: #ffffff;
  --bg-1: #f5f7fa;
  --bg-2: #eef1f6;
  --line: #e6e9ef;
  --line-strong: #d4dae4;
  --t1: #101a2b;
  --t2: #3a4760;
  --t3: #66728a;
  --accent: #2c5be3;
  --accent-dark: #1d4ed8;
  --accent-bright: #4f7dff;
  --accent-soft: rgba(44, 91, 227, 0.08);
  --on-ink-1: #ffffff;
  --on-ink-2: #c7d0e0;
  --on-ink-3: #8e9ab3;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --disp: var(--sans);
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, 'Cascadia Mono', monospace;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --container: 1160px;
  --header-h: 64px;
  --sp: clamp(88px, 11vw, 152px);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  background: var(--bg-0);
  color: var(--t2);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Bilingual double DOM: the build strips the other language; this is the fallback */
html[data-lang="de"] .en { display: none !important; }
html[data-lang="en"] .de { display: none !important; }

::selection { background: var(--accent); color: #fff; }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
/* Links inside running text stay distinguishable without relying on colour alone */
p a:not(.btn), dd a, li a:not(.btn):not([data-app]), .field-check a, .lead-hint a, .faq-a a, .legal-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

h1, h2, h3 { font-family: var(--disp); color: var(--t1); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
.dot { color: var(--accent); }

.anchor-alias { display: block; height: 0; overflow: hidden; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.nb { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── Kicker: small mono label with the brand dot ── */
.k {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.k::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.k--plain::before { display: none; }

/* ── Logo: the Nofira cartouche (brand kit 2026-11-13). Light cut in the
   white header, dark cut (ivory letters) in the ink footer. Never below 140 px. ── */
.wordmark { display: inline-flex; align-items: center; line-height: 1; }
.wordmark img { display: block; width: 160px; height: auto; }

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s;
}
.site-header.scrolled { background: rgba(255, 255, 255, 0.97); border-bottom-color: var(--line); }
.site-header .header-inner { transform: translateZ(0); }
.header-inner { display: flex; align-items: center; gap: 24px; width: 100%; }
.header-inner .wordmark { flex: none; }

.main-nav { display: flex; gap: 22px; margin-left: 8px; }
.main-nav a { color: var(--t2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: color 0.15s; padding: 6px 0; }
.main-nav a:hover { color: var(--t1); }
.main-nav a[aria-current="page"] { color: var(--t1); box-shadow: inset 0 -2px 0 var(--accent); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 99px; overflow: hidden;
  font-size: 12px; font-weight: 600; background: var(--bg-0);
}
.lang-switch a, .lang-switch button {
  display: inline-block; background: none; border: none; color: var(--t3); padding: 6px 11px;
  cursor: pointer; font: inherit; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.lang-switch a.active, .lang-switch button.active { background: var(--accent-soft); color: var(--accent); }
.lang-switch a:hover:not(.active), .lang-switch button:hover:not(.active) { color: var(--t1); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.2;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--t1); background: var(--bg-0); }
.btn-ghost:hover { border-color: var(--t1); color: var(--t1); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e8eefc; color: var(--ink); }
.btn-ghost-light { border-color: rgba(255, 255, 255, 0.32); color: #fff; background: transparent; }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn .arr { transition: transform 0.18s; }
.btn:hover .arr { transform: translateX(3px); }

/* ── Mobile nav ── */
.nav-toggle { display: none; background: none; border: none; color: var(--t1); cursor: pointer; padding: 8px; }
.nav-toggle svg { display: block; }
.m-only { display: none; }

/* ── Forms (demo, lab access, supplier registration) ── */
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lead-grid .full { grid-column: 1 / -1; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--t2); margin-bottom: 6px; }
.field > input, .field > select, .field > textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--t1);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 13px; background: var(--bg-0);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field > input:focus, .field > select:focus, .field > textarea:focus, .lead-form input:not([type=checkbox]):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field > textarea { min-height: 92px; resize: vertical; }
.field-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--t3); line-height: 1.5; }
.field-check input { margin-top: 3px; flex: none; }
.field-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }
.lead-error { color: #b91c1c; font-size: 14px; margin-top: 10px; }
.lead-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.lead-hint { font-size: 13px; color: var(--t3); max-width: 34ch; line-height: 1.45; }
.is-sending .btn-primary { opacity: 0.6; pointer-events: none; }
.lead-done { text-align: center; padding: 28px 8px; }
.lead-done .ok { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 22px; font-weight: 700; }
.lead-done h3 { margin-bottom: 8px; font-size: 21px; }
.lead-done p { color: var(--t2); font-size: 15px; max-width: 40ch; margin: 0 auto 18px; }
.field legend { display: block; font-size: 13px; font-weight: 600; color: var(--t2); margin-bottom: 8px; padding: 0; }
fieldset.field { border: 0; padding: 0; min-width: 0; grid-column: 1 / -1; }

/* Category picker (supplier form; rendered by lead-form.js from categories.js) */
.cat-field legend { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cat-total { font-weight: 500; color: var(--t3); font-size: 12.5px; }
.cat-total b { color: var(--accent); font-size: 13px; }
.cat-help { font-size: 13px; color: var(--t3); margin-bottom: 10px; }
.cat-picker { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.cat-group { border-top: 1px solid var(--line); }
.cat-group:first-child { border-top: 0; }
.cat-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; font-size: 14.5px; font-weight: 600; color: var(--t1); background: var(--bg-0);
}
.cat-group summary::-webkit-details-marker { display: none; }
.cat-group summary::before { content: '+'; color: var(--accent); font-weight: 400; font-size: 18px; line-height: 1; width: 14px; flex: none; }
.cat-group[open] summary::before { content: '−'; }
.cat-group summary:hover { background: var(--bg-1); }
.cat-name { flex: 1; }
.cat-n { font-size: 12px; font-weight: 600; color: var(--t3); background: var(--bg-1); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }
.cat-n.on { color: var(--accent-dark); background: var(--accent-soft); border-color: rgba(44, 91, 227, 0.3); }
.cat-subs { padding: 4px 14px 12px 38px; background: var(--bg-1); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.cat-tools { grid-column: 1 / -1; display: flex; gap: 14px; margin: 4px 0 4px; }
.cat-tools button { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.cat-tools button:hover { color: var(--accent-dark); text-decoration: underline; }
.cat-sub { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--t2); cursor: pointer; line-height: 1.4; }
.cat-sub input { margin-top: 3px; flex: none; }

/* ── Privacy dialog (consent.js) ── */
.consent-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(16, 26, 43, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.consent-backdrop[hidden] { display: none; }
.consent-dialog { position: relative; width: min(560px, 100%); background: var(--bg-0); border-radius: var(--r-lg); padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(16, 26, 43, 0.35); max-height: 90vh; overflow: auto; }
.consent-dialog h2 { font-size: 22px; margin-bottom: 10px; padding-right: 30px; }
.consent-intro { font-size: 15px; color: var(--t2); margin-bottom: 14px; }
.consent-list { list-style: none; margin-bottom: 18px; }
.consent-list li { display: flex; gap: 12px; align-items: baseline; font-size: 14px; color: var(--t3); padding: 7px 0; border-bottom: 1px solid var(--line); }
.consent-list code { font-family: var(--mono); font-size: 12.5px; color: var(--t1); background: var(--bg-1); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.consent-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-1); font-size: 14px; color: var(--t3); line-height: 1.55; cursor: pointer; }
.consent-toggle input { margin-top: 4px; flex: none; width: 18px; height: 18px; }
.consent-toggle strong { display: block; color: var(--t1); margin-bottom: 4px; }
.consent-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.consent-actions a { font-weight: 600; font-size: 14.5px; }
.consent-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--t3); cursor: pointer; padding: 6px; }
.consent-close:hover { color: var(--t1); }
body.consent-open { overflow: hidden; }

/* ── FAQ: native details/summary ── */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 20px 44px 20px 0;
  font-family: var(--disp); font-weight: 600; font-size: 1.1rem; line-height: 1.35;
  color: var(--t1); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-weight: 300; font-size: 26px; line-height: 1; color: var(--accent); transition: transform 0.25s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { padding: 0 0 22px; font-size: 15.5px; color: var(--t2); max-width: 66ch; }

/* ── Footer (ink) ── */
.site-footer { background: var(--ink); border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 72px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 0.9fr; gap: 32px; margin-bottom: 52px; }
.footer-brand p { margin-top: 16px; font-size: 14px; color: var(--on-ink-3); max-width: 30ch; }
.footer-col h3 { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #7c89a6; margin-bottom: 16px; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--on-ink-2); font-size: 14.5px; }
.footer-col a:hover { color: #ffffff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.10); padding-top: 26px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--on-ink-3);
}
.footer-bottom .lang-switch { margin-left: auto; border-color: rgba(255, 255, 255, 0.22); background: transparent; }
.footer-bottom .lang-switch a, .footer-bottom .lang-switch button { color: var(--on-ink-3); }
.footer-bottom .lang-switch a.active, .footer-bottom .lang-switch button.active { background: rgba(79, 125, 255, 0.16); color: #9db5ff; }
.footer-bottom .lang-switch a:hover:not(.active), .footer-bottom .lang-switch button:hover:not(.active) { color: #ffffff; }
.footer-contact { margin-top: 14px; }
.footer-contact a { color: #9db5ff; font-weight: 600; display: inline-block; padding: 4px 0; }
.footer-contact a:hover { color: #ffffff; }

/* ── Legal pages (imprint, privacy, terms) ── */
.legal-page { padding: calc(var(--header-h) + 64px) 0 96px; }
.legal-page .container { max-width: 820px; }
.legal-page h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 10px; }
.legal-meta { font-size: 13.5px; font-weight: 500; color: var(--t3); margin-bottom: 36px; }
.legal-draft { border: 1px solid rgba(180, 83, 9, 0.30); background: #fffbeb; color: #92400e; border-radius: var(--r-md); padding: 14px 18px; font-size: 14px; margin-bottom: 36px; }
.legal-lang-note { border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--t3); border-radius: var(--r-md); padding: 14px 18px; font-size: 14px; margin-bottom: 36px; }
.legal-body h2 { font-size: 20px; margin: 38px 0 14px; }
.legal-body p { margin-bottom: 14px; font-size: 15.5px; color: var(--t2); white-space: pre-line; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 42px; }
.legal-nav a { font-size: 13.5px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 7px 16px; color: var(--t2); background: var(--bg-0); }
.legal-nav a.active { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.legal-nav a:hover { border-color: var(--accent); }

/* ── Scroll reveal (subtle: opacity + 14px, no pinning) ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.vis { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.07s; }
.reveal-d2 { transition-delay: 0.14s; }
.reveal-d3 { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn .arr, .faq summary::after { transition: none; }
}

/* ── Responsive base ── */
@media (max-width: 1080px) {
  .main-nav {
    display: none;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #ffffff; border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(16, 26, 43, 0.14);
    padding: 10px 24px 16px; margin: 0;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .main-nav a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  .main-nav a:last-child { border-bottom: none; }
  .main-nav .m-only { display: block; }
  .nav-toggle { display: block; }
  .header-actions .btn-ghost.hide-m { display: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { gap: 14px; }
  .header-actions { gap: 8px; }
  .header-actions .btn-sm { display: none; }
  .header-inner .wordmark img { width: 140px; }
  .lead-grid { grid-template-columns: 1fr; }
  .lead-grid .full { grid-column: auto; }
  .cat-subs { grid-template-columns: 1fr; padding-left: 14px; }
  .consent-actions { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}
