/* ============================================================
   viebranz.com — Design-System „Light & Organic“
   Warme Papiertöne, Fraunces (Display) + Inter (Text),
   Terracotta/Gold/Oliv/Lavendel als gedämpfte Akzente.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("./fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("./fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/inter-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f2e9;
  --paper-deep: #efe7d8;
  --paper-card: #fbf8f1;
  --ink: #1b1712;
  --ink-soft: #3d372e;
  --muted: #7a7263;
  --line: rgba(27, 23, 18, 0.12);
  --terra: #b0572c;
  --terra-soft: #c97a52;
  --gold: #c9973b;
  --olive: #697046;
  --lavender: #8577c9;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: clip;
}
::selection { background: var(--terra); color: var(--paper); }

/* Organisches Korn über allem */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typografie ---------- */
.headline {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 420;
  font-variation-settings: "SOFT" 60, "WONK" 0;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.headline em {
  font-style: italic;
  font-weight: 380;
  color: var(--terra);
}
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 34rem; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--terra); text-underline-offset: 4px; }
a:hover { color: var(--terra); }

/* ---------- Layout ---------- */
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 7rem 0; }
.section-head { margin-bottom: 3rem; }
.hairline-top { border-top: 1px solid var(--line); }
.bg-deep { background: color-mix(in srgb, var(--paper-deep) 50%, transparent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: clip;
  display: flex;
  align-items: center;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; z-index: 1; width: 100%; }
.hero .headline { font-size: clamp(2.8rem, 7.5vw, 6rem); max-width: 12ch; }
.hero .lead { margin-top: 2rem; }
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
.scroll-hint .pill {
  width: 16px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex; justify-content: center; padding-top: 4px;
}
.scroll-hint .dot {
  width: 2px; height: 6px; border-radius: 999px; background: var(--ink);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 50% { transform: translateY(8px); opacity: 0.2; } }

/* ---------- Karten & Panels ---------- */
.panel {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  overflow: hidden;
}
.panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* Labor-Regler */
.controls { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; align-items: center; }
.control { display: flex; flex-direction: column; gap: 0.3rem; }
.control label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="range"] {
  appearance: none;
  width: 130px; height: 2px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--terra);
  border: 2px solid var(--paper-card);
  box-shadow: 0 1px 4px rgba(27, 23, 18, 0.25);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--terra); border: 2px solid var(--paper-card); cursor: pointer;
}

.formations { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.formations button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.formations button:hover { border-color: var(--terra); color: var(--terra); }
.formations button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

#lab-canvas { width: 100%; height: 480px; display: block; cursor: crosshair; touch-action: none; }
@media (max-width: 640px) { #lab-canvas { height: 380px; } }

/* ---------- Scroll-Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint .dot { animation: none; }
}
