:root {
  /* Color system — refined neutrals + premium orange */
  --bg: #ffffff;
  --bg-soft: #faf8f4;
  --bg-warm: #f3eee5;
  --ink: #0a0c10;
  --ink-2: #1f242c;
  --ink-3: #4a5159;
  --muted: #7a828c;
  --line: #ece8de;
  --line-2: #ddd6c8;
  --accent: #e87722;
  --accent-2: #c95f0e;
  --accent-soft: rgba(232, 119, 34, 0.08);
  --accent-glow: rgba(232, 119, 34, 0.28);

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Premium shadow system */
  --shadow-xs: 0 1px 2px rgba(10, 12, 16, 0.05);
  --shadow-sm: 0 2px 6px rgba(10, 12, 16, 0.05), 0 1px 2px rgba(10, 12, 16, 0.04);
  --shadow-md: 0 10px 22px -10px rgba(10, 12, 16, 0.14), 0 4px 8px -4px rgba(10, 12, 16, 0.05);
  --shadow-lg: 0 22px 44px -16px rgba(10, 12, 16, 0.22), 0 8px 16px -8px rgba(10, 12, 16, 0.06);
  --shadow-xl: 0 36px 72px -20px rgba(10, 12, 16, 0.3), 0 14px 28px -12px rgba(10, 12, 16, 0.08);

  /* Layout */
  --max: 1240px;
  --max-narrow: 760px;
  --gutter: clamp(20px, 4vw, 32px);

  /* Timing */
  --t: cubic-bezier(0.22, 1, 0.36, 1);
  --t-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.25s var(--t); }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* HEADER */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(236, 232, 222, 0.55);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: clamp(64px, 8vw, 80px); gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.01em; flex-shrink: 0; }
.brand img { height: clamp(30px, 4vw, 40px); width: auto; }
.nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 32px); }
.nav > a:not(.nav-cta) {
  color: var(--ink-2); font-weight: 500; font-size: 0.94rem;
  position: relative; padding: 6px 0;
}
.nav > a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--t);
}
.nav > a:not(.nav-cta):hover { color: var(--ink); }
.nav > a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta {
  background: var(--ink); color: #fff !important;
  padding: 11px 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  transition: background 0.25s var(--t), transform 0.25s var(--t), box-shadow 0.25s var(--t);
}
.nav-cta:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px var(--accent-glow);
}
.menu-toggle {
  display: none; background: none; border: 0; padding: 10px;
  cursor: pointer; color: var(--ink);
  border-radius: 10px; transition: background 0.2s var(--t);
}
.menu-toggle:hover { background: rgba(10, 12, 16, 0.06); }
.menu-toggle svg { width: 24px; height: 24px; }
.mobile-menu { display: none; }

@media (max-width: 860px) {
  .nav > a { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 8px 0; overflow: hidden;
  }
  .mobile-menu .container { padding: 0; }
  .mobile-menu.open { display: block; }
  .mobile-menu a {
    display: block; padding: 16px 24px;
    color: var(--ink); font-weight: 500;
    border-bottom: 1px solid var(--line);
    font-size: 0.98rem;
  }
  .mobile-menu a:last-child { border-bottom: 0; }
  .mobile-menu a:hover, .mobile-menu a:active { background: var(--bg-soft); color: var(--accent-2); }
  .mobile-menu-phone {
    color: var(--accent-2) !important;
    font-weight: 700 !important;
    background: var(--accent-soft);
  }
}

/* HERO */
.hero {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 540px; max-height: 86vh;
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 0; padding: 0;
}
.hero-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  z-index: 0; max-width: none;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(10,12,16,0) 0%, rgba(10,12,16,0.25) 100%),
    linear-gradient(180deg, rgba(10,12,16,0.15) 0%, rgba(10,12,16,0.05) 50%, rgba(10,12,16,0.3) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; padding: 0 var(--gutter);
  display: flex; justify-content: center;
}
.hero-text {
  max-width: 720px; width: 100%;
  color: #fff;
  background: rgba(10, 12, 16, 0.55);
  padding: clamp(28px, 4.2vw, 52px) clamp(24px, 4.2vw, 52px);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 64px -20px rgba(0, 0, 0, 0.55);
}
.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 16px;
}
.eyebrow {
  display: inline-block; font-size: 0.76rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.8vw, 3.4rem);
  line-height: 1.06; letter-spacing: -0.028em;
  margin: 0 0 20px; font-weight: 700; color: #fff;
}
.hero p.lead {
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  color: rgba(255, 255, 255, 0.86);
  margin: 0 auto 28px; max-width: 560px;
  line-height: 1.6;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.96rem;
  transition: transform 0.25s var(--t), background 0.25s var(--t), box-shadow 0.25s var(--t), border-color 0.25s var(--t);
  border: 1px solid transparent; cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff !important;
  box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px var(--accent-glow);
}
.btn-ghost { background: transparent; color: var(--ink) !important; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.hero .btn-ghost {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.04);
}
.hero .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 860px) {
  .hero { aspect-ratio: 9 / 16; min-height: 0; max-height: none; }
  .hero-overlay {
    background:
      radial-gradient(ellipse at center, rgba(10,12,16,0) 0%, rgba(10,12,16,0.25) 100%),
      linear-gradient(180deg, rgba(10,12,16,0.3) 0%, rgba(10,12,16,0.15) 45%, rgba(10,12,16,0.4) 100%);
  }
  .hero-inner { padding: 24px 18px; }
  .hero-text {
    max-width: 100%; width: 100%;
    padding: 28px 22px;
    border-radius: var(--radius);
  }
  .hero h1 { font-size: clamp(1.55rem, 7vw, 2.1rem); margin-bottom: 14px; }
  .hero p.lead { font-size: 0.96rem; margin-bottom: 22px; line-height: 1.55; }
  .cta-row { flex-direction: column; gap: 10px; }
  .cta-row .btn { width: 100%; justify-content: center; padding: 13px 22px; }
}

/* SECTION BASE */
section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head {
  max-width: 740px; margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  line-height: 1.14; letter-spacing: -0.022em;
  margin: 0 0 14px; font-weight: 700;
}
.section-head p {
  color: var(--ink-3);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  margin: 0; line-height: 1.65;
}

/* SERVICES */
.services { background: var(--bg-soft); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.service-card {
  background: #fff;
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 32px) clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--t), box-shadow 0.4s var(--t), border-color 0.4s var(--t);
  position: relative;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  transition: background 0.3s var(--t), transform 0.3s var(--t);
}
.service-card:hover .service-icon { background: var(--accent); color: #fff; }
.service-icon svg { width: 26px; height: 26px; }
.service-card h3 {
  margin: 0 0 10px;
  font-size: 1.14rem; font-weight: 700;
  letter-spacing: -0.012em; line-height: 1.3;
}
.service-card p {
  margin: 0; color: var(--ink-3);
  font-size: 0.95rem; line-height: 1.6;
}

@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .service-grid { grid-template-columns: 1fr; gap: 14px; } }

/* SHOWCASE */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
}
.showcase-item {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in; background: var(--bg-soft);
  isolation: isolate;
}
.showcase-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--t);
}
.showcase-item::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,12,16,0) 50%, rgba(10,12,16,0.6) 100%);
  pointer-events: none;
}
.showcase-item:hover img { transform: scale(1.06); }
.showcase-item .label {
  position: absolute; left: 18px; bottom: 16px; color: #fff;
  font-size: 0.92rem; font-weight: 600; z-index: 2;
  letter-spacing: -0.005em;
}

@media (max-width: 820px) { .showcase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .showcase-grid { grid-template-columns: 1fr; } }

/* ABOUT */
.about { background: var(--bg-soft); }
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.about-media {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.14; letter-spacing: -0.022em;
  margin: 12px 0 18px;
}
.about p { color: var(--ink-3); font-size: clamp(1rem, 1.3vw, 1.06rem); line-height: 1.7; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.6vw, 18px);
  margin-top: 36px;
}
.stat {
  background: #fff;
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 24px) clamp(16px, 2vw, 22px);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--t), box-shadow 0.3s var(--t);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-value {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 700; letter-spacing: -0.022em;
  color: var(--ink); line-height: 1;
}
.stat-label {
  font-size: 0.84rem; color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .about-media { aspect-ratio: 4/3; max-width: 480px; margin: 0 auto; width: 100%; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:nth-child(3) { grid-column: 1 / -1; }
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 24px);
  margin-top: 40px;
}
.location-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  transition: transform 0.3s var(--t), box-shadow 0.3s var(--t), border-color 0.3s var(--t);
}
.location-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.location-card h3 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  letter-spacing: -0.012em;
}
.location-card .addr { color: var(--ink-3); margin: 0 0 18px; }
.location-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; color: var(--ink-3); font-size: 0.95rem;
}
.location-link svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.location-link a { color: var(--ink); font-weight: 500; }
.location-link a:hover { color: var(--accent-2); }

@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-cta {
  margin-top: clamp(40px, 5vw, 56px);
  background: var(--ink); color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(40px, 5vw, 64px) clamp(28px, 4vw, 48px);
  text-align: center;
  position: relative; overflow: hidden;
}
.contact-cta::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(232, 119, 34, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(232, 119, 34, 0.12) 0%, transparent 50%);
  pointer-events: none;
}
.contact-cta > * { position: relative; }
.contact-cta h3 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  letter-spacing: -0.015em;
}
.contact-cta p { margin: 0 0 28px; color: rgba(255, 255, 255, 0.72); }
.contact-cta .btn-primary { background: var(--accent); }
.contact-cta .btn-ghost {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22);
}
.contact-cta .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .contact-cta .cta-row { flex-direction: column; }
  .contact-cta .cta-row .btn { width: 100%; justify-content: center; }
}

/* FOOTER */
footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.6);
  padding: clamp(48px, 6vw, 80px) 0 32px;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
  margin-bottom: 44px;
}
.footer-grid h4 {
  color: #fff; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin: 0 0 16px; font-weight: 600;
}
.footer-grid p { margin: 0 0 10px; line-height: 1.65; }
.footer-grid p, .footer-grid a { color: rgba(255, 255, 255, 0.6); }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.42);
}
.footer-bottom a:hover { color: #fff; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* LEGAL */
.legal {
  max-width: var(--max-narrow);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter) 64px;
}
.legal h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  letter-spacing: -0.022em; margin-bottom: 24px;
}
.legal h2 {
  font-size: 1.2rem;
  margin-top: 36px; margin-bottom: 8px;
}
.legal p { color: var(--ink-3); }
.legal a { color: var(--accent-2); text-decoration: underline; }

/* CONFIGURATOR */
.cfg { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 60%, var(--bg) 100%); }
.cfg-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
}
.cfg-stage {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 40px);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; justify-content: center;
  min-height: 380px;
}
.cfg-door {
  width: 100%; height: auto; max-height: 440px;
  display: block; margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--t);
  filter: drop-shadow(0 24px 32px rgba(10, 12, 16, 0.18));
}
/* Door animation — all panels move as a rigid sectional chain, constant speed.
   The clip-path automatically hides panels as they cross the lintel. */
.cfg-panels-group {
  transform: translateY(0);
  transition: transform 3s linear;
}
.cfg.cfg-door-open .cfg-panels-group { transform: translateY(-225px); }
.cfg.cfg-fast .cfg-panels-group { transition-duration: 0.8s; }
/* Drive carriage (Mitnehmer) — moves with the door, constant speed, opposite direction:
   when door panels go up (out of view), the carriage slides back toward the motor.
   Door panel translates -225px → carriage translates upward ~15px (smaller because in 2D
   the carriage's "depth" motion projects to a small vertical change near the ceiling). */
.cfg-carriage {
  transform: translateY(0);
  transition: transform 3s linear;
}
.cfg.cfg-door-open .cfg-carriage { transform: translateY(-12px); }
.cfg.cfg-fast .cfg-carriage { transition-duration: 0.8s; }

/* Tragseile (Cables) wickeln sich auf — Top fix, Bottom fährt nach oben weg.
   transform-box: fill-box bindet Origin an Element-Bounding-Box; scaleY von oben. */
.cfg-cable {
  transform-origin: center top;
  transform-box: fill-box;
  transform: scaleY(1);
  transition: transform 3s linear;
}
.cfg.cfg-door-open .cfg-cable { transform: scaleY(0.04); }
.cfg.cfg-fast .cfg-cable { transition-duration: 0.8s; }

/* Seiltrommeln drehen sich beim Öffnen (kontinuierliche Rotation) */
.cfg-drum-left, .cfg-drum-right {
  transform-origin: center;
  transform-box: fill-box;
  transform: rotate(0);
  transition: transform 3s linear;
}
.cfg.cfg-door-open .cfg-drum-left { transform: rotate(-540deg); }
.cfg.cfg-door-open .cfg-drum-right { transform: rotate(540deg); }
.cfg.cfg-fast .cfg-drum-left, .cfg.cfg-fast .cfg-drum-right { transition-duration: 0.8s; }

/* Decken-Stack: Panels erscheinen gestaffelt während des Öffnens, von oben
   herab "einrollend" — Slide vom Sturz + Fade-in. Reihenfolge: Panel 1 zuerst
   (deepest in z), Panel 4 zuletzt (front). Beim Schließen umgekehrt. */
.cfg-stacked-panel {
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transform-box: fill-box;
  transform-origin: center center;
  transition: opacity 0.4s ease-out, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.cfg.cfg-door-open .cfg-stacked-panel { transform: translateY(0) scale(1); }
/* Stack-Schiene wird mit dem ersten Panel sichtbar */
.cfg-stack-rail {
  opacity: 0;
  transition: opacity 0.4s ease-out;
  transition-delay: 0.45s;
}
.cfg.cfg-door-open .cfg-stack-rail { opacity: 1; }
.cfg:not(.cfg-door-open) .cfg-stack-rail { transition-delay: 2.5s; opacity: 0; }
.cfg.cfg-fast .cfg-stack-rail { transition-delay: 0.12s; }
.cfg.cfg-fast:not(.cfg-door-open) .cfg-stack-rail { transition-delay: 0.66s; }
.cfg.cfg-door-open .cfg-stacked-panel-1 { opacity: 1; transition-delay: 0.55s; }
.cfg.cfg-door-open .cfg-stacked-panel-2 { opacity: 1; transition-delay: 1.25s; }
.cfg.cfg-door-open .cfg-stacked-panel-3 { opacity: 1; transition-delay: 1.95s; }
.cfg.cfg-door-open .cfg-stacked-panel-4 { opacity: 1; transition-delay: 2.6s; }

.cfg:not(.cfg-door-open) .cfg-stacked-panel-1 { transition-delay: 2.4s; }
.cfg:not(.cfg-door-open) .cfg-stacked-panel-2 { transition-delay: 1.7s; }
.cfg:not(.cfg-door-open) .cfg-stacked-panel-3 { transition-delay: 1.0s; }
.cfg:not(.cfg-door-open) .cfg-stacked-panel-4 { transition-delay: 0.2s; }

.cfg.cfg-fast .cfg-stacked-panel { transition-duration: 0.12s; }
.cfg.cfg-fast.cfg-door-open .cfg-stacked-panel-1 { transition-delay: 0.15s; }
.cfg.cfg-fast.cfg-door-open .cfg-stacked-panel-2 { transition-delay: 0.32s; }
.cfg.cfg-fast.cfg-door-open .cfg-stacked-panel-3 { transition-delay: 0.5s; }
.cfg.cfg-fast.cfg-door-open .cfg-stacked-panel-4 { transition-delay: 0.66s; }
.cfg.cfg-fast:not(.cfg-door-open) .cfg-stacked-panel-1 { transition-delay: 0.62s; }
.cfg.cfg-fast:not(.cfg-door-open) .cfg-stacked-panel-2 { transition-delay: 0.45s; }
.cfg.cfg-fast:not(.cfg-door-open) .cfg-stacked-panel-3 { transition-delay: 0.28s; }
.cfg.cfg-fast:not(.cfg-door-open) .cfg-stacked-panel-4 { transition-delay: 0.05s; }
/* Disable parallax tilt during animation */
.cfg.cfg-animating .cfg-door { transform: none !important; transition: transform 0.4s var(--t); }

.cfg-controls {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  margin-top: 22px;
}
.cfg-play {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  background: var(--ink);
  color: #fff;
  border: 0; border-radius: 999px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--t), transform 0.2s var(--t), box-shadow 0.2s var(--t);
  box-shadow: 0 6px 18px -8px rgba(10, 12, 16, 0.4);
}
.cfg-play:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px var(--accent-glow);
}
.cfg-play:disabled { opacity: 0.7; cursor: wait; }
.cfg-play svg { width: 18px; height: 18px; }
.cfg-play .cfg-play-icon-close { display: none; }
.cfg.cfg-door-open .cfg-play .cfg-play-icon-open { display: none; }
.cfg.cfg-door-open .cfg-play .cfg-play-icon-close { display: inline-block; }

.cfg-speed-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.cfg-speed-chip {
  padding: 7px 14px;
  border: 0; background: transparent;
  border-radius: 999px;
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.2s var(--t);
  display: inline-flex; align-items: center; gap: 6px;
}
.cfg-speed-chip span {
  font-weight: 500; color: var(--muted);
  font-size: 0.76rem;
}
.cfg-speed-chip.cfg-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.cfg-speed-chip.cfg-active span { color: var(--accent-2); }

.cfg-size-readout {
  margin-top: 14px; text-align: center;
  font-size: 0.84rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600;
}
.cfg-size-readout .cfg-size-val { color: var(--ink); }

.cfg-panel {
  display: flex; flex-direction: column;
  gap: clamp(18px, 2.4vw, 26px);
  padding: clamp(8px, 1vw, 12px) 0;
}
.cfg-group { display: flex; flex-direction: column; gap: 10px; }
.cfg-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  display: flex; justify-content: space-between; align-items: baseline;
}
.cfg-label .cfg-size-display {
  letter-spacing: -0.01em; text-transform: none;
  font-size: 0.95rem; color: var(--ink); font-weight: 700;
}

.cfg-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.cfg-swatch {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 0; cursor: pointer;
  background: var(--sw, #ccc);
  position: relative;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: transform 0.2s var(--t), outline-color 0.2s var(--t), box-shadow 0.2s var(--t);
  box-shadow: var(--shadow-xs);
}
.cfg-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cfg-swatch.cfg-active { outline-color: var(--accent); }
.cfg-swatch.cfg-active::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}
.cfg-readout {
  font-size: 0.9rem; color: var(--ink-2);
  margin-top: 4px;
}
.cfg-readout strong, .cfg-color-name { font-weight: 600; color: var(--ink); }

.cfg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s var(--t);
}
.cfg-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.cfg-chip.cfg-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.cfg-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.cfg-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%; cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.35);
  transition: transform 0.15s var(--t);
}
.cfg-range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.cfg-range::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%; cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.35);
}
.cfg-range-marks {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--muted);
  margin-top: 6px;
}

.cfg-cta {
  width: 100%; justify-content: center;
  margin-top: 6px;
  padding: 16px 26px;
  font-size: 1rem;
}
.cfg-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 8px 0 0;
}

@media (max-width: 860px) {
  .cfg-grid { grid-template-columns: 1fr; gap: 24px; }
  .cfg-stage { min-height: 0; padding: 20px; }
  .cfg-swatches { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .cfg-swatches { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .cfg-swatch { border-radius: 10px; }
  .cfg-chip { padding: 9px 14px; font-size: 0.88rem; }
}

/* MODAL */
.cfg-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.cfg-modal.open { display: flex; }
.cfg-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 12, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cfg-modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: cfgModalIn 0.3s var(--t-bounce);
}
@keyframes cfgModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.cfg-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: 0; background: transparent;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer; color: var(--ink-3);
  border-radius: 50%;
  transition: background 0.2s var(--t);
}
.cfg-modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.cfg-modal-box h3 {
  margin: 0 0 18px;
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  letter-spacing: -0.015em;
}
.cfg-summary {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.cfg-summary-row {
  display: flex; justify-content: space-between;
  font-size: 0.94rem;
}
.cfg-summary-row span { color: var(--ink-3); }
.cfg-summary-row strong { color: var(--ink); font-weight: 600; }

.cfg-form { display: flex; flex-direction: column; gap: 10px; }
.cfg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cfg-form input, .cfg-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
  transition: border-color 0.2s var(--t), box-shadow 0.2s var(--t);
}
.cfg-form input:focus, .cfg-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cfg-form textarea { resize: vertical; min-height: 80px; }
.cfg-form button[type=submit] {
  margin-top: 8px;
  width: 100%; justify-content: center;
  padding: 14px 22px;
}
.cfg-form-note {
  font-size: 0.78rem; color: var(--muted);
  margin: 4px 0 0; text-align: center;
}
.cfg-form-note a { color: var(--accent-2); text-decoration: underline; }

.cfg-modal-success { text-align: center; padding: 12px 0; }
.cfg-success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.cfg-success-icon svg { width: 32px; height: 32px; }
.cfg-modal-success h3 { margin-bottom: 8px; }
.cfg-modal-success p { color: var(--ink-3); margin: 0 0 22px; }

@media (max-width: 480px) {
  .cfg-form-row { grid-template-columns: 1fr; }
}

/* FADE-IN */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--t), transform 0.8s var(--t);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
