/* sametime – Apple-nah: Systemschrift, Schwarz, Glas, Federbewegung.
   Die Kugel ist die Bühne. Alles andere schwebt als Glas darüber und
   fliegt beim Laden einmal nacheinander an seinen Platz. */

/* Schrift passend zum Logo: Quicksand (SIL Open Font License), selbst gehostet. */
@font-face {
  font-family: "Quicksand";
  src: url("/fonts/quicksand-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Quicksand";
  src: url("/fonts/quicksand-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #000;
  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --orange: #ff9f0a;
  --orange-hi: #ffb340;
  --teal: #64d2ff;
  --glass: rgba(28, 28, 30, 0.62);
  --glass-line: rgba(255, 255, 255, 0.09);
  --fill: rgba(120, 120, 128, 0.24);
  --fill-2: rgba(120, 120, 128, 0.36);

  --font: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --spring: cubic-bezier(0.2, 1.25, 0.32, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--label);
  font: 400 17px/1.35 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Dunkles Studio wie im Referenzvideo: Licht von oben, ein angedeuteter Boden,
   auf dem der Schatten der Kugel liegt. */
/* Ein Bildschirm, kein Scrollen. dvh berücksichtigt die Adressleiste am Handy, vh ist der Rückfall. */
html, body { height: 100vh; height: 100dvh; overflow: hidden; }

body {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #0d0f12;
  overscroll-behavior: none;
}

/* Studio-Licht hinter der Kugel, fest am Bildschirm – scrollt nicht mit. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 70% 55% at 50% 38%, #343a44 0%, #1d2127 48%, #0d0f12 100%);
}

/* Nur für Screenreader und Suchmaschinen sichtbar, optisch nicht vorhanden. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.glass {
  background: var(--glass);
  border: 0.5px solid var(--glass-line);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

/* ---- Kugel ---- */

/* Standbild der Kugel (LCP). Größe und Lage exakt wie die 3D-Kugel in globe3d.ts:
   Radius = min(40 % Breite, 30 % Höhe), Mitte bei 45 % Höhe; das Bild ist 2,5 Radien breit. */
.stage { display: grid; min-height: 0; }

.poster {
  position: fixed;
  inset: 0;
  container-type: size;
  pointer-events: none;
}

.poster img {
  position: absolute;
  left: 50%;
  top: 45%;
  width: calc(2.5 * min(40cqw, 30cqh));
  height: auto;
  translate: -50% -50%;
  transition: opacity 700ms ease;
}

.globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 700ms ease;
}

.globe:active { cursor: grabbing; }

/* Sobald die 3D-Kugel ihr erstes Bild gezeichnet hat: weich überblenden. */
.globe-ready .globe { opacity: 1; }
.globe-ready .poster img { opacity: 0; }

/* Ohne WebGL bleibt das Standbild; die Leinwand nimmt keine Eingaben an. */
.no-webgl .globe { display: none; }

/* Namensschild am blinkenden Land. Position setzt globe.ts per transform. */
.pin {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  margin: -46px 0 0 0;
  padding: 6px 12px;
  border-radius: 7px;
  translate: -50% 0;
  background: var(--orange);
  color: #000;
  font: 600 15px/1.2 var(--font);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(255, 159, 10, 0.35);
}

.pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--orange);
  border-radius: 2px;
}

/* ---- Kopf ---- */

.top {
  position: relative;
  z-index: 1;
  /* Raster: Name | Zahlen, darunter die beiden kleinen Links über die volle Breite. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "mark stats" "links links";
  align-items: start;
  gap: 10px 16px;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0;
  pointer-events: none;
}

.top > * { pointer-events: auto; }

.mark {
  margin: 0;
  line-height: 0;
  animation: drop-in 900ms 250ms var(--spring) both;
}

.mark img {
  display: block;
  width: auto;
  height: 40px;
}

/* Zahlen oben rechts: keine Kapsel, sondern zwei ruhige Kennzahlen mit Haarlinie dazwischen. */
.stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  animation: drop-in 900ms 380ms var(--spring) both;
}

.stat {
  display: grid;
  justify-items: end;
  gap: 3px;
  white-space: nowrap;
}

.stat b {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 600 22px/1 var(--font);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--label);
}

.stat > span {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--label-2);
}

.sep {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.14);
}

.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.8);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe { 50% { opacity: 0.45; } }

/* ---- Leitfaden & Changelog: klein unter dem Namen, unaufdringlich ---- */

.brand { display: contents; }
.mark { grid-area: mark; align-self: center; }
.stats { grid-area: stats; }
.links { grid-area: links; animation: drop-in 900ms 320ms var(--spring) both; }

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}



.guide { position: relative; }

.guide summary,
.textlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--label-2);
  font: 500 13px/1.2 var(--font);
  letter-spacing: 0;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: color 120ms ease;
}

.guide summary::-webkit-details-marker { display: none; }

.guide summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  translate: 0 -2px;
  rotate: 45deg;
  /* Nur transform-Eigenschaften animieren – kein Layout-Neuberechnen. */
  transition: rotate 200ms var(--out), translate 200ms var(--out);
}

.guide[open] summary::after { rotate: 225deg; translate: 0 2px; }

.guide summary:hover, .textlink:hover, .guide[open] summary { color: var(--label); }

.guide summary:focus-visible, .textlink:focus-visible {
  outline: 2px solid rgba(255, 159, 10, 0.6);
  outline-offset: 3px;
  border-radius: 3px;
}

.guide-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 3;
  width: min(300px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}

.guide[open] .guide-panel { animation: fold-in 260ms var(--out); }

.guide-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--label);
}

.guide-more {
  margin-top: 12px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--orange);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
}

.guide-more:hover { color: var(--orange-hi); }
.guide-more:focus-visible { outline: 2px solid rgba(255, 159, 10, 0.6); outline-offset: 3px; border-radius: 3px; }

@keyframes fold-in { from { opacity: 0; transform: translateY(-6px); } }

.guide-steps li + li { margin-top: 6px; }
.guide-steps li::marker { color: var(--orange); font-weight: 600; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.8);
}

.log { max-height: min(78dvh, 640px); overflow-y: auto; }

.log-list section + section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 0.5px solid var(--glass-line);
}

.log-list h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font: 600 15px/1.2 var(--font);
}

.log-list .ver {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 159, 10, 0.16);
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.log-list time { color: var(--label-2); font-weight: 500; font-size: 13px; }

.log-list ul {
  margin: 0;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--label);
}

.log-list li + li { margin-top: 4px; }
.log-list li::marker { color: var(--label-3); }

.log .m-actions { grid-template-columns: 1fr; margin-top: 22px; }

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-24px) scale(0.96); }
}

/* ---- Dock unten ---- */

.dock {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 0 16px max(28px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.dock > * { pointer-events: auto; }

/* Uhr und Knopf: zwei gleich breite Hälften, beide Inhalte exakt mittig. */
.bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: rise-in 1000ms 520ms var(--spring) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(60px) scale(0.9); }
}

.clock {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  min-width: 7.2ch;
  font: 500 28px/1 var(--font);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
}

.clock .sec { color: var(--label); font-weight: 600; }

/* Der Knopf: warmer Verlauf, feine Lichtkante oben, weicher Schein darunter. Keine Balken. */
.press {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-width: 168px;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffbd4a 0%, #ff9f0a 55%, #f58a00 100%);
  color: #1c1204;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(120, 50, 0, 0.25),
    0 0 0 1px rgba(255, 176, 64, 0.35),
    0 12px 32px -10px rgba(255, 149, 0, 0.75);
  cursor: pointer;
  transition: transform 220ms var(--spring), box-shadow 220ms ease, filter 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.press-label {
  position: relative;
  font: 700 18px/1 var(--font);
  letter-spacing: 0.01em;
}

.press:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05) saturate(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(120, 50, 0, 0.25),
    0 0 0 1px rgba(255, 176, 64, 0.45),
    0 16px 40px -10px rgba(255, 149, 0, 0.9);
}

/* Gedrückt: sichtbar eingedrückt – dunklerer Verlauf, Schatten nach innen. */
.press:active:not(:disabled) {
  transform: scale(0.97);
  filter: none;
  background: linear-gradient(180deg, #f08c00 0%, #ff9f0a 100%);
  box-shadow:
    inset 0 2px 6px rgba(120, 50, 0, 0.45),
    0 0 0 1px rgba(255, 176, 64, 0.35),
    0 6px 16px -8px rgba(255, 149, 0, 0.6);
}

.press:focus-visible {
  outline: 3px solid rgba(255, 159, 10, 0.5);
  outline-offset: 3px;
}

.press[data-state="sent"] { transform: scale(0.97); cursor: progress; }

/* Wartezeit: ruhig und zurückgenommen, nur die verbleibende Zeit. */
.press[data-state="cooling"],
.press[data-state="offline"] {
  background: rgba(120, 120, 128, 0.2);
  color: var(--label-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  filter: none;
  cursor: default;
}

.press[data-state="cooling"] .press-label { font-weight: 600; }

/* Kurzer Lichtblitz beim Drücken. */
.press.fired::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  animation: flash 500ms ease-out forwards;
}

@keyframes flash { from { opacity: 0.6; } to { opacity: 0; } }

.tagline {
  margin: 0;
  max-width: 36ch;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  /* WCAG: gemessen 10,2:1 gegen den hellsten Hintergrundpixel hinter dem Text (vorher 0,6 Deckkraft = 6,0:1). */
  color: rgba(235, 235, 245, 0.82);
  animation: fade-up 900ms 700ms var(--out) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
}

.status {
  margin: 0;
  padding: 9px 16px;
  border-radius: 10px;
  max-width: 40ch;
  text-align: center;
  font-size: 15px;
  animation: fade-up 400ms var(--out) both;
}

/* ---- Sheet ---- */

.sheet {
  width: min(560px, 100vw);
  max-width: none;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 10px clamp(20px, 5vw, 32px) max(26px, env(safe-area-inset-bottom));
  border: 0.5px solid var(--glass-line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  color: var(--label);
  font-family: var(--font);
}

.sheet::backdrop { background: rgba(0, 0, 0, 0.35); }
.sheet[open] { animation: sheet-up 560ms var(--spring); }

@keyframes sheet-up {
  from { transform: translateY(100%); }
}

@media (min-width: 700px) {
  .sheet {
    margin: auto;
    border-bottom: 0.5px solid var(--glass-line);
    border-radius: 18px;
    padding-bottom: 26px;
  }
  .sheet[open] { animation: sheet-pop 480ms var(--spring); }
  @keyframes sheet-pop {
    from { opacity: 0; transform: translateY(40px) scale(0.94); }
  }
}

.grabber {
  width: 36px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 3px;
  background: var(--label-3);
}

.sheet h2 {
  margin: 0 0 6px;
  font: 700 30px/1.1 var(--font);
  letter-spacing: -0.035em;
}

.m-body {
  margin: 0 0 22px;
  font-size: 17px;
  color: var(--label-2);
}

.m-pick {
  margin: 0 0 10px;
  font: 600 15px/1.2 var(--font);
  color: var(--label-2);
}

.words { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 9px 15px;
  border: 0;
  border-radius: 8px;
  background: var(--fill);
  color: var(--label);
  font: 500 16px/1.15 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 200ms var(--spring), background-color 120ms ease;
}

.chip:hover { background: var(--fill-2); }
.chip:active { transform: scale(0.94); }

.link {
  margin-top: 12px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--orange);
  font: 500 15px var(--font);
  cursor: pointer;
}

.m-sent { margin: 0; font-size: 15px; color: var(--label-2); }

.m-got {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(100, 210, 255, 0.12);
  color: var(--teal);
  font: 600 19px/1.3 var(--font);
  letter-spacing: -0.02em;
  animation: fade-up 400ms var(--out) both;
}

.m-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 26px;
}

.primary, .secondary {
  height: 50px;
  border: 0;
  border-radius: 10px;
  font: 600 17px/1 var(--font);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 200ms var(--spring);
}

.primary { background: var(--orange); color: #000; }
.secondary { background: var(--fill); color: var(--label); }
.primary:active, .secondary:active { transform: scale(0.97); }
.m-actions:has(> [hidden]) > :not([hidden]) { grid-column: 1 / -1; }

.chip:focus-visible, .link:focus-visible, .primary:focus-visible, .secondary:focus-visible {
  outline: 3px solid rgba(255, 159, 10, 0.5);
  outline-offset: 2px;
}

/* Feste Ziffernbreite (siehe setDigits in main.ts). */
.fd {
  display: inline-block;
  width: 0.6em;
  font-style: normal;
  text-align: center;
}

/* ---- Info-Fenster "Mehr & FAQ" (SEO-Text, für alle lesbar) ---- */

.about { max-height: min(86dvh, 760px); overflow-y: auto; }
@media (min-width: 700px) { .about { width: min(640px, 100vw); } }

.about .about-lead {
  margin: 0 0 28px;
  font: 700 clamp(26px, 4.5vw, 34px)/1.15 var(--font);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.about section + section { margin-top: 26px; }

.about h2:not(.about-lead) {
  margin: 0 0 8px;
  font: 700 19px/1.3 var(--font);
  letter-spacing: -0.01em;
}

.about p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(235, 235, 245, 0.78);
}

.qa {
  border-top: 0.5px solid var(--glass-line);
}

.qa:last-of-type { border-bottom: 0.5px solid var(--glass-line); }

.qa summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font: 600 17px/1.35 var(--font);
  cursor: pointer;
  list-style: none;
}

.qa summary::-webkit-details-marker { display: none; }

.qa summary::after {
  content: "+";
  flex: none;
  font: 500 22px/1 var(--font);
  color: var(--label-2);
  transition: rotate 200ms var(--out);
}

.qa[open] summary::after { rotate: 45deg; }
.qa p { padding: 0 0 16px; }

.qa summary:focus-visible {
  outline: 2px solid rgba(255, 159, 10, 0.6);
  outline-offset: 3px;
  border-radius: 4px;
}

.about .m-actions { grid-template-columns: 1fr; margin-top: 26px; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .mark img { height: 30px; }
  .stats { gap: 14px; }
  .stat b { font-size: 19px; }
  .stat > span { font-size: 11px; }
  .clock { padding: 0 14px 0 12px; }
  .clock { font-size: 24px; }
  .press { min-width: 128px; height: 52px; padding: 0 22px; }
}



@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
