/* ==========================================================================
   AMARA — Demo-Projekt (bewusst anderer Stil als Pixelform)
   Warme, durchdachte Farbwelt statt Tech-Minimalismus: kräftige Sans-Serif-
   Typografie, ein interaktiver "Raum" im Hero, eine anfassbare Farbpalette
   und ein Grundriss, der zeigt statt behauptet, dass hier jemand Räume
   plant. Reveal-Animationen sind bewusst "schwebend" statt nur einzublenden.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Bewusst komponierte Palette statt zwei Zufallsfarben: Terrakotta als
     Primärton, Sand/Ocker und Oliv als analoge Warmtöne, Petrol als
     kühler Gegenspieler (grob komplementär) für Akzente/Interaktion. */
  --terracotta: #af4d2c;
  --sand: #c98a3f;
  --olive: #5c6349;
  --clay: #8a5a3f;
  --petrol: #3f6b66;

  --accent: var(--terracotta);
  --accent-ink: #fff6ee;

  /* Dunkles, edles Grundthema (statt hell/warm) — die Akzentfarben bleiben
     gleich, wirken auf dunklem Grund aber satter. Klicks in "Farbwelt"
     leiten alles unten von --accent ab und setzen es direkt per JS (siehe
     main.js) — bewusst NICHT via CSS color-mix(). Reine Hex-Werte aus JS
     sind auf jedem Browser zuverlässig. */
  --bg: #16120e;
  --bg-alt: #1f1912;
  --surface: #241d16;
  --ink: #f3ecdf;
  --ink-dim: #b9ac9a;
  --ink-faint: #7d7062;
  --line: rgba(243, 236, 223, 0.12);

  /* Die Kennzahlen-Sektion war vorher der dunkle Kontrast auf hellem Grund —
     jetzt umgekehrt: der helle Kontrast auf dunklem Grund. Gleiches Prinzip,
     gespiegelt. */
  --dark-bg: #f6f1ea;
  --dark-surface: #efe6d8;
  --dark-ink: #201c18;
  --dark-line: rgba(32, 28, 24, 0.12);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --container: 1160px;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.34, 1.2, 0.4, 1);
  --radius: 16px;
}

/* Palette re-derivation on swatch click happens in main.js by setting
   plain hex values directly (see note above) — no CSS color-mix() here. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-color .4s var(--ease);
}
.swatch-btn:focus-visible { outline-offset: 5px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}

/* Every surface that reads --bg/--bg-alt/--surface/--line reacts to a
   palette click — this is what makes it a whole-site theme change and not
   just a couple of recolored buttons. */
body, .nav, section, footer.site-footer,
.swatch-caption, .room-visual, .testi-card, .contact-split,
.stat-card, .gallery-item {
  transition: background-color .5s ease, border-color .5s ease, color .5s ease;
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
section { padding-block: clamp(64px, 9vw, 120px); position: relative; }
section[id] { scroll-margin-top: 88px; }

.label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
  transition: color .4s var(--ease);
}

/* ---------- Back-to-Pixelform pill ----------
   Lives inside the (sticky) nav rather than as its own fixed element —
   sticky nav already "follows along while scrolling", and keeping it in
   the normal flex flow means it can never overlap the AMARA logo next to
   it, on any screen size. */
.nav-left { display: flex; align-items: center; gap: 14px; }
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-dim);
  transition: transform .25s var(--ease), background-color .5s ease, border-color .5s ease, color .3s ease;
}
.back-pill:hover { transform: translateX(-2px); color: var(--ink); }
.back-pill svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .back-pill { padding: 8px 11px; }
  .back-pill-label { display: none; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(22, 18, 14, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-block: 20px;
  transition: background-color .5s ease, border-color .5s ease;
}
.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
}
.nav-links a { position: relative; padding-bottom: 4px; transition: color .2s var(--ease); }
.nav-links a:hover { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  border: 2px solid transparent;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  /* --accent-shadow is a plain rgba(...) string set from JS alongside
     --accent (see main.js) — same reasoning as the palette above. */
  box-shadow: 0 12px 28px -10px var(--accent-shadow, rgba(175, 77, 44, 0.55));
}
.btn-solid:hover { box-shadow: 0 16px 34px -8px var(--accent-shadow-strong, rgba(175, 77, 44, 0.65)); }
.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.nav-cta { display: none; }
@media (min-width: 761px) { .nav-cta { display: inline-flex; } }

/* ---------- Reveal: "hereinschwebend" statt reinem Fade ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px) scale(.97);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  transition-delay: var(--delay, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }

.word-float {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(3deg);
  transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft);
  transition-delay: var(--wd, 0s);
}
.word-float.is-visible { opacity: 1; transform: translateY(0) rotate(0deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(64px, 11vw, 120px);
  overflow: hidden;
}
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-scene .plan-svg {
  position: absolute;
  top: 50%;
  right: -4%;
  width: min(620px, 60vw);
  transform: translateY(-50%);
  opacity: 0.9;
}
.hero-scene .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
  animation: hero-blob-float 14s var(--ease) infinite;
}
.hero-scene .blob.b1 { width: 320px; height: 320px; top: -60px; left: -80px; background: radial-gradient(circle, var(--terracotta), transparent 70%); }
.hero-scene .blob.b2 { width: 260px; height: 260px; bottom: -40px; left: 30%; background: radial-gradient(circle, var(--sand), transparent 70%); animation-delay: -4s; }
.hero-scene .blob.b3 { width: 300px; height: 300px; top: 10%; right: 5%; background: radial-gradient(circle, var(--petrol), transparent 70%); animation-delay: -8s; opacity: .35; }

@keyframes hero-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -18px) scale(1.08); }
}

.material-tag {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(36, 29, 22, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-dim);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.5);
  animation: tag-float 7s ease-in-out infinite;
}
.material-tag .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.material-tag.t1 { top: 14%; right: 30%; animation-duration: 8s; }
.material-tag.t2 { top: 46%; right: 6%; animation-duration: 6.5s; animation-delay: -2s; }
.material-tag.t3 { bottom: 18%; right: 34%; animation-duration: 9s; animation-delay: -4.5s; }

@keyframes tag-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Material chips as an inline row (mobile only) — same idea as the floating
   absolute tags on desktop, but laid out in-flow so they can never overlap
   the headline on narrow screens. */
.material-chip-row {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.material-chip-row .material-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(36, 29, 22, 0.85);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-dim);
  animation: tag-float 7s ease-in-out infinite;
}
.material-chip-row .material-chip .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.material-chip-row .material-chip:nth-child(2) { animation-delay: -2.3s; }
.material-chip-row .material-chip:nth-child(3) { animation-delay: -4.6s; }

@media (max-width: 1000px) {
  /* Keep the floor-plan visible on mobile too (same idea, not a stripped-
     down design) — recentered as a large backdrop instead of the desktop's
     side-by-side composition, which has no room on narrow screens. Opacity
     matches desktop's richness now (was 0.32 — read as washed-out/pale
     next to desktop); anchored lower so it sits behind the buttons/chips
     instead of directly behind the headline text. */
  .hero-scene .plan-svg {
    top: 88%;
    right: auto;
    left: 50%;
    width: 140vw;
    max-width: 640px;
    transform: translate(-50%, -50%);
    opacity: 0.8;
  }
  .material-tag { display: none; }
  .material-chip-row { display: flex; }
}

/* Mouse parallax only exists where there's a mouse. On touch, give the
   floor-plan its own slow idle drift instead, so the background still
   feels alive without requiring interaction. */
@media (hover: none) {
  .hero-scene .plan-svg {
    animation: plan-idle-drift 10s ease-in-out infinite;
  }
}
@keyframes plan-idle-drift {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(calc(-50% + 10px), calc(-50% - 8px)) rotate(-1.5deg); }
}

.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.hero h1 {
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.hero h1 .accent-word { color: var(--accent); }
.hero-sub {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--ink-dim);
  max-width: 480px;
  margin-top: 24px;
}
.hero-actions { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }
.hero-trust {
  margin-top: 48px;
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-faint);
  font-weight: 600;
}
.hero-trust span { display: flex; align-items: center; gap: 8px; }
.hero-trust svg { color: var(--accent); flex-shrink: 0; transition: color .5s ease; }

/* ---------- Farbwelt (ersetzt die frühere Laufschrift) ---------- */
.farbwelt { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.farbwelt-inner { display: flex; align-items: center; gap: clamp(32px, 6vw, 72px); flex-wrap: wrap; }
.farbwelt-copy { flex: 1; min-width: 240px; }
.farbwelt-copy h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
.farbwelt-copy p { color: var(--ink-dim); margin-top: 10px; font-size: 14.5px; max-width: 40ch; }

.swatch-row { display: flex; gap: 18px; flex-wrap: wrap; }
.swatch-btn {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line);
  cursor: pointer;
  transition: transform .35s var(--ease-soft), box-shadow .3s var(--ease);
  flex-shrink: 0;
}
.swatch-btn:hover, .swatch-btn:focus-visible { transform: translateY(-6px) scale(1.06); }
.swatch-btn.is-active { box-shadow: 0 0 0 2px var(--ink); }
.swatch-caption {
  /* Fixed box size (not just min-width) so switching between a short
     ("Ton") and long ("Petrol") description never changes the box height —
     that reflow was shifting the entire rest of the page on every hover. */
  width: 260px;
  min-height: 108px;
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  font-size: 13.5px;
  transition: border-color .4s var(--ease);
}
.swatch-caption b { display: block; font-size: 15px; margin-bottom: 3px; }
.swatch-caption span { color: var(--ink-dim); }

/* ---------- Leistungen: interaktiver Grundriss ---------- */
.plan-section-head { max-width: 640px; margin-bottom: 48px; }
.plan-section-head h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.01em; }
.plan-section-head p { color: var(--ink-dim); margin-top: 14px; font-size: 16px; max-width: 52ch; }

.room-split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.room-list { display: flex; flex-direction: column; }
.room-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left .3s var(--ease);
}
.room-item:last-child { border-bottom: 1px solid var(--line); }
.room-item:hover, .room-item.is-active { padding-left: 10px; }
.room-item .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--line);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.room-item.is-active .dot, .room-item:hover .dot { transform: scale(1.15); }
.room-item h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.room-item p { color: var(--ink-dim); font-size: 14.5px; }

.room-visual {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(20px, 4vw, 36px);
}
.room-visual svg { width: 100%; height: 100%; overflow: visible; }
.room-zone { cursor: pointer; }
.room-zone .z-stroke, .room-zone .z-fill, .room-zone .z-fill-soft {
  transition: fill .4s var(--ease), stroke .4s var(--ease), opacity .4s var(--ease);
}
.room-zone[data-zone="konzept"] .z-stroke { stroke: var(--line); }
.room-zone[data-zone="konzept"].is-active .z-stroke { stroke: var(--terracotta); }

.room-zone[data-zone="moebel"] .z-fill-soft { fill: var(--bg-alt); }
.room-zone[data-zone="moebel"] .z-fill { fill: var(--line); }
.room-zone[data-zone="moebel"].is-active .z-fill-soft { fill: var(--sand); }
.room-zone[data-zone="moebel"].is-active .z-fill { fill: var(--sand); }

.room-zone[data-zone="umsetzung"] .z-fill-soft { fill: var(--bg-alt); }
.room-zone[data-zone="umsetzung"] .z-stroke { stroke: var(--line); }
.room-zone[data-zone="umsetzung"].is-active .z-fill-soft { fill: var(--petrol); }
.room-zone[data-zone="umsetzung"].is-active .z-stroke { stroke: var(--petrol); }
.room-caption {
  position: absolute;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.room-caption.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Dark stats band ---------- */
.stats-band { background: var(--dark-bg); color: var(--dark-ink); }
.stats-band .section-head p, .stats-band .plan-section-head p { color: rgba(32, 28, 24, 0.65); }
.stats-band .label { color: #d99a72; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-card {
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.stat-card:hover { transform: translateY(-4px); background: rgba(32, 28, 24, 0.04); }
.stat-card b { display: block; font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; }
.stat-card span { font-size: 13.5px; color: rgba(32, 28, 24, 0.6); font-weight: 600; }

/* ---------- Gallery ---------- */
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-dim); margin-top: 14px; font-size: 16px; max-width: 52ch; }

.gallery-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; gap: 24px; flex-wrap: wrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery-item { position: relative; overflow: hidden; aspect-ratio: 4/5; border-radius: var(--radius); }
.gallery-item:nth-child(1) { grid-row: span 2; aspect-ratio: 4/6.4; }
.gallery-item .swatch { position: absolute; inset: 0; transition: transform 1.2s var(--ease); }
.gallery-item:hover .swatch { transform: scale(1.06); }
.gallery-item .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 24px;
  background: linear-gradient(to top, rgba(20,16,12,0.65), transparent);
  color: #f4ede2;
}
.gallery-item .cap .cat { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: .85; }
.gallery-item .cap h3 { font-size: 20px; font-weight: 800; margin-top: 4px; }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testi-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .3s var(--ease);
}
.testi-card:hover { transform: translateY(-4px); }
.testi-card p { font-size: 16px; line-height: 1.6; }
.testi-card footer { margin-top: 22px; display: flex; align-items: center; gap: 12px; }
.testi-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-ink); font-weight: 800; font-size: 14px;
}
.testi-name { font-weight: 700; font-size: 14px; }
.testi-role { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Kontakt ---------- */
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 64px);
}
.contact-split h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin-bottom: 16px; }
.contact-split p { color: var(--ink-dim); font-size: 15.5px; max-width: 44ch; margin-bottom: 28px; }
.contact-detail-list div { padding-block: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 14.5px; }
.contact-detail-list div:last-child { border-bottom: 1px solid var(--line); }
.contact-detail-list span.k { color: var(--ink-faint); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Footer ---------- */
footer.site-footer { border-top: 1px solid var(--line); padding-block: 36px; }
.footer-inner {
  max-width: var(--container); margin-inline: auto; padding-inline: var(--pad);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--ink-faint);
}
.footer-inner a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink-dim); font-weight: 600; }

@media (max-width: 900px) {
  .room-split { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .testi-grid { grid-template-columns: 1fr; }
  .contact-split { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 500px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item:nth-child(1) { grid-row: auto; aspect-ratio: 4/5; }
  .swatch-row { gap: 12px; }
  .swatch-btn { width: 52px; height: 52px; }
}
