/* ══════════════════════════════════════════════════════════════
   EPAGOGY — Shared Design System
   Single source of truth for tokens, nav, footer, and utilities.
   Each page imports this, then adds page-specific styles.
   ══════════════════════════════════════════════════════════════ */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 1000; }
.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; padding: 8px 16px; background: var(--accent); color: var(--on-accent, #000); font-weight: 600; font-size: .875rem; border-radius: var(--radius-s); text-decoration: none; z-index: 10000; }

/* ── PETROL ACCENT — single source of truth ──────────────── */
/* ── BASE TOKENS ──────────────────────────────────────────── */
:root, [data-mode="light"] {
  --accent: #4d7e7e; --accent-muted: rgba(77,126,126,.15); --on-accent: #F8F8F6;
  --link: var(--accent); --highlight: var(--accent); --interactive: var(--accent);
  --bg: #F8F8F6; --surface: #FFFFFF; --border: #D8D8D2;
  --text: #1A1A18; --text-2: #44443E; --muted: #6A6A64; --muted-light: #9B9B94;
  --code-bg: #F0F0EE;
  --radius-s: 4px; --radius-m: 8px; --transition: .2s ease-out;
}
[data-mode="dark"] {
  --accent: #6a9e9e; --accent-muted: rgba(106,158,158,.15); --on-accent: #0C0C0A;
  --bg: #0C0C0A; --surface: #141412; --border: #2A2A26;
  --text: #E8E8E4; --text-2: #C8C8C0; --muted: #8A8A82; --muted-light: #8A8A7E;
  --code-bg: #1E1E1C;
}

/* ── TYPOGRAPHY (experiment: 17px, system-ui, major third) ── */
html { font-size: 17px; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400; line-height: 1.45;
  background: var(--bg); color: var(--text);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
p { line-height: 1.45; }
code, pre { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace; font-size: 0.875em; }

/* ── LAYOUT ────────────────────────────────────────────────── */
.container       { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-wide  { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ── SECTIONS ──────────────────────────────────────────────── */
.section { padding: 72px 0; border-bottom: 1px solid var(--border); background: var(--bg); }
.section.alt { background: var(--surface); }
.s-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.s-heading { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; line-height: 1.08; }
.s-body { font-size: 1rem; color: var(--muted); max-width: 580px; line-height: 1.72; }
.s-body + .s-body { margin-top: 12px; }
.center { text-align: center; }

/* ── NAV ───────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); background: var(--bg); }
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; transition: height .2s ease; }
.nav-brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.nav-logo-wrap { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.nav-logo-wrap svg { width: 26px; height: 26px; }
.nav-wordmark { font-size: 0.975rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 2px; justify-self: center; }
.nav-link { font-size: 0.875rem; color: var(--muted); padding: 6px 10px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.nav-link:hover { color: var(--text); background: var(--border); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 600; }
.nav-controls { display: flex; align-items: center; gap: 6px; justify-self: end; }

/* ── MODE BUTTON ───────────────────────────────────────────── */
.mode-btn {
  width: 36px; height: 36px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.mode-btn:hover { color: var(--text); border-color: var(--accent); }


/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-m);
  font-weight: 600; font-size: .9375rem; cursor: pointer;
  border: none; transition: all var(--transition);
  min-height: 44px; text-decoration: none;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }
.btn:hover { text-decoration: none; }
.btn--primary {
  background: var(--accent); color: var(--on-accent, #0C0C0A);
}
.btn--primary:hover {
  box-shadow: 0 0 24px var(--accent-muted), 0 4px 12px rgba(0,0,0,.2);
  filter: brightness(1.08);
}
.btn--ghost {
  background: none; border: 1px solid var(--border); color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── BREADCRUMB ────────────────────────────────────────────── */
.breadcrumb { padding: 1rem 0 0; font-size: .8rem; }
.breadcrumb ol { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.breadcrumb li+li::before { content: "›"; margin-right: .4rem; color: var(--muted); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text); }

/* ── FOOTER ────────────────────────────────────────────────── */
.footer { padding: 64px 0 40px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-top { display: flex; justify-content: space-between; gap: 48px; margin-bottom: 48px; }
.footer-brand-col { max-width: 280px; flex-shrink: 0; }
.footer-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 16px; }
.footer-logo:hover { text-decoration: none; }
.footer-logo svg { width: 28px; height: 28px; color: var(--text); }
.footer-logo-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.footer-tagline { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social-link {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; color: var(--muted);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.footer-social-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
@media (hover: hover) { .footer-social-link:hover { transform: translateY(-2px); } }
.footer-nav-col { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-nav-group { display: flex; flex-direction: column; gap: 8px; min-width: 120px; }
.footer-nav-heading { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); margin-bottom: 4px; }
.footer-nav-link { font-size: 0.82rem; color: var(--muted); transition: color 0.15s; text-decoration: none; }
.footer-nav-link:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.footer-copy { font-size: 0.75rem; color: var(--muted-light); }
.footer-codesign { font-size: 0.75rem; color: var(--muted-light); opacity: .6; }

/* ── LEGAL (shared between impressum + datenschutz) ────────── */
.page-hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); background: var(--bg); }
.page-hero-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.page-hero-headline { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 12px; }
.page-hero-sub { font-size: 1rem; color: var(--muted); max-width: 560px; line-height: 1.65; }
.legal-section { padding: 64px 0; border-bottom: 1px solid var(--border); }
.legal-section:last-of-type { border-bottom: none; }
.legal-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.legal-heading { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px; }
.legal-body { font-size: 0.95rem; color: var(--text-2); line-height: 1.8; }
.legal-body p { margin-bottom: 14px; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body ul { padding-left: 20px; margin-bottom: 14px; }
.legal-body ul li { margin-bottom: 6px; }
.legal-address { font-style: normal; line-height: 1.85; color: var(--text-2); font-size: 0.95rem; }
.legal-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; font-size: 0.95rem; }
.legal-dl dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.legal-dl dd { color: var(--text-2); }
.notice-box { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 4px; padding: 18px 20px; margin-bottom: 14px; font-size: 0.95rem; color: var(--text-2); line-height: 1.75; }
.notice-box strong { color: var(--text); }
.divider { height: 1px; background: var(--border); margin: 0; border: none; }

/* ── SMOOTH THEME TRANSITIONS ──────────────────────────────── */
html.transitioning,
html.transitioning *,
html.transitioning *::before,
html.transitioning *::after{
  transition:background .35s ease,color .35s ease,border-color .35s ease,
             box-shadow .35s ease,fill .35s ease,stroke .35s ease!important;
}

/* ── REVEAL (scroll animation) ─────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ── TABS ──────────────────────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn { font-size: 0.875rem; font-weight: 600; padding: 10px 20px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px; transition: color 0.15s, border-color 0.15s; font-family: inherit; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── MOBILE NAV ────────────────────────────────────────────── */
.nav-burger {
  display: none; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nav-burger:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 600px) {
  .nav-inner { display: flex; justify-content: space-between; position: relative; }
  .nav-burger { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px; z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 0; }
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .footer-top { flex-direction: column; gap: 32px; }
  .footer-brand-col { max-width: 100%; }
  .footer-nav-col { gap: 32px; }
}
@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── CODE WINDOWS (shared across all pages) ────────────── */
.cw-wrap { position: relative; }
.cw { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-align: left; position: relative; }
.cw-bar { padding: 8px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #ff5f56; } .dot-y { background: #ffbd2e; } .dot-g { background: #27c93f; }
.cw-label { font-size: 0.7rem; color: var(--muted-light); margin-left: 4px; font-family: 'SF Mono', 'Fira Code', monospace; text-transform: lowercase; }
.cw pre { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 0.8rem; line-height: 1.75; padding: 16px 20px; color: var(--text); overflow-x: auto; margin: 0; white-space: pre; }
.cw pre code { background: none; padding: 0; font-size: 0.78rem; line-height: 1.65; font-family: inherit; }
.cw--out { padding: 0.875rem 1.25rem; }
.cw--out pre code { font-size: 0.72rem; line-height: 1.7; }
.cw--ml { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cw .copy-btn { position: absolute; top: 4px; right: 4px; font-size: 0.7rem; padding: 8px 12px; min-height: 44px; min-width: 44px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit; transition: color 0.15s, border-color 0.15s; z-index: 10; }
.cw .copy-btn:hover { color: var(--text); border-color: var(--muted); }
/* Syntax highlight tokens */
.hl-kw { color: var(--accent); font-weight: 600; }
.hl-fn { color: var(--accent); }
.hl-str { color: var(--muted); }
.hl-cmt { color: var(--muted-light); font-style: italic; }
.hl-num { color: var(--accent); }

/* ── SCROLL PROGRESS BAR (all pages) ─────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); width: 0%;
  z-index: 1000; pointer-events: none;
  transition: none; opacity: .6;
}

/* ── NAV SCROLL STATE (all pages) ────────────────────────── */
.nav.scrolled .nav-inner { height: 48px; }
.nav.scrolled {
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

/* ── SCROLL POSITION DOTS (all pages) ────────────────────── */
.scroll-dots {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 12px;
}
.scroll-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  transition: background .3s ease, transform .3s ease;
  cursor: pointer; border: none; padding: 0;
}
.scroll-dot:hover { background: var(--muted); }
.scroll-dot--active { background: var(--accent); transform: scale(1.4); }
@media (max-width: 900px) { .scroll-dots { display: none; } }

/* ── FILM GRAIN (dark mode, all pages) ───────────────────── */
[data-mode="dark"] main::before {
  content: ''; position: fixed; inset: 0; z-index: 99;
  pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}
