:root {
    /* Light (default) — kühles Papier mit Indigo-Bias */
    --paper: #eceef6;
    --paper-2: #f4f5fb;
    --surface: #ffffff;
    --ink: #1a1c2e;
    --muted: #585c74;
    --line: rgba(26, 28, 46, 0.10);
    --dot: rgba(77, 118, 232, 0.20);
    --indigo: #4d76e8;
    --indigo-bright: #6ca2ff;
    --teal: #17a9a0;
    --night-1: #46497a;
    --night-2: #22243c;
    --shadow-tile: 0 22px 44px -18px rgba(34, 36, 60, 0.45);
    --shadow-card: 0 1px 2px rgba(26, 28, 46, 0.05), 0 14px 30px -20px rgba(34, 36, 60, 0.35);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #121428;
      --paper-2: #171a31;
      --surface: #1c1f39;
      --ink: #eef0fb;
      --muted: #a4a8c8;
      --line: rgba(255, 255, 255, 0.10);
      --dot: rgba(140, 162, 255, 0.16);
      --indigo: #7ba3ff;
      --indigo-bright: #9dbcff;
      --teal: #3fcabf;
      --shadow-tile: 0 26px 50px -20px rgba(0, 0, 0, 0.65);
      --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 36px -22px rgba(0, 0, 0, 0.6);
    }
  }
  :root[data-theme="light"] {
    --paper: #eceef6; --paper-2: #f4f5fb; --surface: #ffffff; --ink: #1a1c2e;
    --muted: #585c74; --line: rgba(26, 28, 46, 0.10); --dot: rgba(77, 118, 232, 0.20);
    --indigo: #4d76e8; --indigo-bright: #6ca2ff; --teal: #17a9a0;
    --shadow-tile: 0 22px 44px -18px rgba(34, 36, 60, 0.45);
    --shadow-card: 0 1px 2px rgba(26, 28, 46, 0.05), 0 14px 30px -20px rgba(34, 36, 60, 0.35);
  }
  :root[data-theme="dark"] {
    --paper: #121428; --paper-2: #171a31; --surface: #1c1f39; --ink: #eef0fb;
    --muted: #a4a8c8; --line: rgba(255, 255, 255, 0.10); --dot: rgba(140, 162, 255, 0.16);
    --indigo: #7ba3ff; --indigo-bright: #9dbcff; --teal: #3fcabf;
    --shadow-tile: 0 26px 50px -20px rgba(0, 0, 0, 0.65);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 36px -22px rgba(0, 0, 0, 0.6);
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(var(--dot) 1.4px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: -12px -12px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  .mono {
    font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  }

  .wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

  /* ---------- Hero ---------- */
  .hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
    max-width: 1040px;
    margin: 0 auto;
    padding: clamp(48px, 8vw, 96px) 24px clamp(56px, 8vw, 88px);
  }
  .hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--indigo);
    margin: 0 0 20px;
  }
  .hero__eyebrow::before {
    content: "";
    width: 22px; height: 1px;
    background: var(--indigo);
    opacity: 0.6;
  }
  .hero__title {
    margin: 0 0 18px;
    font-size: clamp(2.3rem, 5.4vw, 3.6rem);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }
  .hero__title em {
    font-style: normal;
    color: var(--indigo);
  }
  .hero__tagline {
    margin: 0 0 32px;
    max-width: 40ch;
    font-size: 1.1rem;
    color: var(--muted);
  }
  .hero__cta { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
  .hero__req {
    margin: 20px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
  }
  .hero__req strong { color: var(--ink); font-weight: 600; }

  /* Offizielles Apple-Badge: unverändert einbinden, nur Höhe festlegen
     (Apple-Richtlinie: keine eigene Gestaltung, kein Umfärben). */
  .storebadge { display: inline-block; line-height: 0; border-radius: 9px; }
  .storebadge img { height: 54px; width: auto; }
  .storebadge:focus-visible { outline: 3px solid var(--indigo-bright); outline-offset: 3px; }

  .ghostlink {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1.5px solid var(--line);
    padding-bottom: 2px;
    transition: border-color 0.14s ease;
  }
  .ghostlink:hover { border-color: var(--indigo); }

  /* ---------- Moodboard cluster ---------- */
  .board {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 420px;
    justify-self: center;
  }
  .tile {
    position: absolute;
    border-radius: 16px;
    box-shadow: var(--shadow-tile);
    background: var(--surface);
    border: 1px solid var(--line);
    animation: settle 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
  .tile::after { /* Pin */
    content: "";
    position: absolute;
    top: -6px; left: 50%;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff6, transparent 60%), var(--indigo);
    box-shadow: 0 2px 5px rgba(0,0,0,0.35);
    transform: translateX(-50%);
  }
  .tile--icon {
    top: 8%; left: 30%;
    width: 46%;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    animation-delay: 0.05s;
    z-index: 4;
  }
  .tile--icon::after { display: none; }
  .tile--icon img {
    width: 100%; height: auto; display: block;
    border-radius: 26%;
    box-shadow: 0 26px 50px -16px rgba(34, 36, 60, 0.55);
  }
  .tile--photo {
    top: 40%; left: 4%;
    width: 42%; aspect-ratio: 4 / 5;
    background: linear-gradient(150deg, var(--night-1), var(--night-2) 55%, #101226);
    transform: rotate(-6deg);
    animation-delay: 0.16s;
    overflow: hidden;
    z-index: 3;
  }
  .tile--photo::before { /* Duoton-Lichtreflex */
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(120% 80% at 20% 10%, color-mix(in srgb, var(--teal) 55%, transparent), transparent 60%);
  }
  .tile--swatch {
    bottom: 6%; left: 34%;
    width: 40%;
    padding: 12px;
    display: flex;
    gap: 7px;
    transform: rotate(4deg);
    animation-delay: 0.28s;
    z-index: 3;
  }
  .tile--swatch span { flex: 1; aspect-ratio: 1; border-radius: 6px; }
  .tile--note {
    top: 12%; right: 0;
    width: 40%;
    padding: 13px 14px;
    transform: rotate(5deg);
    animation-delay: 0.4s;
    z-index: 2;
  }
  .tile--note .k {
    font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted); display: block; margin-bottom: 6px;
  }
  .tile--note .m { font-size: 0.92rem; font-weight: 600; line-height: 1.45; }
  .tile--note .m span { color: var(--indigo); }

  @keyframes settle {
    from { opacity: 0; transform: translateY(26px) rotate(var(--r, 0deg)) scale(0.96); }
  }
  .tile--photo { --r: -6deg; }
  .tile--swatch { --r: 4deg; }
  .tile--note { --r: 5deg; }

  /* ---------- Features ---------- */
  .section-head {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 24px 0;
  }
  .section-head .hero__eyebrow { margin-bottom: 12px; }
  .section-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  .features {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 24px 72px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
  }
  .feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  }
  .feature:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--indigo) 40%, var(--line));
    box-shadow: 0 1px 2px rgba(26,28,46,0.05), 0 22px 42px -22px color-mix(in srgb, var(--indigo) 55%, transparent);
  }
  .feature__icon {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 11px;
    background: color-mix(in srgb, var(--indigo) 12%, var(--surface));
    color: var(--indigo);
    margin-bottom: 15px;
  }
  .feature__icon svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .feature h3 { margin: 0 0 7px; font-size: 1.05rem; font-weight: 650; }
  .feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }
  .feature code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: color-mix(in srgb, var(--indigo) 10%, transparent);
    color: var(--indigo);
    padding: 1px 6px; border-radius: 5px; font-size: 0.85em;
  }

  /* ---------- Release Notes (releasenotes.html) ---------- */
  .page-head {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(40px, 7vw, 76px) 24px 8px;
  }
  .backlink {
    display: inline-block;
    margin-bottom: 26px;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.14s ease;
  }
  .backlink:hover { color: var(--indigo); }
  /* Der Seitentitel ist die Eyebrow-Zeile selbst — als <h1>, damit die Seite eine
     Dokument-Überschrift hat, optisch aber identisch zur Eyebrow bleibt. */
  .page-head h1.hero__eyebrow { font-weight: 500; margin-bottom: 0; }

  .releases {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 24px 72px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .release {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px clamp(20px, 4vw, 34px) 30px;
    box-shadow: var(--shadow-card);
    scroll-margin-top: 24px;
  }
  .release__head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 18px;
  }
  .release__head h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.01em;
  }
  .release__meta {
    margin: 6px 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  /* Die neueste Version (erste Karte) wird dezent hervorgehoben. */
  .release:first-child { border-color: color-mix(in srgb, var(--indigo) 38%, var(--line)); }
  .release:first-child .release__meta { color: var(--indigo); }

  .release h3 {
    margin: 26px 0 8px;
    font-size: 1.05rem;
    font-weight: 650;
  }
  .release h3:first-of-type { margin-top: 0; }
  .release p { margin: 0 0 12px; color: var(--muted); }
  .release p strong, .release li strong { color: var(--ink); font-weight: 600; }
  .release ul, .release ol { margin: 0 0 12px; padding-left: 22px; color: var(--muted); }
  .release li { margin-bottom: 7px; }
  .release li::marker { color: var(--indigo); }
  .release a { color: var(--indigo); overflow-wrap: anywhere; }
  .release hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0 16px;
  }
  .release code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: color-mix(in srgb, var(--indigo) 10%, transparent);
    color: var(--indigo);
    padding: 1px 6px; border-radius: 5px; font-size: 0.85em;
  }

  /* ---------- Footer ---------- */
  .footer {
    border-top: 1px solid var(--line);
    text-align: center;
    padding: 36px 24px 52px;
    color: var(--muted);
    font-size: 0.9rem;
  }
  .footer__brand {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.14s ease;
  }
  .footer__brand span { color: var(--indigo); font-weight: 600; }
  .footer__brand:hover { color: var(--ink); }
  .footer__brand:hover span { color: var(--indigo-bright); }
  .footer__copy { margin: 0; opacity: 0.8; }
  .footer__legal {
    margin: 10px 0 0;
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.82rem;
  }
  .footer__legal a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.14s ease;
  }
  .footer__legal a:hover { color: var(--ink); }

  @media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; gap: 12px; text-align: left; padding-top: 40px; }
    .board { max-width: 360px; margin-top: 16px; grid-row: 2; }
    .hero__copy { grid-row: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tile { animation: none; }
    .feature { transition: none; }
  }
