/* ==========================================================================
   Trackstar – trackstar.pro
   Look: „Instrument, nicht Dekoration“ – fast-schwarzer Grund, ein Akzent als
   Licht, übergroße Zahlen, Haarlinien statt Rahmen, Bewegung nur mit Zweck.
   Tokens 1:1 aus video/src/tokens.ts (TK der TrackstarSensor-App).
   ========================================================================== */

/* ---------- Fonts (selbst gehostet, keine externen Requests) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/nunito-latin-900-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #0B0B0F;
  --surface: #16171C;
  --raised: #202127;
  --border: #2A2B31;
  --border-strong: #6B6C73;
  --text: #FFFFFF;
  --muted: #8E8E93;
  --faint: #5C5C63;
  --brand: #00E673;
  --brand-pressed: #00C462;
  --brand-subtle: #0D2E1A;
  --on-brand: #0B0B0F;
  --info: #7CC4FF;
  --warning: #FFC861;
  --danger: #FF7A70;
  --gold: #F5A623;
  --brand-rgb: 0, 230, 115;

  --font-text: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-display: "Nunito", "SF Pro Rounded", -apple-system, system-ui, sans-serif;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --gutter: 20px;
  --max: 1120px;
  --header-h: 64px;

  --glow: 0 0 6px rgba(var(--brand-rgb), .6), 0 0 28px rgba(var(--brand-rgb), .35);
  --float: 0 16px 40px -12px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: .15em; }
a:hover { color: #5CF0A3; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
em { font-style: normal; color: var(--text); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.accent { color: var(--brand); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--brand); color: var(--on-brand); }

.sr-only { position: absolute !important; 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: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--brand); color: var(--on-brand); font-weight: 600; border-radius: var(--r-pill); text-decoration: none; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 760px; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, border-color .18s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: #33EB8C; color: var(--on-brand); box-shadow: var(--glow); }
.btn-primary:active { background: var(--brand-pressed); transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); background: rgba(255, 255, 255, .04); }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.0625rem; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; box-shadow: none; }

/* ---------- Header (Glas nur hier – Navigationsebene) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 15, .72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 26px; fill: var(--brand); flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -8px;
  background: transparent; border: 0; color: var(--text); cursor: pointer; border-radius: var(--r-sm);
}
.nav-toggle-bars { display: flex; flex-direction: column; gap: 6px; width: 22px; }
.nav-toggle-bars span { height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child { transform: translateY(-4px) rotate(-45deg); }

.site-menu { display: none; }
.site-menu.is-open { display: block; }
.site-menu ul { display: flex; flex-direction: column; gap: 4px; padding: 8px 0 16px; }
.site-menu a:not(.btn) {
  display: block; padding: 12px 8px; color: var(--text); text-decoration: none; font-weight: 500; border-radius: var(--r-sm);
}
.site-menu a:not(.btn):hover { background: rgba(255, 255, 255, .05); }
.site-menu .menu-cta { padding-top: 8px; }

@media (max-width: 839px) {
  .nav { flex-wrap: wrap; }
  .site-menu { flex-basis: 100%; border-top: 1px solid var(--border); }
}
@media (min-width: 840px) {
  .nav-toggle { display: none; }
  .site-menu { display: block; }
  .site-menu ul { flex-direction: row; align-items: center; gap: 4px; padding: 0; }
  .site-menu a:not(.btn) { padding: 8px 14px; color: var(--muted); font-size: .9375rem; }
  .site-menu a:not(.btn):hover { color: var(--text); background: transparent; }
  .site-menu .menu-cta { padding: 0 0 0 10px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 24px; overflow: hidden; }
.ambient {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 0%, rgba(var(--brand-rgb), .14), transparent 70%);
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--brand-subtle); color: var(--brand);
  font-size: .8125rem; font-weight: 600; letter-spacing: .04em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.dot-live { box-shadow: 0 0 10px rgba(var(--brand-rgb), .9); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.display {
  margin-top: 22px;
  font-size: clamp(2.75rem, 2rem + 6vw, 6rem);
  font-weight: 900; letter-spacing: -.035em; line-height: 1;
}
.lead { max-width: 680px; margin-top: 20px; color: var(--muted); font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); line-height: 1.5; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.cta-row .btn { flex: 1 1 auto; }
@media (min-width: 480px) { .cta-row .btn { flex: 0 0 auto; } }

.video-card { width: 100%; max-width: 960px; margin: clamp(40px, 6vw, 64px) 0 0; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--float), 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, .06) inset;
}
@media (min-width: 720px) { .video-frame { border-radius: var(--r-xl); } }
.video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.video-play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to top, rgba(11, 11, 15, .55), rgba(11, 11, 15, 0) 60%);
  border: 0; cursor: pointer; color: var(--on-brand);
}
.video-play .icon {
  width: 76px; height: 76px; padding: 20px; padding-left: 24px;
  border-radius: 50%; background: var(--brand); fill: currentColor; stroke: none;
  box-shadow: var(--glow);
  transition: transform .18s var(--ease);
}
.video-play:hover .icon { transform: scale(1.06); }
.video-play:focus-visible { outline-offset: -4px; }
.video-card.is-playing .video-play { display: none; }
.video-card figcaption { margin-top: 14px; color: var(--muted); font-size: .9375rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-label {
  margin-bottom: 14px; color: var(--brand);
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.section-text { max-width: 640px; margin-top: 16px; color: var(--muted); font-size: 1.0625rem; text-wrap: pretty; }

.card {
  position: relative; padding: 24px; border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}
.card::before { /* Haarlinie oben – gefräste Kante statt Rahmen */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ---------- Problem / Stats ---------- */
.stats { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 40px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.stat {
  padding: 24px; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
  display: flex; flex-direction: column; gap: 10px;
}
.stat-value { display: flex; align-items: baseline; gap: 4px; font-family: var(--font-display); font-weight: 900; letter-spacing: -.04em; line-height: .9; font-size: clamp(3.25rem, 2.5rem + 3.5vw, 5rem); }
.stat-unit { font-size: .45em; color: var(--muted); font-weight: 800; letter-spacing: -.02em; }
.stat-zero { color: var(--faint); }
.stat-label { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.stats-note { margin-top: 14px; color: var(--muted); font-size: .8125rem; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 40px; counter-reset: step; }
@media (min-width: 880px) { .steps { grid-template-columns: 1fr 1.35fr 1fr; align-items: start; } }
.step { display: flex; flex-direction: column; gap: 10px; }
.step-num { font-family: var(--font-display); font-weight: 900; font-size: .875rem; letter-spacing: .08em; color: var(--brand); }
.step p { color: var(--muted); }
.how-note { margin-top: 24px; padding: 16px 20px; border-radius: var(--r-md); background: var(--brand-subtle); color: var(--text); font-size: .9375rem; }
.how-note strong { color: var(--brand); }

/* Warum zwei Sensoren */
.why .why-lead { max-width: 760px; margin-top: 12px; }
.why .video-card-why { margin: clamp(28px, 4vw, 44px) auto 0; }

.live { margin-top: 14px; padding: 16px; border-radius: var(--r-md); background: var(--bg); box-shadow: 0 0 0 1px var(--border); }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-title { font-size: .875rem; font-weight: 600; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: var(--brand); text-transform: uppercase; }
.wave { width: 100%; height: auto; aspect-ratio: 560 / 120; margin-top: 10px; }
.live-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.live-ex { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live-ex::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.live-reps { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); font-weight: 900; font-size: 2.75rem; line-height: 1; letter-spacing: -.04em; color: var(--brand); }
.live-reps .num { display: inline-block; transition: transform .18s var(--ease); }
.live-reps .num.is-pulsing { transform: scale(1.06); text-shadow: 0 0 24px rgba(var(--brand-rgb), .6); }
.live-reps-label { font-family: var(--font-text); font-size: .75rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.live-src { margin-top: 10px; color: var(--muted); font-size: .75rem; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
@media (min-width: 560px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { display: flex; flex-direction: column; gap: 12px; }
.feature-icon {
  width: 44px; height: 44px; padding: 10px; border-radius: var(--r-sm);
  background: var(--brand-subtle); color: var(--brand);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.feature p { color: var(--muted); font-size: .9375rem; }

/* ---------- Beta ---------- */
.beta { position: relative; }
.beta-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) { .beta-grid { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; } }
.checklist { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.checklist .icon { color: var(--brand); margin-top: .1em; }
.checklist strong { color: var(--text); }

.beta-card { padding: 28px 24px; }
@media (min-width: 560px) { .beta-card { padding: 36px; } }
.beta-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 600; font-size: .9375rem; }
.hint { color: var(--muted); font-size: .8125rem; }
input[type="email"], input[type="text"] {
  width: 100%; min-height: 52px; padding: 12px 16px;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font: inherit; font-size: 1.0625rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }
input[type="email"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .25); }
input[type="email"][aria-invalid="true"] { border-color: var(--danger); }

.field-check { flex-direction: row; align-items: flex-start; gap: 12px; }
.field-check input[type="checkbox"] {
  flex: none; width: 22px; height: 22px; margin: 2px 0 0;
  accent-color: var(--brand); cursor: pointer;
}
.field-check label { font-weight: 400; font-size: .9375rem; color: var(--muted); cursor: pointer; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-status { min-height: 1.4em; font-size: .9375rem; color: var(--muted); }
.form-status.is-error { color: var(--danger); }
.form-status:empty { display: none; }
.fineprint { color: var(--muted); font-size: .8125rem; }

.beta-success { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.beta-success[hidden] { display: none; }
.success-icon { width: 56px; height: 56px; padding: 12px; border-radius: 50%; background: var(--brand); color: var(--on-brand); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; box-shadow: var(--glow); }
.beta-success h3 { font-size: 1.75rem; }
.beta-success p { color: var(--muted); }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
@media (min-width: 640px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.person { display: flex; flex-direction: column; gap: 6px; }
.person-role { color: var(--brand); font-size: .875rem; font-weight: 600; letter-spacing: .02em; }
.person p:not(.person-role) { margin-top: 6px; color: var(--muted); font-size: .9375rem; }
.team-note { margin-top: 20px; color: var(--muted); font-size: .9375rem; }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 32px; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 4px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; letter-spacing: -.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s var(--ease);
  margin-right: 6px;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover { color: var(--brand); }
.faq-body { padding: 0 4px 20px; color: var(--muted); max-width: 64ch; }
.faq-cta { margin-top: 40px; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; }
.footer-inner { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 720px) { .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-tag { margin-top: 2px; color: var(--muted); font-size: .875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .9375rem; padding: 8px 0; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: .875rem; }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(40px, 6vw, 72px) 0 80px; }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.375rem; margin-top: 40px; }
.legal h3 { font-size: 1.0625rem; margin-top: 24px; }
.legal p, .legal li { color: var(--muted); margin-top: 12px; max-width: 70ch; }
.legal ul { list-style: disc; padding-left: 1.25em; }
.legal .todo { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #33270F; color: var(--warning); font-weight: 600; }
.legal .updated { color: var(--muted); font-size: .875rem; }
.legal address { font-style: normal; }

/* ---------- Reveal (dezent, nur mit Zweck: Inhalte kommen an) ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Bedienungshilfen ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (prefers-contrast: more) {
  .card, .stat, .live { box-shadow: 0 0 0 1px var(--border-strong); }
  .btn-primary:hover { box-shadow: none; }
  .video-play .icon { box-shadow: none; }
  .lead, .section-text, .step p, .feature p, .stat-label, .faq-body { color: #C7C7CC; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .site-header, .video-card, .nav-toggle, .faq-cta, .cta-row { display: none !important; }
  body { background: #fff; color: #000; }
}
