/* ==========================================================================
   CalTrack marketing + legal site
   Direction: technical / instrument — the site reads like the app it fronts.
   Off-black canvas, one teal accent, macro colours used only to encode values,
   monospace tabular figures, hairline rules instead of shadows. The signature
   is the app's calorie ring, rebuilt in HTML.
   ========================================================================== */

:root {
  /* Canvas — off-black, tinted like the app, never pure #000 */
  --bg: #0c1013;
  --bg-2: #0f151a;          /* alternating bands */
  --panel: #11181e;         /* instrument panel, insets */
  --panel-2: #161f26;       /* ring track, bar troughs */

  /* Rules carry the structure */
  --border: #212c33;
  --border-strong: #2d3a43;

  /* Brand — from the app icon and in-app dial */
  --teal: #7ad0bd;          /* the single accent: ring, links, markers */
  --teal-strong: #5cc0aa;
  --blue-deep: #196585;

  /* Macro data triad + fibre, matching the app exactly. Data-only. */
  --protein: #f3a980;
  --fat: #a9c877;
  --carbs: #9fb6ea;
  --fiber: #6fcbb6;

  /* Text — off-white, never pure #fff */
  --text: #e7edf1;
  --muted: #93a4b0;
  --dim: #667885;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo,
    Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;

  /* Modular-ish spacing, tied to the type rather than round tens */
  --s1: 0.375rem;
  --s2: 0.625rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2.25rem;
  --s6: 3.5rem;
  --s7: 5.5rem;
  --s8: 8rem;

  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* One restrained brand glow at the top — the app's icon colour, kept quiet */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(820px 460px at 82% -10%, rgba(122, 208, 189, 0.10), transparent 60%),
    radial-gradient(680px 460px at 6% -4%, rgba(25, 101, 133, 0.16), transparent 58%);
}

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-strong); text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; height: auto; }
strong { color: var(--text); font-weight: 650; }

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin: 0 0 var(--s3);
  color: var(--text);
}
h1 { font-size: clamp(2.15rem, 1.3rem + 3.8vw, 3.4rem); line-height: 1.07; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.1rem); }
h3 { font-size: 1.08rem; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s3); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
.muted { color: var(--muted); }

/* Recurring device: a mono micro-label with a leading rule */
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}
.kicker::before { content: ""; width: 1.75rem; height: 1px; background: var(--border-strong); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(130%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: var(--s4); height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-weight: 600; font-size: 1.02rem;
  letter-spacing: -0.01em; color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links { display: flex; gap: var(--s4); margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.lang-switch {
  display: inline-flex; border: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600; overflow: hidden;
}
.lang-switch a { padding: 5px 10px; color: var(--dim); }
.lang-switch a + a { border-left: 1px solid var(--border-strong); }
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--text); color: var(--bg); }

.nav-toggle { display: none; }

/* ---------- Actions ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 11px 20px; font-family: var(--mono); font-weight: 600;
  font-size: 0.9rem; letter-spacing: 0.01em;
  border: 1px solid var(--teal); background: var(--teal); color: #06231d;
  cursor: pointer; transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary:hover { background: var(--teal-strong); border-color: var(--teal-strong); color: #06231d; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.text-link {
  font-family: var(--mono); font-size: 0.9rem; font-weight: 600; color: var(--teal);
  display: inline-flex; align-items: center; gap: 0.4em;
}
.text-link:hover { color: var(--teal-strong); text-decoration: none; }
.text-link .arrow { transition: transform 0.15s ease; }
.text-link:hover .arrow { transform: translateX(3px); }

/* Coming-soon store badge — honest mono tag, deliberately not a live button */
.play-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 9px 15px; border: 1px solid var(--border-strong); background: var(--panel);
  font-family: var(--mono); color: var(--text);
}
.play-badge svg { width: 15px; height: 15px; fill: var(--text); flex: none; }
.play-badge .pb-text { display: flex; flex-direction: column; line-height: 1.2; }
.play-badge .pb-small { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.play-badge .pb-big { font-size: 0.86rem; font-weight: 600; }
.play-badge .pb-tag {
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal); border: 1px solid var(--teal); padding: 2px 6px;
}

/* ==========================================================================
   Hero — thesis on the left, the app's "Today" instrument on the right
   ========================================================================== */
.hero { padding: var(--s7) 0 var(--s6); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--s6); align-items: center; }
.hero h1 { margin-bottom: var(--s4); text-wrap: balance; }
.hero h1 .accent { color: var(--teal); }
.hero .lead { font-size: 1.2rem; color: var(--text); max-width: 34ch; margin: 0 0 var(--s3); }
.hero .desc { color: var(--muted); max-width: 44ch; margin: 0 0 var(--s5); }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border-strong); padding: 5px 10px; margin-bottom: var(--s4);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.hero-note {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.82rem; color: var(--dim); letter-spacing: 0.02em;
}

/* ---- The instrument: calorie ring + macro readout (the signature) ---- */
.instrument { font-family: var(--mono); background: var(--panel); border: 1px solid var(--border-strong); }
.inst-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--s3) var(--s4); border-bottom: 2px solid var(--text);
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.inst-body { display: grid; grid-template-columns: auto 1fr; gap: var(--s5); padding: var(--s5) var(--s4); align-items: center; }

.ring { position: relative; width: 140px; height: 140px; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { fill: none; stroke: var(--panel-2); stroke-width: 9; }
.ring .fill {
  fill: none; stroke: var(--teal); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 415; stroke-dashoffset: 83;
  animation: ring-draw 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes ring-draw { from { stroke-dashoffset: 415; } }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .big { font-size: 2rem; font-weight: 600; line-height: 1; }
.ring .sub { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.readout { display: flex; flex-direction: column; gap: var(--s3); }
.macro { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s2); align-items: baseline; }
.macro .m-label { color: var(--muted); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.55em; }
.macro .m-dot { width: 8px; height: 8px; flex: none; }
.macro .m-val { color: var(--text); font-size: 0.82rem; }
.macro .m-bar { grid-column: 1 / 3; height: 4px; background: var(--panel-2); overflow: hidden; margin-top: 3px; }
.macro .m-bar i { display: block; height: 100%; transform-origin: left center; animation: bar-grow 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.2s; }
@keyframes bar-grow { from { transform: scaleX(0); } }
.dot-p { background: var(--protein); } .dot-c { background: var(--carbs); }
.dot-f { background: var(--fat); } .dot-fi { background: var(--fiber); }
/* macro fill widths + colours (no inline styles — CSP-safe) */
.fill-p { width: 71%; background: var(--protein); }
.fill-c { width: 85%; background: var(--carbs); }
.fill-f { width: 67%; background: var(--fat); }
.fill-fi { width: 50%; background: var(--fiber); }

.inst-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--s3) var(--s4); border-top: 1px solid var(--border-strong);
  background: var(--panel-2); font-size: 0.82rem; color: var(--muted);
}
.inst-foot b { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: var(--s7) 0; }
.section-head { max-width: 48rem; margin: 0 0 var(--s6); }
.section-head h2 { text-wrap: balance; }
.section-head p { color: var(--muted); font-size: 1.08rem; max-width: 54ch; margin-bottom: 0; }

/* ---- Benefits as a hairline spec grid ---- */
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.spec-row { background: var(--bg); display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: var(--s5) var(--s4); }
.spec-idx { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--teal); padding-top: 0.15rem; }
.spec-row h3 { margin-bottom: 0.35rem; }
.spec-row p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.spec-meta { margin-top: var(--s4); font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em; color: var(--dim); }
.spec-meta span { color: var(--muted); }

/* ---- Screens: overlapping phones ---- */
.band { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.phones { display: flex; justify-content: center; align-items: center; perspective: 1500px; padding: var(--s3) 0 var(--s4); }
.phone {
  width: 30%; max-width: 250px; border: 8px solid #0a0f13; outline: 1px solid var(--border-strong);
  border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}
.phone:nth-child(1) { transform: rotate(-5deg) translateY(14px); z-index: 1; }
.phone:nth-child(2) { transform: translateY(-16px) scale(1.07); z-index: 3; margin: 0 calc(var(--s3) * -1); }
.phone:nth-child(3) { transform: rotate(5deg) translateY(14px); z-index: 1; }
.phone-legend {
  display: flex; justify-content: center; gap: var(--s5); margin-top: var(--s5);
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
}
.phone-legend span { display: inline-flex; gap: 0.5em; }
.phone-legend .pl-idx { color: var(--teal); }

/* ---- Privacy as a data-flow statement ---- */
.dataflow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: start; }
.dataflow-lead h2 { margin-bottom: var(--s3); }
.dataflow-lead p { color: var(--muted); margin-bottom: 0; }
.flow { font-family: var(--mono); border: 1px solid var(--border-strong); background: var(--panel); }
.flow-group + .flow-group { border-top: 1px solid var(--border-strong); }
.flow-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--s3) var(--s4); background: var(--panel-2);
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.flow-head .flow-count { color: var(--teal); }
.flow-item { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: var(--s3) var(--s4); font-size: 0.9rem; }
.flow-item + .flow-item { border-top: 1px solid var(--border); }
.flow-mark { color: var(--dim); }
.flow-item.leaves .flow-mark { color: var(--teal); }
.flow-item strong { display: block; margin-bottom: 0.12rem; }
.flow-item span { color: var(--muted); font-family: var(--sans); font-size: 0.9rem; }

.facts { display: flex; flex-wrap: wrap; margin: var(--s6) 0 0; padding: 0; border: 1px solid var(--border); font-family: var(--mono); list-style: none; }
.facts li { padding: var(--s3) var(--s4); font-size: 0.82rem; color: var(--muted); flex: 1 1 auto; text-align: center; border-right: 1px solid var(--border); }
.facts li:last-child { border-right: 0; }
.facts b { color: var(--teal); font-weight: 600; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center; }
.contact-grid h2 { margin-bottom: var(--s3); }
.contact-grid p { color: var(--muted); margin-bottom: 0; }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.contact-mail { font-family: var(--mono); font-size: 1.02rem; color: var(--text); border-bottom: 1px solid var(--border-strong); padding-bottom: 0.3rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-strong); padding: var(--s6) 0 var(--s7); color: var(--dim); font-family: var(--mono); font-size: 0.82rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s4); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-weight: 600; }
.footer-brand img { width: 22px; height: 22px; border-radius: 5px; }

/* ==========================================================================
   Legal / content pages (privacy, impressum, help)
   ========================================================================== */
.doc { padding: var(--s6) 0 var(--s7); }
.doc-wrap { max-width: 46rem; }
.doc h1 { margin-bottom: var(--s2); }
.doc .updated { font-family: var(--mono); color: var(--dim); font-size: 0.85rem; letter-spacing: 0.03em; margin-bottom: var(--s6); }
.doc h2 { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--border); font-size: 1.35rem; }
.doc h3 { margin-top: var(--s5); color: var(--text); }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--text); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin-bottom: 0.5rem; }
.doc li::marker { color: var(--border-strong); }

.back-link { display: inline-flex; align-items: center; gap: 0.4em; margin-bottom: var(--s5); font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.back-link:hover { color: var(--text); text-decoration: none; }

.callout { background: var(--panel); border: 1px solid var(--border-strong); border-left: 3px solid var(--teal); padding: var(--s4); margin: var(--s4) 0; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--teal); }

.placeholder { font-family: var(--mono); color: var(--teal); background: var(--panel-2); border: 1px dashed var(--border-strong); padding: 1px 6px; font-size: 0.9em; }

.doc-table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: 0.95rem; }
.doc-table th, .doc-table td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table th { font-family: var(--mono); color: var(--text); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; background: var(--panel-2); }
.doc-table td { color: var(--muted); }
.doc-table tr:last-child td { border-bottom: none; }

.faq-item { border-top: 1px solid var(--border); padding: var(--s4) 0; }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item h3 { margin-top: 0; margin-bottom: 0.4rem; }
.faq-item p { color: var(--muted); }
.faq-item p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .hero .lead, .hero .desc { max-width: none; }
  .spec { grid-template-columns: 1fr; }
  .dataflow { grid-template-columns: 1fr; gap: var(--s5); }
  .contact-grid { grid-template-columns: 1fr; gap: var(--s4); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--panel); border-bottom: 1px solid var(--border-strong);
    padding: var(--s4); gap: var(--s3);
  }
  .nav-toggle { display: inline-flex; margin-left: auto; background: none; border: 1px solid var(--border-strong); padding: 7px 9px; cursor: pointer; color: var(--text); }
  .nav-toggle svg { width: 20px; height: 20px; stroke: currentColor; }
  .lang-switch { margin-left: var(--s2); }
  /* Stack phones instead of overlapping them */
  .phones { flex-direction: column; gap: var(--s4); perspective: none; }
  .phone { width: 68%; max-width: 240px; }
  .phone:nth-child(1), .phone:nth-child(2), .phone:nth-child(3) { transform: none; margin: 0; }
  .phone-legend { flex-direction: column; align-items: center; gap: var(--s2); }
  .facts li { flex-basis: 100%; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); }
  .facts li:last-child { border-bottom: 0; }
  .hero { padding: var(--s5) 0; }
  section { padding: var(--s6) 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring .fill { stroke-dashoffset: 83; }
  .macro .m-bar i { transform: none; }
}
