/* Kellerbuch – kellerbuch.app
   Richtung „Gewölbe“: Bordeaux-Kopf mit drei Bögen, ruhige Creme-Abschnitte.
   Farben und Schriften aus dem Leitentwurf (vorlagen/kellerbuch-v4-*.png). */

/* ---------- Schriften (selbst ausgeliefert, kein Abruf bei Dritten) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

/* ---------- Farben ---------- */
:root {
  color-scheme: light dark;
  --bordeaux: #5A0F28;
  --bordeaux-hell: #7A1D3B;
  --creme: #F5EFE6;
  --oliv: #6B7F62;

  --grund: #F5EFE6;
  --flaeche: #FBF8F3;
  --nische: #EADFD0;
  --tinte: #2A1A1C;
  --leise: #6A5D55;
  --linie: rgba(42, 26, 28, .14);
  --verweis: #5A0F28;
  --balken-frueh: #D9A79E;
  --balken-reif: #6B7F62;
  --balken-drueber: #CDB27A;
  --geraet: #171012;
  --schatten: rgba(20, 8, 12, .45);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1C1416;
    --flaeche: #261C1E;
    --nische: #2E2124;
    --tinte: #F5EFE6;
    --leise: #B8A9A1;
    --linie: rgba(245, 239, 230, .14);
    --verweis: #E9AEBB;
    --balken-frueh: #A8706C;
    --balken-reif: #8DA283;
    --balken-drueber: #B39A62;
    --geraet: #0E090A;
    --schatten: rgba(0, 0, 0, .6);
  }
}

/* ---------- Grundlage ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--grund);
  color: var(--tinte);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: .25em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 2rem; }

.rahmen { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
@media (min-width: 48rem) { .rahmen { width: min(100% - 5rem, 70rem); } }

.sprung {
  position: absolute; left: 1rem; top: -5rem; z-index: 10;
  background: var(--creme); color: var(--bordeaux);
  padding: .6rem 1rem; border-radius: .5rem; font-weight: 500;
}
.sprung:focus { top: 1rem; }

/* ---------- Gerät: schlichter Rahmen um eine App-Ansicht ---------- */
.geraet {
  --b: 14rem;
  flex: none;
  width: var(--b);
  border: calc(var(--b) * .03) solid var(--geraet);
  border-radius: calc(var(--b) * .165);
  background: var(--geraet);
  overflow: hidden;
  box-shadow: 0 1.5rem 3rem -1rem var(--schatten);
}
.geraet img { width: 100%; border-radius: calc(var(--b) * .135); }

/* ---------- Bogen: Nische, in der ein Gerät steht ----------
   Das Gerät richtet sich nach der Breite des Bogens (cqw), damit es bei jeder
   Bildschirmbreite gleich in der Rundung sitzt und unten angeschnitten ist. */
.bogen {
  container-type: inline-size;
  display: flex; justify-content: center; align-items: flex-start;
  border-radius: 50rem 50rem 0 0;
  overflow: hidden;
}
.bogen .geraet { margin-top: 4.5rem; margin-bottom: -7rem; }
@supports (width: 1cqw) {
  .bogen .geraet { --b: 66cqw; margin-top: 20cqw; margin-bottom: calc(var(--b) * -.5); }
}

/* ---------- Leiste und Kopf ---------- */
.band, .kopf { background: var(--bordeaux); color: var(--creme); }
.leiste { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: .8rem; }
.marke {
  display: inline-flex; align-items: center; gap: .7rem; padding-block: .45rem;
  font: 600 1.375rem/1 var(--serif); letter-spacing: -.01em; text-decoration: none;
}
.marke img { width: 2.1rem; }
.leiste nav { display: flex; gap: clamp(1.1rem, 3vw, 2rem); font-size: .9375rem; }
.leiste nav a { text-decoration: none; padding-block: .65rem; color: rgba(245, 239, 230, .88); }
.leiste nav a:hover, .leiste nav a[aria-current] { color: var(--creme); text-decoration: underline; text-underline-offset: .35em; }
@media (max-width: 33.99rem) { .leiste nav a.ab-breit { display: none; } }
@media (max-width: 29.99rem) {
  .leiste { gap: 1rem; }
  .marke { font-size: 1.25rem; gap: .5rem; }
  .marke img { width: 1.9rem; }
}
@media (max-width: 21.9rem) { .leiste nav a.ab-schmal { display: none; } }

.kopf { overflow: hidden; }
.kopf-text { text-align: center; padding-top: clamp(1.75rem, 5vw, 4rem); }
.kopf h1 {
  font: italic 400 clamp(2.75rem, 8.2vw, 6.25rem)/1.02 var(--serif);
  font-variation-settings: "opsz" 144;
  letter-spacing: -.02em;
}
.kopf-text p {
  max-width: 34rem; margin: 1.6rem auto 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: rgba(245, 239, 230, .88);
  text-wrap: balance;
}
.kopf-text .bald { margin-top: 1.5rem; font-size: .9375rem; font-weight: 500; color: var(--creme); }

.arkade { display: grid; justify-items: center; margin-top: clamp(2.5rem, 4.5vw, 3.5rem); }
.arkade .bogen { background: var(--bordeaux-hell); width: min(100%, 21rem); }
.arkade .bogen.seite { display: none; }
@supports (width: 1cqw) { .arkade .geraet { margin-bottom: calc(var(--b) * -.7); } }
@media (min-width: 44rem) {
  .arkade { grid-template-columns: 1fr 1.16fr 1fr; gap: clamp(1.25rem, 2.6vw, 2.25rem); align-items: end; }
  .arkade .bogen { width: 100%; }
  .arkade .bogen.seite { display: flex; }
}

/* ---------- Funktionen ---------- */
.funktionen { padding-block: clamp(4rem, 9vw, 7.5rem); display: grid; gap: clamp(4.5rem, 9vw, 7.5rem); }
.zeile { display: grid; gap: 2.5rem; align-items: center; }
.zeile h2, .vertrauen h2 { font: 600 clamp(1.875rem, 3.6vw, 2.75rem)/1.12 var(--serif); letter-spacing: -.015em; }
.zeile .wort > p { margin-top: 1.1rem; max-width: 30rem; font-size: 1.125rem; color: var(--leise); }
.zeile p strong { color: var(--tinte); font-weight: 500; }

.zeile .bogen { background: var(--nische); width: min(100%, 24rem); margin-inline: auto; }
.zeile .bogen.doppelt .geraet + .geraet { display: none; }
@media (min-width: 44rem) {
  .zeile { grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 5vw, 4rem); }
  .zeile:nth-child(even) .wort { order: 2; }
  .zeile .bogen.doppelt { width: min(100%, 31rem); }
  .zeile .bogen.doppelt .geraet + .geraet { display: block; margin-left: 1rem; margin-top: 7rem; }
  @supports (width: 1cqw) {
    .zeile .bogen.doppelt .geraet { --b: 40cqw; margin-top: 25cqw; }
    .zeile .bogen.doppelt .geraet + .geraet { margin-left: 4cqw; margin-top: 34cqw; }
  }
}

/* Trinkreife: drei Beispiele mit dem Balken aus der App */
.reife { margin: 2rem 0 0; padding: 0; list-style: none; max-width: 30rem; }
.reife li { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: baseline; padding-block: .95rem; border-top: 1px solid var(--linie); }
.reife li:last-child { border-bottom: 1px solid var(--linie); }
.reife .wein { font: 600 1.125rem/1.25 var(--serif); }
.reife .wein span { font: 400 .9375rem/1 var(--sans); color: var(--leise); margin-left: .35rem; }
.reife .stand { font-size: .9375rem; font-weight: 500; }
.reife .balken {
  grid-column: 1 / -1; position: relative;
  display: grid; grid-template-columns: var(--frueh) var(--reif) var(--drueber);
  height: .5rem; border-radius: 1rem; margin-top: .15rem;
}
.reife .balken i:nth-child(1) { background: var(--balken-frueh); border-radius: 1rem 0 0 1rem; }
.reife .balken i:nth-child(2) { background: var(--balken-reif); }
.reife .balken i:nth-child(3) { background: var(--balken-drueber); border-radius: 0 1rem 1rem 0; }
/* Marke für „heute“ */
.reife .balken b {
  position: absolute; top: 50%; left: var(--heute);
  width: 1rem; height: 1rem; margin: -.5rem 0 0 -.5rem;
  border-radius: 50%; background: var(--tinte); border: .1875rem solid var(--grund);
}
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .9rem 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--leise); }
.legende li { display: inline-flex; align-items: center; gap: .45rem; }
.legende li::before { content: ""; width: 1.1rem; height: .5rem; border-radius: 1rem; background: var(--farbe); }
.legende li.heute::before { width: .625rem; height: .625rem; border-radius: 50%; background: var(--tinte); }

/* ---------- Deine Daten ---------- */
.vertrauen { background: var(--flaeche); border-block: 1px solid var(--linie); padding-block: clamp(4rem, 8vw, 6.5rem); }
.vertrauen h2 { max-width: 22ch; }
.drei { display: grid; gap: 2rem; margin-top: 2.75rem; }
@media (min-width: 52rem) { .drei { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }
.drei h3 { font: 600 1.25rem/1.25 var(--serif); }
.drei p { margin-top: .5rem; color: var(--leise); max-width: 34rem; }
.drei a { color: var(--verweis); }

/* ---------- Schluss ---------- */
.schluss { text-align: center; padding-block: clamp(4rem, 8vw, 6.5rem); }
.schluss img { width: 5rem; border-radius: 22.5%; margin-inline: auto; }
.schluss h2 { margin-top: 1.5rem; font: italic 400 clamp(2rem, 4.4vw, 3.25rem)/1.1 var(--serif); font-variation-settings: "opsz" 144; }
.schluss p { margin-top: .9rem; color: var(--leise); }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--linie); padding-block: 2.25rem 2.75rem; font-size: .9375rem; color: var(--leise); }
.fuss .rahmen { display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; justify-content: space-between; }
.fuss nav { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }
.fuss a { display: inline-block; padding-block: .65rem; }
.fuss a:hover, .fuss a[aria-current] { color: var(--tinte); }
.fuss .name { font: 600 1.125rem/1 var(--serif); color: var(--tinte); }

/* ---------- Unterseiten (Datenschutz, Support) ---------- */
.text { padding-block: clamp(3rem, 7vw, 5.5rem); max-width: 40rem; }
.text h1 { font: 600 clamp(2.25rem, 5vw, 3.25rem)/1.1 var(--serif); letter-spacing: -.02em; }
.text h2 { margin-top: 2.75rem; font: 600 1.5rem/1.2 var(--serif); }
.text p, .text ul { margin-top: 1rem; color: var(--leise); }
.text .stand { margin-top: .75rem; font-size: .9375rem; }
.text address { margin-top: 1rem; font-style: normal; color: var(--tinte); }
.text a { overflow-wrap: anywhere; }
.text a { color: var(--verweis); }
.text .folgt { margin-top: 2rem; padding: 1.25rem 1.5rem; border-radius: 1rem; background: var(--flaeche); border: 1px solid var(--linie); color: var(--tinte); }
.text h2 + .folgt { margin-top: 1rem; }
