/*
 * Tornaido site styles. One file, no build step, no external requests.
 * Tokens follow the Lernaido design system (DESIGN.md): light slate surfaces,
 * 1px borders, one primary accent, Plus Jakarta Sans, no gradients, glows or blur.
 *
 * --brand (#0284C7) is the brand blue for large type and non-text accents.
 * --link / --btn (#0369A1) are used for link text and buttons, because white on
 * #0284C7 is only 4.1:1 and the WCAG AA minimum for body-size text is 4.5:1.
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --subtle: #f1f5f9;
  --border: #e2e8f0;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #64748b;
  --border-strong: #cbd5e1;
  --brand: #0284c7;
  --link: #0369a1;
  --link-hover: #075985;
  --btn: #0369a1;
  --btn-hover: #075985;
  --on-btn: #ffffff;
  --ok: #047857;
  --radius: 12px;
  --radius-lg: 16px;
  --header-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Dark theme. Set by /js/site.js and the inline script in <head> (system preference by default,
   remembered choice afterwards). All text pairs below are at least 5.7:1 (WCAG AA is 4.5:1). */
:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --subtle: #1e293b;
  --border: #334155;
  --border-strong: #475569;
  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --brand: #38bdf8;
  --link: #7dd3fc;
  --link-hover: #bae6fd;
  --btn: #38bdf8;
  --btn-hover: #7dd3fc;
  --on-btn: #0f172a;
  --ok: #34d399;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.2vw, 3.5rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.625rem, 3.4vw, 2.25rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.1875rem; font-weight: 700; }
p { margin: 0; }

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

.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--btn); color: var(--on-btn); padding: 12px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-btn); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; }
.brand { margin-right: auto; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; line-height: 1; padding: 8px 0; }
.brand span { color: var(--brand); }
.brand:hover { color: var(--ink); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-2); font-size: 0.9375rem; font-weight: 500; text-decoration: none; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--subtle); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.site-nav .lang-link { border: 1px solid var(--border); font-weight: 600; margin-left: 8px; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.theme-btn, .menu-btn {
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.theme-btn { display: none; }
.js .theme-btn { display: inline-flex; }
.theme-btn:hover, .menu-btn:hover { background: var(--subtle); border-color: var(--border-strong); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }
.menu-btn {
  display: none;
}
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-open { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 767px) {
  .menu-btn { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { display: flex; min-height: 48px; padding: 0 4px; font-size: 1.0625rem; border-radius: 0; border-bottom: 1px solid var(--border); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav .lang-link { margin: 8px 0 0; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; justify-content: center; }
}

/* Simple header (legal pages): single link, always visible, no menu button */
.site-nav.site-nav--simple { display: block !important; position: static; padding: 0; border: 0; background: none; }
.site-nav--simple ul { flex-direction: row; }
.site-nav--simple a, .site-nav--simple li:last-child a { border: 0; min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: 0.9375rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font: inherit; font-size: 1rem; font-weight: 700; text-decoration: none;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--btn); color: var(--on-btn); }
.btn-primary:hover { background: var(--btn-hover); color: var(--on-btn); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--subtle); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 40rem; margin-bottom: 40px; }
.section-head p { margin-top: 12px; }

/* Hero */
.hero { padding-block: clamp(48px, 9vw, 112px) clamp(48px, 7vw, 80px); }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 24px; max-width: 38rem; font-size: 1.1875rem; color: var(--ink-2); }
.hero .btn-row { margin-top: 32px; }
.facts { margin: 56px 0 0; padding: 24px 0 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 32px; }
.facts dt { font-size: 0.875rem; color: var(--muted); font-weight: 500; }
.facts dd { margin: 2px 0 0; color: var(--ink); font-weight: 700; font-size: 1.0625rem; }

/* Lernaido */
.product { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .product { grid-template-columns: 1.05fr 1fr; gap: 72px; } }
.product p.sub { margin-top: 16px; font-size: 1.125rem; }
.checks { list-style: none; margin: 28px 0 32px; padding: 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; color: var(--ink); }
.checks svg { width: 22px; height: 22px; margin-top: 2px; color: var(--ok); }
.store-links { margin-top: 20px; font-size: 0.9375rem; color: var(--muted); }
.store-links a { font-weight: 600; }
.shots { margin: 0; }
.shots-row { display: flex; gap: 16px; justify-content: center; align-items: flex-start; }
.shots-row img { width: calc(50% - 8px); max-width: 260px; height: auto; }
.shots-row img + img { margin-top: 40px; }
.shots figcaption { margin-top: 20px; font-size: 0.9375rem; color: var(--muted); text-align: center; max-width: 30rem; margin-inline: auto; }

/* Services */
.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
@media (min-width: 768px) { .services { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.services li { border-top: 2px solid var(--ink); padding-top: 20px; }
.services p { margin-top: 8px; }
.services-note { margin-top: 40px; }

/* Team */
.about { max-width: 40rem; }
.team { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.team img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%; border-radius: var(--radius-lg); background: var(--subtle); }
.team h3 { margin-top: 16px; }
.team p { color: var(--muted); font-size: 0.9375rem; font-weight: 500; }

/* Contact */
.contact { display: grid; gap: 40px; }
@media (min-width: 768px) { .contact { grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: start; } }
.contact .btn-row { margin-top: 24px; }
.contact address { font-style: normal; display: grid; gap: 20px; }
.contact address div { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.contact address svg { width: 20px; height: 20px; margin-top: 4px; color: var(--muted); }
.contact .reg { font-size: 0.9375rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 32px; font-size: 0.9375rem; color: var(--ink-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Legal pages (Privacy, Impressum) ---------- */
.legal { padding-block: clamp(40px, 7vw, 80px); }
.legal .container { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); }
.legal .intro { margin-top: 16px; font-size: 1.125rem; }
.legal .updated { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; }
.legal .toc { margin: 32px 0 8px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.legal .toc h2 { font-size: 1rem; }
.legal .toc ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.legal .toc a { display: inline-block; padding: 2px 0; }
.legal section { margin-top: 48px; }
.legal section > h2 { font-size: 1.5rem; margin-bottom: 16px; }
.legal h3 { font-size: 1.0625rem; margin: 24px 0 8px; display: flex; align-items: baseline; gap: 10px; }
.legal h3 .tag { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75rem; height: 1.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; background: var(--surface); }
.legal p + p, .legal p + ul, .legal ul + p, .legal p + div, .legal div + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0; padding-left: 1.25rem; display: grid; gap: 8px; }
.legal strong { color: var(--ink); }
.legal .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.legal .addr { margin-top: 12px; padding-left: 16px; border-left: 3px solid var(--border); }
.legal .addr p + p { margin-top: 2px; }
.legal .note { margin-top: 12px; padding: 16px; background: var(--subtle); border-radius: 10px; }
.legal .divided { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.legal .imprint p + p { margin-top: 16px; }
