/* ============================================================
   Tom Frerich Base Design System — /css/base.css
   Single source of truth for tokens, reset, nav, footer, buttons.
   All active pages must link this file (except sacred product pages).
   ============================================================ */

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

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --subtle: #F4F4F2;
  --text: #18181B;
  --text2: #52525B;
  --muted: #52525B;
  --accent: #2D2D32;
  --accent-h: #000;
  --accent-l: #F0F0EE;
  --border: #E4E4E7;
  --border-s: #D4D4D8;

  /* Semantic */
  --green: #166534;
  --green-l: #DCFCE7;
  --blue: #2563EB;
  --blue-l: #DBEAFE;
  --warm: #F59E0B;
  --warm-l: #FEF3C7;
  --purple: #7C3AED;
  --purple-l: #EDE9FE;
  --orange: #EA580C;
  --orange-l: #FFF7ED;
  --red: #DC2626;

  /* Radius */
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 100px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 200ms; }
a:hover { color: var(--accent-h); }
::selection { background: var(--accent-l); color: var(--accent); }

/* --- Focus States (A11y) --- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Reduced Motion (A11y) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Language Toggle --- */
[data-lang="en"] { display: none !important; }
body.en [data-lang="de"] { display: none !important; }
body.en [data-lang="en"] { display: revert !important; }

/* --- Navigation --- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250, 250, 248, 0.8);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
}

.nav-in {
  max-width: 1080px; margin: 0 auto; padding: 0 32px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}

.nav-logo { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }

.nav-r { display: flex; align-items: center; gap: 4px; }
.nav-r > a, .nav-dd-trigger {
  font-size: 12px; font-weight: 600; color: var(--text2); padding: 10px 14px;
  border-radius: 8px; transition: all 150ms; text-decoration: none; cursor: pointer;
  background: none; border: none; font-family: inherit;
}
.nav-r > a:hover, .nav-dd-trigger:hover { color: var(--text); background: rgba(0,0,0,0.04); }

.lang-sw {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; margin-left: 8px;
  transition: all 150ms;
}
.lang-sw:hover { border-color: var(--text); color: var(--text); }

/* Dropdown */
.nav-dd { position: relative; }
.nav-dd-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 6px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 110;
}
.nav-dd.open .nav-dd-menu { display: block; animation: ddFade 200ms var(--ease); }
@keyframes ddFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.nav-dd-menu a {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  font-size: 13px; font-weight: 500; color: var(--text2); text-decoration: none;
  border-radius: 8px; transition: all 150ms;
}
.nav-dd-menu a:hover { background: rgba(0,0,0,0.03); color: var(--text); }
.nav-dd-menu a .dd-lock { font-size: 10px; margin-left: auto; opacity: 0.4; }
.nav-dd-menu .dd-sep { height: 1px; background: var(--border); margin: 4px 8px; }

.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--text); font-size: 20px; }
.nav-mobile {
  display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 99; padding: 24px; flex-direction: column; gap: 0; overflow-y: auto;
}
.nav-mobile.open { display: flex; }
.nav-mobile a { font-size: 18px; font-weight: 600; color: var(--text); padding: 14px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.nav-mobile .nm-group-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 20px 0 8px; border-bottom: none; }
.nav-mobile .nm-sub { padding-left: 16px; font-size: 16px; font-weight: 500; }
.nav-mobile .nm-lock { font-size: 12px; opacity: 0.4; margin-left: 8px; }

/* --- Layout --- */
.w { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.w-narrow { max-width: 680px; margin: 0 auto; padding: 0 32px; }
section { padding: 80px 0; }
.spacer { height: 1px; background: var(--border); max-width: 1080px; margin: 0 auto; }

/* --- Reveal Animation --- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.v { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* --- Typography --- */
.label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 12px; }
h2 .soft { color: var(--text2); font-weight: 400; }
.intro { color: var(--text2); font-size: 17px; line-height: 1.7; margin-bottom: 32px; max-width: 540px; }

/* --- Buttons --- */
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 14px 28px; border-radius: var(--radius-md); font-weight: 600;
  font-size: 15px; transition: all 300ms var(--ease); display: inline-flex;
  align-items: center; gap: 8px; font-family: var(--font); cursor: pointer; border: none;
}
.btn-a { background: var(--accent); color: white; box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.1); }
.btn-a:hover { background: var(--accent-h); color: white; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 8px 32px rgba(0,0,0,0.1); }
.btn-o { background: transparent; border: 1.5px solid var(--border-s); color: var(--text2); }
.btn-o:hover { border-color: var(--text); color: var(--text); transform: translateY(-2px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Footer --- */
footer { padding: 48px 0 40px; }
.footer-in {
  max-width: 1080px; margin: 0 auto; padding: 0 32px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-brand { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 200ms; }
.footer-links a:hover { color: var(--text); }

/* --- Responsive: Mobile --- */
@media (max-width: 640px) {
  .nav-r > a, .nav-dd { display: none; }
  .nav-r .lang-sw { display: inline-block; }
  .nav-burger { display: block; }
  .w, .w-narrow { padding: 0 20px; }
  section { padding: 56px 0; }
  .btns { flex-direction: column; }
  .btn { justify-content: center; text-align: center; }
}
