@charset "UTF-8";
/* AquaGuard Bremgarten — public page.
   HBT corporate palette: Blau #8BAED8 dominant, Orange #D58D34 highlight only,
   plus the three Ampel state colours. Self-hosted Inter, no framework, no build. */

@font-face { font-family:"Inter"; font-weight:400; font-display:swap; src:url("../vendor/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:500; font-display:swap; src:url("../vendor/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:600; font-display:swap; src:url("../vendor/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-weight:700; font-display:swap; src:url("../vendor/fonts/Inter-Bold.woff2") format("woff2"); }

:root {
  --blau: #8BAED8;
  --blau-strong: #4f7bab;
  --orange: #D58D34;
  --ink: #1f2733;
  --muted: #5a6470;
  --line: #dbe2ea;
  --bg: #f4f7fb;
  --surface: #ffffff;

  --gruen: #26BF86;
  --gruen-text: #178a5f;  /* darkened --gruen for legible green text on white */
  --amber: #D58D34;
  --rot: #D64545;

  /* current-state colour, set by [data-state] below */
  --state: var(--blau);
  --state-soft: rgba(139,174,216,0.14);

  /* type scale — one modular ramp, not a dozen near-identical sizes */
  --fs-2xs: 0.72rem;   /* labels, ticks, kickers, footnotes */
  --fs-xs: 0.8rem;     /* small secondary text, groups, devbar */
  --fs-sm: 0.9rem;     /* body, FAQ, hero subtext, statuses */
  --fs-lg: clamp(1.2rem, 2.9vw, 1.6rem);  /* section headings */
  --fs-xl: clamp(2.1rem, 6vw, 3.4rem);    /* display: hero word, discharge */

  --radius: 16px;
  --radius-sm: 10px;
  /* layered shadows: a crisp contact line + a soft ambient cast reads richer than a single blur */
  --shadow: 0 1px 2px rgba(35,55,85,0.06), 0 14px 34px rgba(35,55,85,0.10);
  --shadow-sm: 0 1px 2px rgba(35,55,85,0.05), 0 6px 18px rgba(35,55,85,0.07);
  --shadow-lift: 0 2px 4px rgba(35,55,85,0.07), 0 20px 44px rgba(35,55,85,0.13);
  /* card face: a barely-there top-down sheen so white surfaces catch light */
  --surface-2: linear-gradient(180deg, #ffffff 0%, #fafcfe 100%);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* --state-text = --state, but with a legible-on-white green (--state itself is a hair
   too light for text). Used by the wave "läuft" status so it never reads green in rot. */
:root { --state-text: var(--blau-strong); }
[data-state="gruen"]  { --state: var(--gruen); --state-soft: rgba(38,191,134,0.13); --state-text: var(--gruen-text); }
[data-state="orange"] { --state: var(--amber); --state-soft: rgba(213,141,52,0.14); --state-text: var(--amber); }
[data-state="rot"]    { --state: var(--rot);   --state-soft: rgba(214,69,69,0.13); --state-text: var(--rot); }
/* offline: neutral grey, no state colour, live conditions hidden (see .is-offline) */
[data-state="offline"] { --state: var(--muted); --state-soft: rgba(90,100,112,0.10); --state-text: var(--muted); }
/* .is-loading shares the neutral treatment so Platsch never flashes happy/grün
   before the live Ampel resolves; JS drops it on the first render */
.is-offline .hero-mascot, .is-loading .hero-mascot { filter: grayscale(1) opacity(0.55); }
.is-offline .gem-glow, .is-loading .gem-glow { opacity: 0 !important; animation: none !important; }
.is-offline #conditions, .is-loading #conditions { display: none; }

*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size: clamp(15px, 0.5vw + 12px, 18px); scroll-behavior: smooth; }
body {
  font-family: var(--font); color: var(--ink);
  background: var(--bg);
  background-image: linear-gradient(180deg, #f7fafd 0%, var(--bg) 42%);
  background-repeat: no-repeat;
  line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width:7px; height:7px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius:4px; }
a { color: var(--blau-strong); }
/* kill the translucent tap-highlight box on touch + the UA focus box on mouse click;
   keyboard focus is still shown via the :focus-visible rules below */
a, button, summary, details { -webkit-tap-highlight-color: transparent; }

/* ---- BOX 1 · Hero (the light dominates) ------------------------------------ */
.hero {
  min-height: 100vh;   /* fallback for browsers without large-viewport units */
  min-height: 100lvh;  /* large viewport: fills past Safari's floating URL bar (min-height, so the hero grows if the content is taller) */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: clamp(1rem, 2.5vh, 1.8rem); padding: clamp(1.5rem, 4vh, 3rem) 1.2rem clamp(1.5rem, 3vh, 2.5rem);
  position: relative; overflow: hidden;
}
/* conditions box lives on the first screen now, right under the guard */
.hero .conditions { padding: 0; width: 100%; scroll-margin-top: 0; }
.hero::before { /* soft state-coloured wash behind the light */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(60% 55% at 50% 38%, var(--state-soft), transparent 70%);
  transition: background .6s ease;
}
.hero > * { position: relative; z-index: 1; }
/* ride the top of the hero instead of being centred with the rest, so the
   dead space above it collapses and the mascot/light stay optically centred */
.hero-eyebrow {
  position: absolute; top: clamp(1rem, 3vh, 2rem); left: 0; right: 0; z-index: 1;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--fs-2xs); font-weight: 600;
  color: var(--muted);
}
.wm-aqua { color: var(--ink); font-weight: 700; }
.wm-guard { color: var(--blau-strong); font-weight: 700; }

/* mascot + light side by side; the light stays the signal, the guard presents it */
.hero-stage {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
}
.hero-signal { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.mascot-wrap { position: relative; display: inline-block; line-height: 0; }
.hero-mascot {
  height: clamp(190px, 34svh, 340px); width: auto;
  filter: drop-shadow(0 22px 30px rgba(35,55,85,0.2));
}

/* the active trident gem glows in the Ampel colour (gem positions in image %) */
.gem-glow {
  position: absolute; left: 77.2%; top: 11.2%; /* the middle gem carries the state */
  width: 26%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
  transition: opacity .6s ease;
}
[data-state] .gem-glow { animation: gem-pulse 2.4s ease-in-out infinite; }
[data-state="gruen"]  .gem-glow { opacity: 1; background: radial-gradient(circle, rgba(38,191,134,0.6), rgba(38,191,134,0) 62%); }
[data-state="orange"] .gem-glow { opacity: 1; background: radial-gradient(circle, rgba(213,141,52,0.6), rgba(213,141,52,0) 62%); }
[data-state="rot"]    .gem-glow { opacity: 1; background: radial-gradient(circle, rgba(214,69,69,0.62), rgba(214,69,69,0) 62%); }
@keyframes gem-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.3); }
}
@media (max-width: 720px) {
  .hero-stage { flex-direction: column; gap: 0.8rem; }
  .hero-mascot { height: clamp(150px, 22svh, 220px); }
}

.hero-word {
  font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--state); transition: color .5s ease, text-shadow .5s ease;
  text-shadow: 0 6px 30px var(--state-soft);  /* faint state-coloured halo */
}
.hero-line { max-width: 42ch; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); }

/* stale / offline flag on the light */
.stale-flag {
  display: inline-block; margin-top: 0.3rem; font-size: var(--fs-2xs); color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem;
}
.test-flag {
  color: #fff; background: var(--rot); border-color: var(--rot);
  font-size: var(--fs-xs); font-weight: 700; padding: 0.25rem 0.75rem;
}

/* ---- BOX 2 · Conditions ---------------------------------------------------- */
.conditions {
  padding: 2rem clamp(1rem, 4vw, 2rem) 2.5rem;
  /* anchor-jump target: clear the sticky header so #conditions lands just below it */
  scroll-margin-top: 4rem;
}
.cond-inner {
  /* no negative margin: the hero is a full screen and the card stays entirely
     below the fold, so the landing shows only the light */
  max-width: 960px; margin: 0 auto; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2.5vw, 1.6rem) clamp(1.1rem, 3vw, 1.9rem);
}
.cond-label { display: block; text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--fs-2xs); font-weight: 700; color: var(--muted); }

/* Regen: one quiet footnote line under the gauge */
.cond-foot { margin-top: 0.9rem; font-size: var(--fs-xs); color: var(--muted); }
.cond-foot strong { color: var(--ink); font-weight: 700; }

/* main row: bold current discharge + the two wave status rows */
.cond-main { display: flex; align-items: center; gap: clamp(1.4rem, 4vw, 2.5rem); margin: 0.7rem 0 1.3rem; }
.cond-hero { display: flex; align-items: baseline; gap: 0.3rem; flex: none; }
.cond-q { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.cond-q-unit { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

.cond-waves { display: flex; flex-direction: column; gap: 0.6rem; flex: 1 1 auto; min-width: 0; }
.wv { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: var(--fs-sm); }
.wv-name { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.wv-key { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.wv-status { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.wv-status.is-running { color: var(--state-text); font-weight: 600; }

/* Abfluss-Gauge: two lanes on one 0–600 m³/s scale. Top lane = the surfable
   ranges (emerald, --gruen hue; set from WAVE_COLORS in public.js). Bottom = the
   water level (blue fill 0→Q) with a quiet neutral marker at the edge. Separate
   lanes + separate hues keep level ≠ target zones. */
.qgauge { padding: 0 4px; }
.qg-ranges { position: relative; height: 8px; margin-bottom: 7px; }
.qg-range { position: absolute; top: 0; height: 100%; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4); }
.qg-plot { position: relative; height: 30px; }
.qg-track { position: absolute; left: 0; right: 0; top: 9px; height: 12px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.qg-fill { position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%), linear-gradient(90deg, #a9caea, #6f9ac8);
  box-shadow: inset 0 -1px 2px rgba(51,90,140,0.18); }
.qg-marker { position: absolute; top: 15px; transform: translate(-50%, -50%); width: 8px; height: 8px;
  border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.qg-ticks { position: relative; height: 15px; margin-top: 6px; }
.qg-tick { position: absolute; transform: translateX(-50%); font-size: var(--fs-2xs); color: var(--muted); }

/* ---- The scroll · info section --------------------------------------------- */
.info {
  /* generous top buffer: the hero already covers the tallest possible fold (100lvh),
     this keeps "Gut zu wissen" comfortably below it on every device even after the
     reveal transform lifts the heading */
  max-width: 760px; margin: 0 auto; padding: clamp(2.75rem, 10vh, 6rem) clamp(1rem, 4vw, 1.5rem) 3rem;
  display: flex; flex-direction: column; gap: clamp(1.1rem, 3vw, 1.9rem);
}

/* FAQ section — individual white cards per question, click to expand (native details) */
.faq-section h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 1rem; }
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.faq-item:not(.faq-static):hover { border-color: rgba(139,174,216,0.55); box-shadow: var(--shadow); transform: translateY(-1px); }
.faq-item[open] { box-shadow: var(--shadow); }
/* the legend card is always open + not collapsible */
.faq-static { box-shadow: var(--shadow); }
.faq-head { padding: clamp(1rem, 3vw, 1.25rem) clamp(1.1rem, 3vw, 1.5rem);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.faq-item summary { list-style: none; cursor: pointer; user-select: none;
  padding: clamp(1rem, 3vw, 1.25rem) clamp(1.1rem, 3vw, 1.5rem);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; flex: none; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover, .faq-item[open] summary { color: var(--blau-strong); }
.faq-item summary:focus-visible { outline: 2px solid var(--blau-strong); outline-offset: -2px; }
.faq-item summary:focus:not(:focus-visible), .quellen summary:focus:not(:focus-visible) { outline: none; }
.faq-a { padding: 0 clamp(1.1rem, 3vw, 1.5rem) clamp(1.1rem, 3vw, 1.35rem); font-size: var(--fs-sm); line-height: 1.6; }
.faq-a p { margin: 0 0 0.7rem; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a .ampel-legend { margin: 0; }
.faq-a .ib-list { margin: 0 0 0 1.2rem; }
.faq-group { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blau-strong); margin: 18px 4px 0; }
.faq-group:first-child { margin-top: 0; }
.ib-list, .kontakt-card { font-size: var(--fs-sm); }
.ib-list { margin: 0 0 0.95rem 1.1rem; }
.ib-list li { margin-bottom: 0.3rem; }

/* Ampel legend inside the "how to read" box */
.ampel-legend { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.al-row { display: flex; align-items: flex-start; gap: 0.65rem; font-size: var(--fs-sm); }
.al-dot { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; margin-top: 3px; box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.al-gruen { background: var(--gruen); } .al-orange { background: var(--amber); } .al-rot { background: var(--rot); }

.kontakt-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; line-height: 1.7; }

/* Quellen (collapsible) */
.quellen { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 0.4rem 1.2rem; }
.quellen summary { cursor: pointer; font-weight: 600; padding: 0.8rem 0; list-style: none; color: var(--ink); font-size: var(--fs-sm); }
.quellen summary::marker, .quellen summary::-webkit-details-marker { display: none; }
.quellen summary::before { content: "＋ "; color: var(--blau-strong); font-weight: 700; }
.quellen[open] summary::before { content: "－ "; }
.q-list { margin: 0.2rem 0 1rem 1.2rem; font-size: var(--fs-xs); color: var(--muted); line-height: 1.55; }
.q-list li { margin-bottom: 0.5rem; }
.q-list a { font-weight: 500; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .gem-glow { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- Footer ---------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 2rem clamp(1rem, 4vw, 2rem); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.foot-disclaimer { max-width: 52ch; color: var(--ink); font-size: var(--fs-sm); }
.foot-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--muted); font-size: var(--fs-sm); }
.foot-signet { height: 20px; width: auto; display: inline-block; }
.foot-hbt { font-weight: 600; color: var(--ink); }
.foot-version { font-size: var(--fs-2xs); color: var(--muted); }
.foot-privacy { max-width: 60ch; font-size: var(--fs-2xs); line-height: 1.5; color: var(--muted); }
.foot-privacy strong { color: var(--ink); font-weight: 600; }

/* ---- narrow screens -------------------------------------------------------- */
@media (max-width: 640px) {
  .cond-main { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
  .cond-waves { width: 100%; }
}
@media (max-width: 480px) {
  .qg-tick:not(.is-major) { display: none; }
}

/* ---- ?dev=true state switcher (never shown in production URLs) ------------- */
.devbar {
  position: fixed; left: 12px; bottom: 12px; z-index: 1000;
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap;
  max-width: calc(100vw - 24px); overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px; box-shadow: var(--shadow); font-size: var(--fs-xs);
  /* static compositor layer so the fixed bar tracks scroll without a frame of lag.
     translateZ only (no will-change — that churns the layer and shimmers instead) */
  transform: translateZ(0); backface-visibility: hidden;
}
.devbar button { flex: none; }
.devbar-label { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-2xs); }
.devbar button {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 7px; padding: 4px 10px; font: inherit; font-weight: 600;
}
.devbar button:hover { border-color: var(--muted); }
.devbar button[aria-pressed="true"] { border-color: var(--blau-strong); background: var(--blau-strong); color: #fff; }
.devbar .d { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.devbar button[data-state="gruen"] .d { background: var(--gruen); }
.devbar button[data-state="orange"] .d { background: var(--orange); }
.devbar button[data-state="rot"] .d { background: var(--rot); }
