/* ==========================================================================
   digitaleplaner.de — Themen-Hub "Digitale Planer"
   Nacht-Tablet: dunkler Raum, das Licht kommt von der Planerseite.
   ========================================================================== */

/* --------------------------------------------------------------- Tokens -- */
:root {
  /* Farbe: drenched dark, ein Akzent (Marker-Limette) */
  --ink:        oklch(0.155 0.026 264);
  --ink-deep:   oklch(0.118 0.024 264);
  --surface:    oklch(0.215 0.028 264);
  --surface-2:  oklch(0.268 0.030 264);
  --line:       oklch(0.315 0.028 264);
  --line-soft:  oklch(0.255 0.026 264);

  --text:       oklch(0.945 0.008 264);
  --muted:      oklch(0.748 0.017 264);

  --accent:     oklch(0.880 0.198 128);
  --accent-dim: oklch(0.700 0.150 128);
  --paper:      oklch(0.985 0.004 264);

  /* Typografie */
  --display: "Bricolage Grotesque", "Helvetica Neue", Helvetica, sans-serif;
  --body:    Literata, Georgia, "Times New Roman", serif;
  --hand:    Caveat, "Segoe Script", cursive;

  --fs-h1:   clamp(2.5rem, 1.55rem + 3.3vw, 4.35rem);
  --fs-h2:   clamp(1.95rem, 1.35rem + 2.2vw, 3.05rem);
  --fs-lede: clamp(1.12rem, 1.02rem + 0.5vw, 1.4rem);
  --fs-body: clamp(1.03rem, 0.99rem + 0.2vw, 1.13rem);
  --fs-sm:   0.875rem;
  --fs-xs:   0.78rem;

  /* Raum */
  --pad:  clamp(1.25rem, 5vw, 4.5rem);
  --maxw: 78rem;
  --sect: clamp(4.5rem, 9vw, 9rem);

  /* Ebenen */
  --z-art: 1;
  --z-content: 2;
  --z-head: 40;
  --z-grain: 60;

  /* Bewegung */
  --out: cubic-bezier(0.19, 1, 0.22, 1);       /* ease-out-expo */
  --out-q: cubic-bezier(0.25, 1, 0.30, 1);     /* ease-out-quart */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* clip statt hidden: kappt den überstehenden Glow, ohne einen
     Scroll-Container zu erzeugen, der position:sticky im Kopf aushebeln würde */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, b, strong,
.btn, .site-nav, .wordmark, .link-host, .link-title, .hero__apps, .note {
  font-family: var(--display);
}

h1, h2 {
  margin: 0;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-wrap: balance;
  /* Deutsche Komposita brechen sonst aus jeder Spalte aus */
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }

p { text-wrap: pretty; }

a { color: inherit; }

img, svg { max-width: 100%; }

::selection { background: var(--accent); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

[id] { scroll-margin-top: 6rem; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--accent);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Körnung: der Raum ist nicht steril */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- Kopf ---- */
.site-head {
  position: sticky;
  top: 0;
  z-index: var(--z-head);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem var(--pad);
  background: color-mix(in oklab, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.wordmark {
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark em {
  font-style: normal;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s var(--out-q);
}
.site-nav a:hover { color: var(--text); }

@media (max-width: 620px) {
  .site-nav a:nth-child(3) { display: none; }
}

/* --------------------------------------------------------------- Buttons - */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.35s var(--out), background-color 0.25s var(--out-q),
              border-color 0.25s var(--out-q), color 0.25s var(--out-q);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--solid { background: var(--accent); color: var(--ink); }
.btn--solid:hover { background: oklch(0.92 0.20 128); }

.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--dark { background: var(--ink); color: var(--text); }
.btn--dark:hover { background: var(--ink-deep); }

/* --------------------------------------------------------------- Hero ---- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6.5rem) var(--pad) clamp(3.5rem, 8vw, 7rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.hero h1 { max-width: 14ch; }

.lede {
  max-width: 46ch;
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: oklch(0.885 0.012 264);
  margin: 1.6rem 0 0;
}

.hero__apps {
  margin: 1.5rem 0 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.hero__apps b { color: var(--accent); font-weight: 600; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* Die leuchtende Seite */
.hero__art {
  position: relative;
  z-index: var(--z-art);
  margin: 0;
  perspective: 1500px;
}

.glow {
  position: absolute;
  inset: -20% -9% -10%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(44% 38% at 47% 44%, oklch(0.98 0.07 116 / 0.46), transparent 68%),
    radial-gradient(74% 66% at 55% 56%, oklch(0.70 0.15 252 / 0.44), transparent 74%);
  filter: blur(52px);
  animation: breathe 11s var(--out-q) infinite alternate;
}

@keyframes breathe {
  from { opacity: 0.75; transform: scale(0.97); }
  to   { opacity: 1;    transform: scale(1.04); }
}

.spread {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  transform: rotateX(7deg) rotateZ(-2.2deg);
  filter:
    drop-shadow(0 2px 3px oklch(0 0 0 / 0.4))
    drop-shadow(0 34px 60px oklch(0 0 0 / 0.55));
  transition: transform 0.9s var(--out);
}
.hero__art:hover .spread { transform: rotateX(3deg) rotateZ(-0.8deg); }

.hero__art figcaption {
  margin-top: 1.75rem;
  max-width: 34ch;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

@media (min-width: 62rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 3.5rem);
  }
  .hero__art { margin-right: calc(var(--pad) * -0.7); }
}

/* Gestapelt darf die Seite etwas breiter laufen und flacher liegen,
   sonst verliert die Handschrift auf dem Telefon jede Lesbarkeit. */
@media (max-width: 46rem) {
  .hero__art { margin-inline: calc(var(--pad) * -0.6); }
  .spread { transform: rotateX(3deg) rotateZ(-1.2deg); }
  .hero__art figcaption { margin-inline: calc(var(--pad) * 0.6); }
}

/* Einblenden beim Laden. Ohne Animation bleibt alles sichtbar. */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
}
@keyframes riseArt {
  from { opacity: 0; transform: translateY(30px) rotateX(14deg) rotateZ(-4deg) scale(0.97); }
}

.hero h1            { animation: rise 0.9s var(--out) 0.05s backwards; }
.hero .lede         { animation: rise 0.9s var(--out) 0.16s backwards; }
.hero .hero__apps   { animation: rise 0.9s var(--out) 0.24s backwards; }
.hero__actions      { animation: rise 0.9s var(--out) 0.32s backwards; }
.spread             { animation: riseArt 1.25s var(--out) 0.2s backwards; }
.hero__art figcaption { animation: rise 0.9s var(--out) 0.6s backwards; }

/* Handschrift schreibt sich, wenn die Seite geladen ist */
.spread .ink text {
  animation: inkIn 0.5s var(--out-q) backwards;
}
.spread .ink text:nth-child(1) { animation-delay: 0.85s; }
.spread .ink text:nth-child(2) { animation-delay: 0.95s; }
.spread .ink text:nth-child(3) { animation-delay: 1.05s; }
.spread .ink text:nth-child(4) { animation-delay: 1.15s; }
.spread .ink text:nth-child(5) { animation-delay: 1.22s; }
.spread .ink text:nth-child(6) { animation-delay: 1.32s; }
.spread .ink text:nth-child(7) { animation-delay: 1.42s; }
.spread .ink text:nth-child(8) { animation-delay: 1.52s; }
@keyframes inkIn { from { opacity: 0; } }

.spread .marker {
  transform-box: fill-box;
  transform-origin: left center;
  animation: swipe 0.55s var(--out) 1.6s backwards;
}
@keyframes swipe { from { transform: scaleX(0); } }

/* --------------------------------------------------------------- Links --- */
.links {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--pad) var(--sect);
}

.section-head {
  display: grid;
  gap: 0.9rem;
  max-width: 52ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.linklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.linklist a {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "sw body host arrow";
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  padding: clamp(1.4rem, 2.6vw, 2rem) clamp(0.75rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  transition: background-color 0.3s var(--out-q), padding-left 0.4s var(--out);
}
.linklist a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.55s var(--out);
}
.linklist a:hover,
.linklist a:focus-visible {
  background: var(--surface);
}
.linklist a:hover::after,
.linklist a:focus-visible::after { width: 100%; }

.swatch {
  grid-area: sw;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 12px;
  background: var(--surface-2);
  transition: background-color 0.3s var(--out-q);
}
.swatch svg { width: 1.75rem; height: 1.75rem; }
.s-fill    { fill: var(--muted); transition: fill 0.3s var(--out-q); }
.s-tab     { fill: var(--accent-dim); transition: fill 0.3s var(--out-q); }
.s-outline { fill: none; stroke: var(--muted); stroke-width: 2.5; transition: stroke 0.3s var(--out-q); }
.s-line    { stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.s-stroke  { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; transition: stroke 0.3s var(--out-q); }
.s-stroke2 { fill: none; stroke: var(--accent-dim); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s var(--out-q); }

.linklist a:hover .swatch,
.linklist a:focus-visible .swatch { background: oklch(0.32 0.032 264); }
.linklist a:hover .s-fill,
.linklist a:focus-visible .s-fill { fill: var(--accent); }
.linklist a:hover .s-tab,
.linklist a:focus-visible .s-tab  { fill: var(--paper); }
.linklist a:hover .s-outline,
.linklist a:focus-visible .s-outline { stroke: var(--accent); }
.linklist a:hover .s-stroke,
.linklist a:focus-visible .s-stroke { stroke: var(--accent); }
.linklist a:hover .s-stroke2,
.linklist a:focus-visible .s-stroke2 { stroke: var(--paper); }

.link-body {
  grid-area: body;
  display: grid;
  gap: 0.3rem;
}
.link-title {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
}
.link-desc {
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.5;
  max-width: 52ch;
}

.link-host {
  grid-area: host;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.arrow {
  grid-area: arrow;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--muted);
  transition: transform 0.45s var(--out), color 0.3s var(--out-q);
}
.arrow svg { width: 1.4rem; height: 1.4rem; }
.linklist a:hover .arrow,
.linklist a:focus-visible .arrow {
  transform: translateX(6px);
  color: var(--accent);
}

.note {
  margin: 1.75rem 0 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 46rem) {
  .linklist a {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "sw body arrow"
      ".  host arrow";
    row-gap: 0.5rem;
  }
  .arrow { align-self: center; }
}

/* Auf dem Telefon reicht die Breite nicht für Swatch, Text und Pfeil
   nebeneinander: Marke und Domain wandern in eine Kopfzeile, der Text
   bekommt die volle Spalte. */
@media (max-width: 34rem) {
  .linklist a {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "sw   host arrow"
      "body body body";
    align-items: center;
    column-gap: 0.85rem;
    row-gap: 0.9rem;
    padding-inline: 0;
  }
  .swatch { width: 2.5rem; height: 2.5rem; border-radius: 10px; }
  .swatch svg { width: 1.35rem; height: 1.35rem; }
  .link-host { justify-self: start; }
}

/* --------------------------------------------------------------- Warum --- */
.why {
  background: var(--ink-deep);
  border-block: 1px solid var(--line-soft);
  padding: var(--sect) var(--pad);
}

.why__inner {
  max-width: var(--maxw);
  margin-inline: auto;
}

.why h2 {
  max-width: 16ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.prose {
  max-width: 62ch;
  font-size: clamp(1.06rem, 1rem + 0.35vw, 1.24rem);
  line-height: 1.72;
  color: oklch(0.895 0.010 264);
}
.prose p { margin: 0 0 1.5em; }
.prose .para { position: relative; }

.marginnote {
  position: relative;
  font-family: var(--hand);
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--accent);
  margin: -0.5rem 0 1.6rem;
  padding-left: 2.75rem;
}
/* Dieselbe Anschlusslinie wie in der Randspalte, nur waagerecht davor */
.marginnote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.9rem;
  height: 1px;
  background: var(--accent-dim);
}

/* Ab hier ist rechts neben der Textspalte Platz für die Notizen am Rand.
   Positioniert über 100 % der Textspalte, nicht über ch: die Notiz ist in
   Caveat gesetzt, ihr ch-Wert hat mit der Fließschrift nichts zu tun. */
@media (min-width: 78rem) {
  .marginnote {
    position: absolute;
    top: 0.2rem;
    left: calc(100% + 4.25rem);
    width: 14rem;
    margin: 0;
    padding-left: 0;
    transform: rotate(-1.6deg);
  }
  .marginnote::before {
    top: 0.9rem;
    left: -3.25rem;
    width: 2.25rem;
  }
}

/* --------------------------------------------------- Was du brauchst ----- */
.kit {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--sect) var(--pad);
}

.kit h2 {
  max-width: 14ch;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.checklist li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.1rem;
  align-items: baseline;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid var(--line-soft);
}
.checklist b {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.checklist span:not(.tick) {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 58ch;
}
.tick {
  grid-row: 1 / span 2;
  align-self: start;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.15rem;
  color: var(--accent);
}
.tick svg { width: 1.15rem; height: 1.15rem; }

@media (min-width: 56rem) {
  .checklist li {
    grid-template-columns: auto 13rem 1fr;
    gap: 1.25rem;
    align-items: baseline;
  }
  .checklist span:not(.tick) { grid-column: 3; }
  .tick { grid-row: 1; }
}

/* --------------------------------------------------------------- CTA ----- */
.cta {
  background: var(--accent);
  color: var(--ink);
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--pad);
}
.cta__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}
.cta h2 {
  max-width: 14ch;
  color: var(--ink);
}
.cta p {
  margin: 0;
  max-width: 44ch;
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: oklch(0.32 0.09 128);
}
.cta .btn { margin-top: 1rem; }

/* --------------------------------------------------------------- Fuß ----- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 2.5rem var(--pad) 3.5rem;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--display);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.site-foot nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--out-q);
}
.site-foot nav a:hover { color: var(--accent); }
.site-foot nav a[aria-current="page"] { color: var(--text); }

/* --------------------------------------------------------- Rechtstext --- */
/* Impressum und Datenschutz: gleiche Bühne, ruhiger gespielt.
   Ein Dokument zum Nachschlagen, keine Landingpage. */
.legal { padding: clamp(3rem, 7vw, 5.5rem) var(--pad) var(--sect); }

.legal__inner {
  max-width: 64ch;
  margin-inline: auto;
}

.legal h1 {
  font-size: clamp(2.25rem, 1.65rem + 2.2vw, 3.4rem);
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.legal h2 {
  font-size: clamp(1.28rem, 1.15rem + 0.55vw, 1.6rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
}

.legal h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--accent);
}

.legal p,
.legal address,
.legal ul {
  margin: 0.9rem 0 0;
  color: oklch(0.885 0.010 264);
  line-height: 1.72;
}
.legal address { font-style: normal; }

.legal ul { padding-left: 1.3rem; }
.legal li { margin-bottom: 0.35rem; }
.legal li::marker { color: var(--accent-dim); }

/* Die Entwarnung gleich oben: kein Banner, keine Cookies, kein Tracking */
.legal__lead {
  margin-top: 0;
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.28rem);
  line-height: 1.62;
  color: var(--text);
}

.legal a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--out-q);
}
.legal a:hover { color: var(--text); }

.legal__source {
  margin-top: 2.75rem;
  font-family: var(--display);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.legal__source a { color: var(--muted); }

/* --------------------------------------------------- Reduzierte Bewegung - */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spread { transform: none; }
  .hero__art:hover .spread { transform: none; }
  .btn:hover { transform: none; }
}
