/* Puls – Webseite. Farben in OKLCH, leicht zum Blau-Violett des App-Symbols getönt. */
:root {
  --bg: oklch(0.975 0.004 285);
  --surface: oklch(0.995 0.002 285);
  --sunken: oklch(0.955 0.006 285);
  --ink: oklch(0.22 0.012 285);
  --muted: oklch(0.45 0.012 285);
  --line: oklch(0.89 0.007 285);
  --accent: oklch(0.52 0.19 278);
  --accent-ink: oklch(0.985 0.004 285);
  --focus: oklch(0.55 0.2 278);
  --stage-a: oklch(0.9 0.045 290);
  --stage-b: oklch(0.84 0.06 262);
  --stage-glow: oklch(0.96 0.03 300);
  --menubar: oklch(0.97 0.01 285 / 0.62);
  --menubar-ink: oklch(0.2 0.01 285);
  --ok: oklch(0.66 0.17 150);
  --warn: oklch(0.78 0.16 85);
  --high: oklch(0.6 0.21 27);
  --radius-l: 28px;
  --radius-m: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --measure: 62ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.165 0.01 285);
    --surface: oklch(0.205 0.012 285);
    --sunken: oklch(0.19 0.011 285);
    --ink: oklch(0.955 0.005 285);
    --muted: oklch(0.74 0.012 285);
    --line: oklch(0.3 0.012 285);
    --accent: oklch(0.72 0.15 278);
    --accent-ink: oklch(0.16 0.02 285);
    --focus: oklch(0.75 0.15 278);
    --stage-a: oklch(0.32 0.07 285);
    --stage-b: oklch(0.2 0.045 262);
    --stage-glow: oklch(0.42 0.09 300);
    --menubar: oklch(0.2 0.01 285 / 0.55);
    --menubar-ink: oklch(0.96 0.005 285);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 10px; z-index: 10; }
.skip:focus { top: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Kopf- und Fußzeile */
.site-header, .site-footer, main > section, .article article {
  width: min(1180px, 100% - 2 * clamp(20px, 5vw, 48px));
  margin-inline: auto;
}
.site-header { display: flex; align-items: center; gap: 1.5rem; padding: 1.1rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1.05rem; }
.site-header nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }
.site-footer { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; padding: 2.5rem 0 3.5rem; margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.site-footer a { color: var(--muted); }

/* Typografische Skala (Verhältnis ~1.33) */
h1 { font-size: clamp(2.6rem, 2rem + 3.2vw, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 1.45rem + 2vw, 3.1rem); line-height: 1.08; letter-spacing: -0.028em; font-weight: 700; }
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
.lead { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); line-height: 1.5; color: var(--muted); max-width: 38ch; }
@media (prefers-color-scheme: dark) { .lead, .section-head p { line-height: 1.58; } }

/* Hero: echte Mac-Szene */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}
.hero .app-icon { width: 104px; height: 104px; margin: 0 0 1.4rem -8px; filter: drop-shadow(0 10px 22px oklch(0.45 0.18 285 / 0.28)); }
.hero h1 { margin-bottom: 1.2rem; }
.download { margin-top: 2rem; }
.download.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.download-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; }
.download.center .download-options { justify-content: center; }
.store-badge { display: inline-flex; border-radius: 10px; transition: transform 160ms var(--ease-out); }
.store-badge img { display: block; width: auto; height: 48px; }
.store-badge:active { transform: scale(0.98); }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.6rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 650; font-size: 1.05rem; text-decoration: none;
  transition: transform 160ms var(--ease-out), filter 160ms var(--ease-out);
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: scale(0.98); }
.meta { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--muted); line-height: 1.55; }

.stage {
  position: relative; margin: 0;
  aspect-ratio: 100 / 98;
  border-radius: var(--radius-l);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 8%, var(--stage-glow), transparent 58%),
    linear-gradient(160deg, var(--stage-a), var(--stage-b));
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.08) inset, 0 30px 80px -30px oklch(0.3 0.08 285 / 0.45);
}
.menubar {
  position: absolute; inset: 0 0 auto 0; height: 34px;
  display: flex; align-items: center; justify-content: flex-end; gap: 18px;
  padding: 0 18px;
  background: var(--menubar);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  color: var(--menubar-ink); font-size: 13px; font-weight: 500;
}
.puls-item { display: flex; align-items: center; height: 26px; padding: 0 6px; border-radius: 7px; background: oklch(0.6 0.02 285 / 0.22); }
.puls-item img { height: 22px; width: auto; display: block; }
.clock { font-variant-numeric: tabular-nums; }
.panel-drop {
  position: absolute; top: 42px; right: clamp(8px, 4%, 48px);
  width: min(52%, 360px);
  transform-origin: 70% 0;
  animation: drop 900ms var(--ease-out) 250ms both;
}
.panel-drop img { display: block; width: 100%; filter: drop-shadow(0 24px 40px oklch(0.15 0.05 285 / 0.45)); }
@keyframes drop {
  from { opacity: 0; transform: translateY(-14px) scale(0.965); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .panel-drop { animation: none; } }

/* Abschnittsköpfe */
main > section:not(.hero) { padding-block: clamp(2.75rem, 5.5vw, 4.75rem); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { margin-bottom: 0.9rem; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.15rem; max-width: var(--measure); }

/* Detail-Explorer */
.explorer { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
[role=tablist] { display: flex; flex-direction: column; gap: 4px; }
[role=tab] {
  appearance: none; border: 0; text-align: left; font: inherit; color: var(--muted);
  background: transparent; border-radius: var(--radius-m);
  padding: 0.95rem 1.15rem; cursor: pointer;
  display: grid; gap: 0.25rem;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
[role=tab]:hover { background: var(--sunken); color: var(--ink); }
[role=tab][aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0.2 0.02 285 / 0.08), 0 0 0 1px var(--line); }
.tab-title { font-weight: 650; font-size: 1.1rem; color: var(--ink); }
.tab-text { font-size: 0.97rem; line-height: 1.5; max-width: 48ch; }
[role=tab][aria-selected=false] .tab-text { display: none; }
.explorer-view {
  position: sticky; top: 1.5rem;
  display: grid; place-items: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, var(--stage-a), var(--stage-b));
  min-height: 420px;
}
.explorer-view img { width: min(100%, 360px); filter: drop-shadow(0 20px 36px oklch(0.15 0.05 285 / 0.4)); }
[role=tabpanel][hidden] { display: none; }

/* Menüleiste */
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.bar { border-radius: var(--radius-m); padding: 1.6rem 1.8rem; display: flex; justify-content: center; }
.bar img { width: min(100%, 546px); height: auto; }
.bar.dark { background: oklch(0.22 0.012 285); box-shadow: 0 0 0 1px oklch(0.32 0.012 285) inset; }
.bar.light { background: oklch(0.96 0.005 285); box-shadow: 0 0 0 1px oklch(0.88 0.006 285) inset; }
.legend { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.8rem 2.2rem; color: var(--muted); }
.legend strong { color: var(--ink); font-weight: 650; margin-right: 0.25rem; }
.swatch { display: inline-block; width: 10px; height: 22px; border-radius: 3px; vertical-align: -5px; margin-right: 0.6rem; }
.swatch.ok { background: var(--ok); } .swatch.warn { background: var(--warn); } .swatch.high { background: var(--high); }

/* Werte */
.values h2 { max-width: 20ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 2rem clamp(2rem, 4vw, 3.5rem); }
.values-grid h3 { margin-bottom: 0.5rem; }
.values-grid p { margin: 0; color: var(--muted); max-width: 36ch; }

/* Vergleich */
.table-wrap { overflow-x: auto; border-radius: var(--radius-m); box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 1rem; }
th, td { position: relative; padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { font-size: 1rem; font-weight: 650; }
thead td { width: 46%; }
tbody th { font-weight: 450; color: var(--ink); }
td { color: var(--muted); }
.mark { display: inline-block; width: 20px; height: 20px; border-radius: 50%; vertical-align: -4px; }
.mark.yes { position: relative; }
.mark.yes::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); }
.mark.yes::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid var(--surface); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.mark.no { width: 14px; height: 2px; border-radius: 1px; background: var(--muted); vertical-align: 5px; }
.note { margin-top: 1.1rem; color: var(--muted); font-size: 0.95rem; }

/* Fragen */
.faq h2 { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.faq-list { max-width: 50rem; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; padding: 1.15rem 2.5rem 1.15rem 0; position: relative;
  font-weight: 600; font-size: 1.1rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 9px; height: 9px;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}
details[open] summary::after { transform: translateY(-20%) rotate(225deg); }
details p { margin: 0 0 1.3rem; color: var(--muted); max-width: var(--measure); }

/* Abschluss */
.closing { text-align: center; }
.closing .app-icon { width: 88px; height: 88px; margin-bottom: 1.2rem; }
.closing h2 { margin-inline: auto; max-width: 18ch; }
.closing .download { margin-top: 1.8rem; }
.source { margin-top: 1.2rem; }

/* Unterseiten */
.article article { max-width: 46rem; padding-block: clamp(2rem, 5vw, 4rem) 0; }
.article h1 { font-size: clamp(2.3rem, 1.8rem + 2.4vw, 3.6rem); margin-bottom: 1rem; }
.article h2 { font-size: 1.35rem; letter-spacing: -0.015em; margin: 2.4rem 0 0.6rem; }
.article p, .article li { max-width: var(--measure); }
.article .lead { max-width: var(--measure); }

/* 404 */
.notfound { width: min(40rem, 100% - 40px); margin: 12vh auto; }
.notfound h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 1rem 0; }
.notfound h2 { font-size: 1.3rem; margin-top: 3rem; }
.notfound p { color: var(--muted); }

/* Schmale Bildschirme */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stage { aspect-ratio: auto; height: min(calc(78vw * 1.53 + 90px), 640px); }
  .panel-drop { width: min(78%, 360px); right: 50%; transform: translateX(50%); animation-name: drop-center; }
  @keyframes drop-center {
    from { opacity: 0; transform: translateX(50%) translateY(-14px) scale(0.965); }
    to { opacity: 1; transform: translateX(50%); }
  }
  .explorer { grid-template-columns: 1fr; }
  .explorer-view { position: static; min-height: 0; }
  .site-header nav a[href^="#"] { display: none; }
}
@media (max-width: 600px) {
  table { min-width: 0; font-size: 0.93rem; }
  th, td { padding: 0.85rem 0.7rem; }
  thead td { width: 42%; }
}
@media (max-width: 520px) {
  .clock { display: none; }
  .menubar { justify-content: center; }
}
