/* ─────────────────────────────────────────────────────────
   EMIRA — Rezepte-Freebie (Warteliste-Opt-in)
   Destillat des Skin-Code-Design-Systems (Editorial Soft).
   Eine Seite: Headline · Bild · Formular · CTA.
   ───────────────────────────────────────────────────────── */

:root {
  --bg:        #FBF4F1;
  --bg-elev:   #F5E8E3;
  --ink:       #0C0C0E;
  --ink-soft:  #4B4347;
  --rose:      #C58B85;
  --rose-deep: #9C5F5A;
  --cream:     #FFFFFF;
  --line:      rgba(12,12,14,0.10);

  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans:    "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Geist Mono", "JetBrains Mono", monospace;
  --font-accent:  "Playfair Display", Georgia, serif;

  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── TopBar ────────────────────────────────────────────── */
.topbar { padding: 22px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: -0.02em;
}
.brand .star {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--rose) 25%, transparent);
}
.brand-note {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Hero ──────────────────────────────────────────────── */
.hero { flex: 1; display: flex; align-items: center; padding: 40px 0 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 10px 16px 10px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 24px -16px rgba(0,0,0,.2);
}
.hero-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--rose) 30%, transparent);
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 4.6vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 26px 0 20px;
  text-wrap: balance;
}
.hero-headline em {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--rose-deep);
}

.hero-sub {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 30px;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

/* optionales Erklärvideo (per Config eingeblendet) */
.hero-video { margin: 0 0 28px; }
.hero-video iframe, .hero-video video {
  width: 100%; aspect-ratio: 16 / 9;
  border: 0; border-radius: var(--radius);
  background: var(--bg-elev);
}

/* ── Opt-in-Formular ───────────────────────────────────── */
.optin { position: relative; }
.optin-names { display: flex; gap: 12px; max-width: 560px; margin-bottom: 12px; }
.optin-names input { flex: 1; min-width: 0; }
.optin-row { display: flex; gap: 12px; align-items: stretch; max-width: 560px; }
.optin-row input,
.optin-names input {
  flex: 1; min-width: 0;
  font: inherit;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.optin-row input::placeholder,
.optin-names input::placeholder { color: color-mix(in oklab, var(--ink-soft) 70%, transparent); }
.optin-row input:focus,
.optin-names input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--rose) 22%, transparent);
}

.btn-ticket {
  display: inline-flex;
  align-items: stretch;
  background: var(--rose);
  color: var(--cream);
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.15;
  transition: transform .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
  box-shadow: 0 12px 36px -16px color-mix(in oklab, var(--rose-deep) 80%, transparent);
  will-change: transform;
  white-space: nowrap;
}
.btn-ticket:hover { transform: translateY(-2px); background: var(--rose-deep); }
.btn-ticket .btn-body { display: flex; align-items: center; padding: 0 22px; }
a.btn-ticket .btn-body { padding: 17px 24px; }
a.btn-ticket .btn-stub { padding: 0 20px; }
.btn-ticket .btn-stub {
  display: flex; align-items: center; justify-content: center;
  padding: 0 18px;
  border-left: 2px dashed color-mix(in oklab, var(--cream) 35%, transparent);
  background: color-mix(in oklab, var(--rose-deep) 50%, var(--rose));
}
.btn-ticket .btn-stub svg { width: 20px; height: 20px; }
.btn-ticket[disabled] { opacity: .6; cursor: wait; transform: none; }

.optin-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 14px;
  max-width: 52ch;
}
.optin-note a { text-decoration: underline; text-underline-offset: 3px; }

.optin-error {
  margin-top: 12px;
  font-size: 14px; font-weight: 500;
  color: #8C3B33;
}

.optin-success {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  max-width: 560px;
  box-shadow: 0 12px 36px -24px rgba(0,0,0,.25);
}
.optin-success .check {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in oklab, var(--rose) 25%, transparent);
  color: var(--rose-deep);
  font-weight: 700;
}
.optin-success p { color: var(--ink-soft); font-size: 15px; margin-top: 2px; }

.signature { margin-top: 34px; mix-blend-mode: multiply; opacity: .85; }

/* ── Portrait ──────────────────────────────────────────── */
.hero-portrait {
  position: relative;
  min-height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 70% 30%, color-mix(in oklab, var(--rose) 35%, transparent), transparent 60%),
    color-mix(in oklab, var(--rose) 18%, var(--bg-elev));
  isolation: isolate;
}
.hero-portrait-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-fig-label {
  position: absolute; left: 18px; bottom: 16px; z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em;
  color: #fff;
  background: rgba(12,12,14,.45);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

/* film grain */
.grain::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ── Footer ────────────────────────────────────────────── */
.footer { padding: 26px 0; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-soft);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }

/* ── Reveal ────────────────────────────────────────────── */
.js .fade-up { opacity: 0; transform: translateY(16px); }
.js .fade-up.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .fade-up { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 12px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-portrait { min-height: 420px; order: -1; }
  .signature { margin-top: 26px; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 36px); }
  /* Vorname/Nachname bleiben nebeneinander, duerfen aber unter ihre
     Eigenbreite schrumpfen. min-width:0 allein reicht dafuer nicht: ein
     text-Input bringt ueber das size-Attribut eine Eigenbreite von 249px
     mit, und die zaehlt in die min-content-Breite der Flex-Zeile. Zwei
     Inputs plus Gap ergaben 510px, das Layout blieb auf jedem Handy bei
     528px stehen und die Seite scrollte quer. width:0 setzt die Eigenbreite
     ausser Kraft, flex-basis 0 verteilt den Platz wieder gleichmaessig. */
  .optin-names input { width: 0; flex: 1 1 0; }
  .optin-row { flex-direction: column; }
  .btn-ticket .btn-body { flex: 1; justify-content: center; padding: 16px 22px; }
  /* Der Download-Button der Danke-Seiten steht frei statt in einer Flex-Zeile.
     Mit white-space:nowrap bestimmte sein Text die min-content-Breite der
     ganzen Seite, und "Rezepte herunterladen (PDF)" braucht mehr als ein
     320px-Display hergibt. Auf voller Breite darf die Beschriftung umbrechen,
     nebenbei wird die Tap-Flaeche groesser. */
  a.btn-ticket { display: flex; white-space: normal; }
  a.btn-ticket .btn-body { text-align: center; }
  .hero-portrait { min-height: 340px; }
  .footer-inner { flex-direction: column; gap: 10px; }
}

/* ── Rechtsseiten (Impressum, Datenschutz) ─────────────── */
.legal { padding: 56px 0 72px; flex: 1; }
.legal-inner { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
.legal-back {
  display: inline-block; margin-bottom: 28px;
  font-size: 14px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.legal h1 {
  font-family: var(--font-display);
  font-weight: 400; letter-spacing: -0.025em;
  font-size: clamp(32px, 4vw, 46px); line-height: 1.1;
  margin-bottom: 10px;
}
.legal .legal-stand { color: var(--ink-soft); font-size: 14px; margin-bottom: 40px; }
.legal h2 {
  font-family: var(--font-display);
  font-weight: 500; font-size: 21px; letter-spacing: -0.015em;
  margin: 40px 0 12px;
}
.legal h3 { font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--ink-soft); font-size: 16px; }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0 20px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 3px; }
.legal address { font-style: normal; color: var(--ink-soft); }
.legal .legal-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 14px;
}

/* ── Face Scan: KI-Analyse-Overlay auf dem Portrait ─────
   Liegt als Vektor ueber dem unveraenderten Foto. viewBox ist der Bildraum
   von emira.jpg (1200x1600), preserveAspectRatio="xMidYMid slice" entspricht
   dem object-fit:cover des <img> darunter. Deshalb sitzen die Punkte in jeder
   Containergroesse auf denselben Gesichtsstellen.
   Erzeugt von pdf-src/build-face-scan.py, dort stehen auch die Koordinaten. */
.face-scan {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.face-scan .fs-mesh line {
  stroke: var(--cream); stroke-width: 1; opacity: .24;
}
.face-scan .fs-trace polyline,
.face-scan .fs-trace polygon {
  fill: none; stroke: var(--cream); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; opacity: .36;
}
.face-scan .fs-ring circle {
  fill: none; stroke: var(--cream); stroke-width: 1.5; opacity: .55;
}
.face-scan .fs-bracket path {
  fill: none; stroke: var(--rose); stroke-width: 3.4;
  stroke-linecap: round; opacity: .85;
  filter: drop-shadow(0 0 7px rgba(197,139,133,.55));
}
.face-scan .fs-dots circle {
  fill: var(--cream); opacity: .82;
  filter: drop-shadow(0 0 4px rgba(197,139,133,.85));
}
.face-scan .fs-anchor {
  fill: none; stroke: var(--cream); stroke-width: 2; opacity: .85;
}
.face-scan .fs-leader {
  fill: none; stroke: var(--cream); stroke-width: 1.4; opacity: .6;
}
.face-scan .fs-labels text {
  font-family: var(--font-mono);
  font-size: 21px; letter-spacing: 0.14em; text-transform: uppercase;
  fill: var(--cream); opacity: .92;
  paint-order: stroke; stroke: rgba(12,12,14,.35); stroke-width: 3.5;
}

/* Aufbau beim Erscheinen: erst die Ecken, dann Zuege, dann die Punkte. */
.js .face-scan .fs-mesh,
.js .face-scan .fs-trace,
.js .face-scan .fs-ring,
.js .face-scan .fs-bracket,
.js .face-scan .fs-labels { opacity: 0; }
.js .fade-up.in .face-scan .fs-bracket { animation: fsIn .7s var(--ease) .15s forwards; }
.js .fade-up.in .face-scan .fs-trace   { animation: fsIn .9s var(--ease) .35s forwards; }
.js .fade-up.in .face-scan .fs-mesh    { animation: fsIn .9s var(--ease) .55s forwards; }
.js .fade-up.in .face-scan .fs-ring    { animation: fsIn .7s var(--ease) .65s forwards; }
.js .fade-up.in .face-scan .fs-labels  { animation: fsIn .8s var(--ease) 1.05s forwards; }
.js .face-scan .fs-dots circle { opacity: 0; }
.js .fade-up.in .face-scan .fs-dots circle {
  animation: fsDot .5s var(--ease) forwards;
  animation-delay: calc(.6s + var(--i) * .022s);
}
@keyframes fsIn  { to { opacity: 1; } }
@keyframes fsDot { from { opacity: 0; transform: scale(.4); } to { opacity: .82; transform: scale(1); } }
.face-scan .fs-dots circle { transform-box: fill-box; transform-origin: center; }

/* Der Sweep laeuft dauerhaft, langsam und mit langer Pause. */
.face-scan .fs-sweep { opacity: 0; }
.js .fade-up.in .face-scan .fs-sweep { animation: fsSweep 7s cubic-bezier(.4,0,.2,1) 1.4s infinite; }
@keyframes fsSweep {
  0%        { transform: translateY(0);    opacity: 0; }
  8%        { opacity: 1; }
  42%       { transform: translateY(452px); opacity: 0; }
  100%      { transform: translateY(452px); opacity: 0; }
}

/* Auf dem Handy skaliert das SVG mit dem Bild herunter, die Beschriftungen
   waeren dort nur noch wenige Pixel hoch. Mesh und Punkte bleiben. */
@media (max-width: 860px) {
  .face-scan .fs-labels { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .face-scan .fs-mesh, .js .face-scan .fs-trace, .js .face-scan .fs-ring,
  .js .face-scan .fs-bracket, .js .face-scan .fs-labels { opacity: 1; animation: none; }
  .js .face-scan .fs-dots circle { opacity: .82; animation: none; }
  .js .fade-up.in .face-scan .fs-sweep { animation: none; }
}
