/* LeafLog – Erscheinungsbild der Website.
   Aufbau: dunkler Kopf mit Dampf, danach wechseln helle Nebel-Abschnitte und dunkle Maduro-Bänder.
   Alle Farben stammen aus der Logo-Palette oder sind Abstufungen davon. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* auf hellem Grund */
  --kupfer: #A8592C;
  --wasser: #2C7B8E;
  --tinte: #2A1A12;
  --grund: #EDF1F0;
  /* auf dunklem Grund */
  --kupfer-hell: #D69259;
  --wasser-hell: #8FCFDA;
  --tinte-hell: #F2E9DC;
  --maduro: #24160F;
  /* Abstufungen */
  --kupfer-tief: #96491F;
  --wasser-tief: #23687A;
  --tinte-leise: #5B4A40;
  --maduro-tief: #1B100B;
  --maduro-warm: #2B1B13;
  --nebel-hell: #F7F9F8;
  --linie: rgba(42, 26, 18, 0.16);
  --linie-hell: rgba(242, 233, 220, 0.2);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --rand: max(1rem, env(safe-area-inset-left, 0px));
  --breite: 70rem;
  --abstand: clamp(4rem, 9vw, 7.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100;
  font-weight: 520;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6.2vw, 4.5rem); line-height: 1.04; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.005em; }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }

a { color: var(--wasser-tief); text-underline-offset: 0.18em; }
a:hover { color: var(--kupfer-tief); }
.on-dark a { color: var(--wasser-hell); }
.on-dark a:hover { color: var(--tinte-hell); }

:focus-visible { outline: 3px solid var(--wasser); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--wasser-hell); }

.wrap {
  width: 100%;
  max-width: var(--breite);
  margin-inline: auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.on-dark { background: var(--maduro); color: var(--tinte-hell); }

/* ---------- Knopf ---------- */
.btn {
  --btn-bg: var(--kupfer-tief);
  --btn-fg: var(--tinte-hell);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
a.btn, a.btn:hover, .on-dark a.btn, .on-dark a.btn:hover { color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: progress; }
.on-dark .btn { --btn-bg: var(--kupfer-hell); --btn-fg: var(--maduro); }
.btn--ghost,
.on-dark .btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--tinte-hell);
  min-height: 2.6rem;
  padding: 0.4rem 1.1rem;
  border: 1.5px solid rgba(242, 233, 220, 0.55);
}
.btn--ghost:hover { border-color: var(--tinte-hell); }

/* ---------- Kopf ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Standbild des Dampfs: bleibt immer liegen, auch ohne JavaScript oder WebGL */
  background:
    radial-gradient(120% 70% at 78% 108%, rgba(143, 207, 218, 0.24), transparent 60%),
    radial-gradient(90% 60% at 28% 116%, rgba(242, 233, 220, 0.13), transparent 62%),
    linear-gradient(180deg, var(--maduro-tief) 0%, var(--maduro) 55%, var(--maduro-warm) 100%);
}
.hero__steam {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  opacity: 0;
}
/* blendet weich über das Standbild, sobald der Dampf gezeichnet ist */
.hero__steam[data-steam-state] { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .hero__steam { transition: opacity 1.4s ease; }
}
/* dunkelt den Dampf hinter dem Text ab, damit er lesbar bleibt */
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(27, 16, 11, 0.86) 0%, rgba(27, 16, 11, 0.62) 42%, rgba(27, 16, 11, 0) 74%),
    linear-gradient(180deg, rgba(27, 16, 11, 0.7) 0%, rgba(27, 16, 11, 0) 22%);
}
.hero__droplets { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.site-header__logo { display: block; flex: none; border-radius: 6px; }
.site-header__logo img { height: 2.75rem; width: auto; }

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3.5rem, 9vw, 7rem);
}
.hero__text { display: grid; gap: 1.5rem; max-width: 37rem; }
.lead { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.5; color: rgba(242, 233, 220, 0.9); }
.hero__note { font-size: 0.9375rem; color: rgba(242, 233, 220, 0.74); max-width: 32rem; }
.hero__dial { width: min(15rem, 62vw); justify-self: center; }

@media (min-width: 56rem) {
  .hero__content { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 3rem; }
  .hero__dial { width: min(100%, 23rem); justify-self: end; }
}

/* Hygrometer */
.dial__ring { fill: rgba(27, 16, 11, 0.45); stroke: rgba(242, 233, 220, 0.38); stroke-width: 1.5; }
.dial__ticks { fill: none; stroke: rgba(242, 233, 220, 0.8); }
.dial__ticks--fine { stroke: rgba(242, 233, 220, 0.4); }
.dial__band { fill: none; stroke: var(--wasser-hell); stroke-width: 7; }
.dial__num { fill: rgba(242, 233, 220, 0.82); font-family: var(--font-text); font-size: 9px; text-anchor: middle; }
.dial__unit { fill: rgba(242, 233, 220, 0.62); font-family: var(--font-text); font-size: 7.5px; text-anchor: middle; letter-spacing: 0.08em; }
.dial__value { fill: var(--tinte-hell); font-family: var(--font-display); font-size: 21px; font-weight: 500; text-anchor: middle; }
.dial__needle { stroke: var(--kupfer-hell); stroke-width: 2.6; stroke-linecap: round; }
.dial__cap { fill: var(--kupfer-hell); }

/* ---------- Anmeldeformular ---------- */
.signup { display: grid; gap: 0.5rem; max-width: 33rem; }
.signup__label { font-size: 0.9375rem; font-weight: 600; }
.signup__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup__input {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 3rem;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid var(--tinte-leise);
  border-radius: 999px;
  background: var(--nebel-hell);
  color: var(--tinte);
  font: inherit;
}
.signup__input::placeholder { color: var(--tinte-leise); opacity: 0.8; }
.on-dark .signup__input {
  border-color: rgba(242, 233, 220, 0.5);
  background: rgba(27, 16, 11, 0.55);
  color: var(--tinte-hell);
}
.on-dark .signup__input::placeholder { color: rgba(242, 233, 220, 0.62); opacity: 1; }
/* Köderfeld: für Menschen unsichtbar, Programme füllen es aus */
.signup__trap { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.signup__msg { min-height: 1.5em; font-size: 0.9375rem; font-weight: 600; }
.signup__msg:empty { min-height: 0; }
.signup__msg:focus { outline: none; }
.signup__msg.is-ok { color: var(--wasser-tief); }
.signup__msg.is-error { color: var(--kupfer-tief); }
.on-dark .signup__msg.is-ok { color: var(--wasser-hell); }
.on-dark .signup__msg.is-error { color: var(--kupfer-hell); }

/* ---------- Abschnitte ---------- */
.section { padding-block: var(--abstand); }
/* zwei helle Abschnitte hintereinander teilen sich einen Abstand */
.section:not(.on-dark) + .section:not(.on-dark) { padding-top: 0; }
.section__head { display: grid; gap: 1rem; max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__head p { font-size: 1.125rem; color: var(--tinte-leise); }
.on-dark .section__head p { color: rgba(242, 233, 220, 0.82); }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--kupfer-tief); }
.on-dark .eyebrow { color: var(--kupfer-hell); }

/* Warum Feuchte zählt */
.why { display: grid; gap: 2.5rem; }
.why .section__head { margin-bottom: 0; }
@media (min-width: 56rem) {
  .why { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }
}
.scale { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.scale__zone { display: grid; gap: 0.4rem; padding-left: 1.25rem; border-left: 6px solid var(--zone); }
.scale__zone--dry { --zone: var(--kupfer-hell); }
.scale__zone--ideal { --zone: var(--wasser); }
.scale__zone--wet { --zone: var(--wasser-tief); }
.scale__range { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--tinte-leise); }
.scale__zone--ideal .scale__range { color: var(--wasser-tief); }
@media (min-width: 40rem) {
  .scale { grid-template-columns: 1fr 1.25fr 1fr; gap: 1.25rem; }
  .scale__zone { padding: 1.1rem 0 0; border-left: 0; border-top: 8px solid var(--zone); }
}

/* So arbeitet LeafLog */
.steps { display: grid; gap: 2.25rem; margin: 0; padding: 0; list-style: none; counter-reset: schritt; }
.steps li { display: grid; gap: 0.6rem; align-content: start; padding-top: 1.25rem; border-top: 1px solid var(--linie); counter-increment: schritt; }
.steps li::before {
  content: counter(schritt);
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100;
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--kupfer);
}
.steps p { color: var(--tinte-leise); }
@media (min-width: 52rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
}
.aside-note { margin-top: 2.5rem; display: flex; gap: 0.75rem; align-items: baseline; max-width: 40rem; color: var(--tinte-leise); }
.aside-note::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.75rem;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: var(--wasser);
  transform: translateY(0.05rem);
}

/* Die App */
.app { display: grid; gap: 3rem; align-items: center; }
.app__phone { width: min(15.5rem, 70vw); justify-self: center; }
.app .section__head { margin-bottom: 1.75rem; }
.checks { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; max-width: 34rem; }
.checks li { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: baseline; }
.checks li::before {
  content: "";
  width: 0.6rem;
  height: 0.75rem;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: var(--wasser-hell);
}
.checks strong { font-weight: 600; }
.badge {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--linie-hell);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}
@media (min-width: 52rem) {
  .app { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 5rem; }
}
.phone__body { fill: var(--maduro-tief); stroke: rgba(242, 233, 220, 0.4); stroke-width: 2; }
.phone__screen { fill: var(--maduro-warm); }
.phone__label { fill: rgba(242, 233, 220, 0.7); font-family: var(--font-text); font-size: 12px; }
.phone__label--end { text-anchor: end; }
.phone__value { fill: var(--tinte-hell); font-family: var(--font-display); font-size: 62px; font-weight: 480; }
.phone__temp { fill: rgba(242, 233, 220, 0.86); font-family: var(--font-text); font-size: 15px; }
.phone__band { fill: rgba(143, 207, 218, 0.16); }
.phone__grid { stroke: rgba(242, 233, 220, 0.14); stroke-width: 1; }
.phone__curve { fill: none; stroke: var(--wasser-hell); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.phone__track { stroke: rgba(242, 233, 220, 0.25); stroke-width: 4; stroke-linecap: round; }
.phone__track--set { stroke: var(--kupfer-hell); }
.phone__knob { fill: var(--kupfer-hell); }

/* Für jeden Humidor */
.humidors { display: grid; gap: 2.5rem; margin: 0; padding: 0; list-style: none; }
.humidors li { display: grid; gap: 0.5rem; align-content: start; }
.humidors svg { height: 9.5rem; width: auto; margin-bottom: 0.75rem; }
.humidors p { color: var(--tinte-leise); }
.humidors__size { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--kupfer-tief); }
@media (min-width: 48rem) {
  .humidors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.draw { fill: none; stroke: var(--tinte); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.draw--fill { fill: var(--nebel-hell); }
.draw--copper { stroke: var(--kupfer); }
.draw--water { fill: var(--wasser); stroke: none; }
.draw--ground { stroke: var(--linie); stroke-width: 2; }

/* Vormerken */
.join {
  background:
    radial-gradient(90% 120% at 88% 120%, rgba(143, 207, 218, 0.18), transparent 60%),
    linear-gradient(180deg, var(--maduro) 0%, var(--maduro-tief) 100%);
}
.join__grid { display: grid; gap: 2.5rem; }
.join .section__head { margin-bottom: 0; }
.join__form { display: grid; gap: 1.25rem; align-content: start; scroll-margin-top: 2rem; }
.fineprint { font-size: 0.9375rem; color: rgba(242, 233, 220, 0.74); max-width: 33rem; }
@media (min-width: 56rem) {
  .join__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: center; }
}

/* ---------- Fuss ---------- */
.site-footer { background: var(--maduro-tief); color: rgba(242, 233, 220, 0.78); font-size: 0.9375rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; justify-content: space-between; padding-block: 1.75rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--tinte-hell); }
.site-footer a:hover { color: var(--wasser-hell); }
.site-footer :focus-visible { outline-color: var(--wasser-hell); }

/* ---------- Tröpfchen ---------- */
.droplet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: calc(var(--s) * 1.14);
  border-radius: 50% 50% 50% 50% / 44% 44% 56% 56%;
  background:
    radial-gradient(ellipse at 30% 26%, rgba(242, 233, 220, 0.78) 0 8%, rgba(242, 233, 220, 0) 24%),
    radial-gradient(ellipse at 62% 82%, rgba(143, 207, 218, 0.5), rgba(143, 207, 218, 0) 62%),
    rgba(143, 207, 218, 0.1);
  box-shadow:
    inset 0 -1px 2px rgba(242, 233, 220, 0.35),
    inset 0 2px 3px rgba(12, 7, 4, 0.5),
    0 2px 5px rgba(12, 7, 4, 0.45);
}
.droplet--1 { --x: 67%; --y: 17%; --s: 14px; }
.droplet--2 { --x: 91%; --y: 31%; --s: 20px; }
.droplet--3 { --x: 62%; --y: 86%; --s: 9px; }
.droplet--4 { --x: 96%; --y: 68%; --s: 11px; }
.droplet--5 { --x: 83%; --y: 90%; --s: 17px; }
.droplet--6 { --x: 74%; --y: 15%; --s: 8px; }
@media (max-width: 55.99rem) {
  /* schmal: der Text füllt die Breite, Tröpfchen nur im unteren Streifen beim Hygrometer */
  .droplet--1 { --x: 8%; --y: 80%; }
  .droplet--2 { --x: 88%; --y: 76%; --s: 16px; }
  .droplet--3 { --x: 16%; --y: 93%; }
  .droplet--4 { --x: 93%; --y: 90%; }
  .droplet--5 { --x: 5%; --y: 87%; --s: 13px; }
  .droplet--6 { --x: 80%; --y: 95%; }
}

/* ---------- Hinweisseiten (bestätigt, abgemeldet, Fehler) ---------- */
.page-notice { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
.notice { display: grid; gap: 1.25rem; justify-items: start; width: 100%; max-width: 36rem; padding: 3rem max(1rem, env(safe-area-inset-right, 0px)) 4rem max(1rem, env(safe-area-inset-left, 0px)); }
.notice__logo { margin-bottom: 1.5rem; border-radius: 6px; }
.notice__logo img { height: 3.25rem; width: auto; }
.notice h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
.notice p { font-size: 1.125rem; color: var(--tinte-leise); }
.notice strong { color: var(--tinte); overflow-wrap: anywhere; }
.notice form { margin: 0.5rem 0; }

/* ---------- Textseiten (Impressum, Datenschutz) ---------- */
.site-header--light { border-bottom: 1px solid var(--linie); }
.site-header--light .btn--ghost { --btn-fg: var(--tinte); border-color: var(--tinte-leise); }
.prose { max-width: 42rem; padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--abstand); display: grid; gap: 1.1rem; }
.prose h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.prose h2 { font-size: 1.45rem; margin-top: 1.5rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.prose address { font-style: normal; }
.prose .stand { font-size: 0.9375rem; color: var(--tinte-leise); margin-top: 1.5rem; }

/* ---------- Tröpfchen in Bewegung (droplets.js) ---------- */
.droplet--live { animation: droplet-grow var(--grow, 4s) ease-out both; }
.droplet--live.is-holding { animation: droplet-hold var(--hold, 10s) linear both; }
.droplet--live.is-leaving { animation: droplet-leave 2.6s ease-in both; }
.droplet--live.is-running { animation: droplet-run var(--run-time, 2.6s) cubic-bezier(0.55, 0, 0.85, 0.4) both; }
/* Spur eines ablaufenden Tröpfchens: wächst vom Tropfen nach oben bis zur Ausgangsstelle */
.droplet--live.is-running::before {
  content: "";
  position: absolute;
  left: 32%;
  bottom: 90%;
  width: 36%;
  height: var(--run, 80px);
  border-radius: 999px;
  background: linear-gradient(to top, rgba(143, 207, 218, 0.3), rgba(143, 207, 218, 0));
  transform-origin: bottom;
  animation: droplet-trail var(--run-time, 2.6s) cubic-bezier(0.55, 0, 0.85, 0.4) both;
}
/* Sammeltropfen am Zeiger und Tröpfchen auf dem Weg zu ihm: droplets.js bewegt sie, keine Animation */
.droplet--live.droplet--held,
.droplet--live.is-joining { animation: none; }
.droplet--live.droplet--held { transition: width 0.2s ease-out, height 0.2s ease-out; }
.hero__droplets.is-paused .droplet,
.hero__droplets.is-paused .droplet::before { animation-play-state: paused; }
@keyframes droplet-grow {
  from { opacity: 0; transform: scale(0.25); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes droplet-hold {
  from, to { opacity: 1; }
}
@keyframes droplet-leave {
  to { opacity: 0; transform: scale(0.85); }
}
@keyframes droplet-run {
  0% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--run, 80px)); }
}
@keyframes droplet-trail {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .droplet--live, .droplet--live::before { animation: none; }
}

/* ---------- Schmale Bildschirme: Schleier hinter dem ganzen Textblock ---------- */
/* Der Text füllt hier die Breite. Ein Band in Texthöhe hält den Dampf dahinter dunkel genug
   (WCAG AA auch für den kleinen Hinweistext) und läuft unten weich aus. */
@media (max-width: 55.99rem) {
  .hero__veil { background: rgba(27, 16, 11, 0.3); }
  .hero__text { position: relative; }
  .hero__text::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -9rem;
    bottom: -2.5rem;
    left: -100vw;
    right: -100vw;
    background: linear-gradient(180deg, rgba(27, 16, 11, 0.74) 0, rgba(27, 16, 11, 0.74) calc(100% - 2.5rem), rgba(27, 16, 11, 0) 100%);
  }
}
