/* IMMEDILAB Website — Layout und Komponenten.
 *
 * Farben, Abstände, Radien und Schriften kommen ausschliesslich als var(--…)
 * aus assets/tokens.css (Kopie aus dem Corporate Design,
 * https://cd.immeditech.ch/immedilab/tokens.css — dort nicht von Hand ändern).
 * Hier steht KEIN Farbwert; `make css-check` prüft das.
 * Textgrössen folgen den Web-Textstilen des CD (web-display … web-label).
 */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Fusszeile bleibt auch bei kurzen Seiten unten */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0 0 var(--space-4); }
h1 { font-size: clamp(1.75rem, 3vw + 0.875rem, 2.75rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.375rem, 2vw + 0.875rem, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 var(--space-4); }

a { color: var(--brand); text-decoration: none; }
a:hover, a:active { color: var(--brand-strong); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

address { font-style: normal; }

/* Sprunglink für Tastatur und Screenreader */
.skip { position: absolute; left: var(--space-4); top: calc(-1 * var(--space-16)); background: var(--surface); padding: var(--space-2) var(--space-4); z-index: 10; }
.skip:focus { top: var(--space-4); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-6); }
.prose { max-width: 760px; margin-left: 0; }
@media (min-width: 1168px) { .prose { margin-left: calc((100% - 1120px) / 2); } }

.eyebrow {
  font-size: 0.8125rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand); margin-bottom: var(--space-3);
}
.lead { font-size: 1.25rem; line-height: 1.5; max-width: 40em; }
.actions { margin-top: var(--space-8); }

/* Buttons — CD: 3.6 px Radius, ein Hauptbutton pro Ansicht */
.btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  line-height: 1; padding: var(--space-4) var(--space-6); border-radius: var(--radius-sm);
  border: 1px solid transparent; text-decoration: none;
}
.btn-primary { background: var(--brand); color: var(--on-dark); }
.btn-primary:hover, .btn-primary:active { background: var(--brand-strong); color: var(--on-dark); text-decoration: none; }

/* Kopfzeile — weiss, Positivlogo */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 88px; }
.brand img { height: 45px; width: auto; }
.langs { display: flex; gap: var(--space-1); }
.langs a {
  font-size: 0.875rem; font-weight: 600; color: var(--muted);
  padding: var(--space-2); border-radius: var(--radius-sm);
}
.langs a:hover { color: var(--brand-strong); }
.langs a[aria-current] { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }

/* Sektionen — 64 px klein, 96 px gross */
.hero, .section { padding: var(--space-16) 0; }
.subhero { padding: var(--space-16) 0 var(--space-6); }
.section-tight { padding: 0 0 var(--space-16); }
@media (min-width: 900px) {
  .hero, .section { padding: var(--space-24) 0; }
  .subhero { padding-top: var(--space-24); }
  .section-tight { padding-bottom: var(--space-24); }
}
.hero h1 { font-size: clamp(2rem, 5vw + 0.75rem, 4rem); line-height: 1.1; max-width: 14em; }
.section-alt { background: var(--surface-alt); }

.crumb { font-size: 0.875rem; color: var(--muted); margin-bottom: var(--space-6); }
.prose h2 { font-size: 1.25rem; line-height: 1.3; margin-top: var(--space-8); margin-bottom: var(--space-2); }

/* Kontakt */
.contact { display: grid; gap: var(--space-8); }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; gap: var(--space-16); } }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-6); align-content: start; }
.facts dt {
  font-size: 0.8125rem; line-height: 1.7; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); padding-top: var(--space-1);
}
.facts dd { margin: 0; }

/* Fusszeile — dunkle Fläche, Negativlogo, Links weiss */
.site-footer { background: var(--surface-dark); color: var(--on-dark); padding: var(--space-12) 0 var(--space-8); font-size: 0.875rem; line-height: 1.5; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--on-dark); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--on-dark); }
.footer-grid { display: grid; gap: var(--space-8); }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1fr auto; } }
.flogo { height: 40px; width: auto; }
.fbottom {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
  border-top: 1px solid var(--on-dark-muted); padding-top: var(--space-6); color: var(--on-dark-muted);
}
.flinks { display: flex; gap: var(--space-6); }

/* Teaser — drei Schritte: Messwerte (lesbar) → Gesamtbild → Einordnung (nur erahnbar) */
.teaser { display: grid; gap: var(--space-6); margin-top: var(--space-8); }
@media (min-width: 900px) { .teaser { grid-template-columns: repeat(3, 1fr); } }
.report { margin: 0; background: var(--surface); border: 1px solid var(--line); padding: var(--space-6); min-width: 0; overflow: hidden; }
.report figcaption {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: 0.8125rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-4);
}
.step {
  display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em;
  background: var(--brand); color: var(--on-dark); border-radius: var(--radius-sm); letter-spacing: 0;
}
.report pre {
  margin: 0; overflow-x: auto; color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem; line-height: 1.8;
}
.teaser-note { margin: var(--space-8) 0 0; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--navy); }

/* Grafiken bleiben unscharf; beim Darüberfahren etwas schärfer, aber nie ganz */
.viz { display: block; width: 100%; height: auto; filter: blur(6px); transition: filter 0.6s ease; }
.report-blur:hover .viz { filter: blur(2.5px); }
@media (prefers-reduced-motion: reduce) { .viz { transition: none; } }
.viz-base { stroke: var(--line); stroke-width: 2; }
.viz-area { fill: var(--navy-tint); stroke: var(--navy); stroke-width: 2.5; }
.viz-bar { fill: var(--status-normal); }
.viz-bar-hi { fill: var(--status-abnormal); }
.viz-ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.viz-head { fill: var(--navy); }
.viz-line { fill: var(--muted); }
.viz-mark { fill: var(--brand); }
