/*
 * Duft-Umfrage. Handy zuerst: grosse Tippflaechen, eine Sache pro Bildschirm,
 * die Weiter-Taste dort, wo der Daumen ist.
 *
 * Farben und Schriften nach Marke & Produkt (V1): Kalk, Nebel, Basalt,
 * Messing nur als Linie und im Logo-Zusatz. Cinzel 600 ausschliesslich fuer
 * die Wortmarke, Cormorant Garamond fuer Ueberschriften, Montserrat 400 fuer
 * alles andere. Die Schriften kommen vom eigenen Worker (/schriften/), nie
 * von Google — siehe Kopf von src/worker.js.
 */

@font-face {
  font-family: "Cinzel";
  font-weight: 600;
  font-display: swap;
  src: url("/schriften/cinzel-600.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 500;
  font-display: swap;
  src: url("/schriften/cormorant-garamond-500.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-weight: 400;
  font-display: swap;
  src: url("/schriften/montserrat-400.woff2") format("woff2");
}

:root {
  --grund: #F3F1EC;
  --flaeche: #FFFFFF;
  --flaeche-2: #E6E2D9;
  --text: #22211F;
  --leise: #5E5A53;
  --linie: #D5D0C4;
  --akzent: #B08D57;
  --gewaehlt-grund: #22211F;
  --gewaehlt-text: #F3F1EC;
  --fehler: #6B2226;
  --fokus: #22211F;
  --schatten: 0 1px 2px rgba(34, 33, 31, 0.06), 0 4px 16px rgba(34, 33, 31, 0.05);
  --wortmarke: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1A1917;
    --flaeche: #242320;
    --flaeche-2: #2E2C28;
    --text: #F3F1EC;
    --leise: #B3AEA4;
    --linie: #3C3A36;
    --gewaehlt-grund: #F3F1EC;
    --gewaehlt-text: #1A1917;
    --fehler: #E0A4A6;
    --fokus: #F3F1EC;
    --schatten: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

.rahmen {
  max-width: 34rem;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- Kopf mit Fortschritt ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--grund);
  padding: calc(12px + env(safe-area-inset-top)) 0 8px;
}
.kopf[hidden] { display: none; }

.fortschritt {
  height: 4px;
  border-radius: 2px;
  background: var(--linie);
  overflow: hidden;
}
.fortschritt-balken {
  height: 100%;
  width: 0;
  background: var(--akzent);
  transition: width 0.25s ease;
}
.kopf-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--leise);
  letter-spacing: 0.02em;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  outline: none;
}

/* ---------- Typografie ---------- */

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: 40px; letter-spacing: -0.005em; }
h2 { font-size: 30px; }
p { margin: 0; }

.einstieg { padding-top: 48px; }
.einstieg h1 { margin-bottom: 16px; }
.einstieg p + p { margin-top: 12px; }
.eckdaten {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 28px;
  padding: 0;
  list-style: none;
}
.eckdaten li {
  font-size: 14px;
  padding: 4px 12px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  color: var(--leise);
}
.gruss { color: var(--leise); margin-top: 16px; }

.titel { margin-top: 20px; }
.frageblock { margin-top: 28px; }
.frageblock:first-child { margin-top: 20px; }
.frage {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.25;
  margin-bottom: 4px;
}
.frage-hinweis {
  font-size: 14px;
  color: var(--leise);
  margin-bottom: 12px;
}
.frage + .optionen, .frage + .chips { margin-top: 12px; }

/* ---------- Auswahl: Zeilen ---------- */

.optionen {
  display: grid;
  gap: 8px;
}

.wahl {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  box-shadow: var(--schatten);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.wahl:hover { border-color: var(--leise); }
.wahl[aria-pressed="true"] {
  background: var(--gewaehlt-grund);
  color: var(--gewaehlt-text);
  border-color: var(--gewaehlt-grund);
}
.wahl:disabled { opacity: 0.4; cursor: default; }

:focus-visible {
  outline: 2px solid var(--fokus);
  outline-offset: 2px;
}

/* ---------- Auswahl: Chips (mehrere) ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  appearance: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip small {
  display: block;
  font-size: 12px;
  color: var(--leise);
}
.chip[aria-pressed="true"] {
  background: var(--gewaehlt-grund);
  color: var(--gewaehlt-text);
  border-color: var(--gewaehlt-grund);
}
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.75; }
.chip:disabled { opacity: 0.4; cursor: default; }

/* ---------- Duftkarte ---------- */

.duft {
  margin-top: 16px;
  padding: 28px 20px 24px;
  background: var(--flaeche-2);
  border-radius: 16px;
  text-align: center;
}
.duft-marke {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--leise);
  margin-bottom: 6px;
}
.duft-name { font-size: 38px; }
.duft-richtung {
  margin-top: 10px;
  font-size: 14px;
  color: var(--leise);
}
.duft-richtung::before,
.duft-richtung::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--akzent);
  vertical-align: middle;
  margin: 0 8px;
}

/* Mit Flakonbild: Bild links, Text rechts. So wird die Karte nicht hoeher als
   ohne Bild, und Kennen und Bewerten passen weiter ohne Scrollen auf ein
   Handy. */
.duft.mit-bild {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px 20px 16px 16px;
  text-align: left;
}
.duft-bild {
  display: block;
  width: 96px;
  height: 128px;
  object-fit: contain;
  /* Die Produktfotos stehen auf Weiss. "multiply" laesst das Weiss in der
     Nebel-Flaeche verschwinden, der Flakon bleibt. */
  mix-blend-mode: multiply;
}
.duft.mit-bild .duft-name { font-size: 30px; }
.duft.mit-bild .duft-richtung::after { display: none; }
.duft.mit-bild .duft-richtung::before { margin: 0 8px 0 0; }

@media (prefers-color-scheme: dark) {
  /* Auf dunklem Grund wuerde "multiply" den Flakon mit verdunkeln. Dort
     bekommt er eine helle Kachel, wie ein Produktfoto im Katalog. */
  .duft-bild {
    mix-blend-mode: normal;
    background: #F3F1EC;
    border-radius: 10px;
    padding: 6px;
  }
}

.noten {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.note {
  appearance: none;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 10px 2px 8px;
  min-height: 72px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
/* Ziffern statt Emojis: ruhiger, und auf jedem Geraet gleich. */
.note-zeichen {
  font-family: var(--serif);
  font-weight: 500;
  /* Cormorant zeichnet von Haus aus Mediaevalziffern — die "1" saehe aus wie
     ein "I". Versalziffern stehen gleich hoch und sind eindeutig. */
  font-variant-numeric: lining-nums;
  font-size: 28px;
  line-height: 1;
}
.note-text { font-size: 11px; line-height: 1.2; color: var(--leise); }
.note[aria-pressed="true"] {
  background: var(--gewaehlt-grund);
  border-color: var(--gewaehlt-grund);
}
.note[aria-pressed="true"] .note-text { color: var(--gewaehlt-text); }

.bewertung { margin-top: 24px; }
.bewertung[hidden] { display: none; }
/* Niedrige Bildschirme (iPhone SE/Mini, WhatsApp-Browser mit Leisten):
   alles etwas enger, damit Karte, Kennen und Bewerten moeglichst ohne
   Scrollen zusammenpassen. */
@media (max-height: 740px) {
  .kopf { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .duft { margin-top: 8px; }
  .duft.mit-bild { grid-template-columns: 72px 1fr; padding: 10px 16px 10px 12px; gap: 14px; }
  .duft-bild { width: 72px; height: 96px; }
  .duft.mit-bild .duft-name { font-size: 26px; }
  .duft-marke { margin-bottom: 2px; }
  .duft-richtung { margin-top: 4px; }
  .frageblock:first-child { margin-top: 12px; }
  .optionen { gap: 6px; }
  .wahl { min-height: 44px; padding: 9px 16px; }
  .bewertung { margin-top: 14px; }
  .bewertung .frage { font-size: 21px; }
  .note { min-height: 60px; padding: 8px 2px 6px; }
  .note-zeichen { font-size: 24px; }
  .leiste { padding-top: 10px; }
  .knopf { min-height: 46px; }
}

/* ---------- Freitext ---------- */

.textfeld {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  resize: vertical;
}
.textfeld:focus-visible { outline-offset: 0; }

/* Honigtopf: fuer Menschen unsichtbar, fuer Formular-Bots ein Feld wie jedes andere. */
.honig {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Navigation unten ---------- */

.leiste {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 16px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--grund) 30%);
}
.knopf {
  appearance: none;
  font: inherit;
  letter-spacing: 0.04em;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf-haupt {
  flex: 1;
  background: var(--gewaehlt-grund);
  color: var(--gewaehlt-text);
  border: 1px solid var(--gewaehlt-grund);
}
.knopf-haupt:disabled { opacity: 0.35; cursor: default; }
.knopf-neben {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--linie);
}
.platzhalter { height: 24px; }

.meldung {
  margin-top: 16px;
  color: var(--fehler);
}
.meldung:empty { display: none; }

/* ---------- Datenschutz & Danke ---------- */

.datenschutz {
  margin-top: 32px;
  font-size: 14px;
  color: var(--leise);
}
.datenschutz summary {
  cursor: pointer;
  padding: 8px 0;
}
.datenschutz p + p { margin-top: 8px; }

.danke { padding-top: 56px; text-align: center; }
.danke h1 { margin-bottom: 12px; }
.danke p + p { margin-top: 12px; }
.nummer {
  display: inline-block;
  margin-top: 20px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.18em;
  padding: 8px 16px;
  border: 1px dashed var(--linie);
  border-radius: 8px;
}
.klein { font-size: 14px; color: var(--leise); }
.danke .knopf { width: 100%; margin-top: 28px; }
.textknopf {
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  color: var(--leise);
  text-decoration: underline;
  margin-top: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ---------- Kontakt (freiwillig, nach dem Absenden) ---------- */

.kontakt {
  margin: 32px 0 8px;
  padding: 24px 20px;
  background: var(--flaeche-2);
  border-radius: 16px;
  text-align: left;
}
.kontakt h2 { font-size: 28px; margin-bottom: 10px; }
.kontakt p + p, .kontakt .feld, .kontakt .haken { margin-top: 14px; }
.kontakt .knopf { width: 100%; margin-top: 18px; }
.kontakt .klein { margin-top: 16px; }
.feld {
  display: block;
  font-size: 14px;
  color: var(--leise);
}
.feld .leise { color: var(--leise); opacity: 0.8; }
.eingabe {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-size: 16px; /* unter 16 px zoomt iOS beim Tippen hinein */
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 12px;
  padding: 12px 14px;
}
.haken {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.haken input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--gewaehlt-grund);
}
.haken input:disabled + span { opacity: 0.45; }

.hinweis-block {
  margin-top: 48px;
  padding: 16px;
  border: 1px solid var(--linie);
  border-radius: 12px;
}

/* ---------- Wortmarke ---------- */

.wortmarke {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 36px;
}
.danke .wortmarke { align-items: center; }
.wortmarke-name {
  font-family: var(--wortmarke);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.2em;
  line-height: 1;
  /* Die Sperrung haengt hinter dem letzten Buchstaben an; zieht ihn zurueck,
     damit die Mitte stimmt. */
  margin-right: -0.2em;
}
.wortmarke-linie {
  width: 22px;
  height: 1px;
  background: var(--akzent);
}
.wortmarke-zusatz {
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--akzent);
  margin-right: -0.42em;
}

/* ---------- Links, Fuss, Rechtstexte ---------- */

a { color: inherit; text-underline-offset: 3px; }
.fuss {
  margin-top: 28px;
  font-size: 13px;
  color: var(--leise);
}
.danke .fuss { margin-top: 32px; }

.rechtstext { padding: 32px 0 48px; }
.rechtstext h1 { margin: 16px 0 8px; }
.rechtstext h2 {
  font-size: 22px;
  margin: 28px 0 6px;
}
.rechtstext p + p { margin-top: 10px; }
.rechtstext code { font-size: 14px; }
.zurueck-link { font-size: 14px; color: var(--leise); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (min-width: 480px) {
  h1 { font-size: 46px; }
  .einstieg { padding-top: 72px; }
}
