/* Velowerk, 3D-E-Bike-Konfigurator (Demo). Manufaktur-Palette seit v1.4:
   Tannengruen statt Teal, Bricolage nur fuer Headlines und den Preis. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/bricolage-grotesque-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #1d4b41;
  --accent-strong: #143630;
  --accent-soft: #dcebe4;
  --bg: #eef1f4;
  --surface: #ffffff;
  --line: #dde3e8;
  --ink: #1a2026;
  --ink-soft: #55606b;
  --ink-faint: #8b95a0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow:
    0 1px 2px rgba(18, 26, 33, 0.05), 0 10px 32px -18px rgba(18, 26, 33, 0.25);
  --focus: 0 0 0 3px rgba(29, 75, 65, 0.35);
  --headline: "Bricolage Grotesque", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    400 16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.ic {
  width: 16px;
  height: 16px;
  flex: none;
}

:is(a, button, input, select, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* ---------- Header ---------- */

.site-head {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  display: inline-flex;
}
.brand-logo svg {
  display: block;
  border-radius: 9px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-family: var(--headline);
  font-size: 17px;
  letter-spacing: 0.01em;
}
.brand-text small {
  color: var(--ink-soft);
  font-size: 12px;
}

.site-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.head-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 14px/1 inherit;
  font-family: inherit;
  padding: 11px 18px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
}

/* ---------- Intro ---------- */

.intro {
  padding: 52px 0 8px;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.intro h1 {
  margin: 0 0 14px;
  font-family: var(--headline);
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.intro-copy {
  margin: 0;
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 17px;
}

.intro-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 26px 0 0;
  padding: 0;
}
.intro-stats li {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.intro-stats strong {
  font-size: 17px;
}
.intro-stats span {
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Configurator grid ---------- */

main.shell {
  padding-top: 28px;
  padding-bottom: 56px;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.stage-col {
  position: sticky;
  top: 76px;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(
    120% 90% at 50% 20%,
    #ffffff 0%,
    #f2f4f6 48%,
    #e2e7ea 100%
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.stage:active {
  cursor: grabbing;
}
.stage:focus-visible {
  box-shadow: var(--focus), var(--shadow);
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 5px 12px;
  pointer-events: none;
  white-space: nowrap;
}

.stage-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  transition: opacity 0.2s ease;
}

.stage-reset {
  position: absolute;
  right: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 12px/1 inherit;
  font-family: inherit;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
}
.stage-reset:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.webgl-fallback[hidden] {
  display: none;
}
.webgl-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.webgl-fallback svg {
  width: min(70%, 380px);
  height: auto;
}
.webgl-fallback p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Panel ---------- */

.panel-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.opt-group {
  margin: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-col {
  counter-reset: optstep;
}
.opt-group legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-family: var(--headline);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.opt-group legend::before {
  counter-increment: optstep;
  content: counter(optstep, decimal-leading-zero);
  color: var(--accent);
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.opt-group legend + * {
  clear: both;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.swatch-label {
  display: inline-flex;
  cursor: pointer;
}
.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sw, #ccc);
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  position: relative;
}
.swatch-label:hover .swatch {
  transform: scale(1.08);
}
.swatch-label input:checked + .swatch {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 5px var(--accent);
}
.swatch-label input:focus-visible + .swatch {
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 5px var(--accent),
    var(--focus);
}

.opt-current {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.opt-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.opt-card:hover {
  border-color: var(--ink-faint);
}
.opt-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.opt-card-body strong {
  font-size: 14.5px;
}
.opt-card-body small {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.opt-card input:checked ~ .opt-card-body strong {
  color: var(--accent-strong);
}
.opt-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt-card:has(input:focus-visible) {
  box-shadow: var(--focus);
}

.opt-check .opt-card-body strong {
  position: relative;
  padding-left: 26px;
}
.opt-check .opt-card-body strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  border: 1.5px solid var(--ink-faint);
  border-radius: 5px;
  background: #fff;
}
.opt-check input:checked ~ .opt-card-body strong::before {
  border-color: var(--accent);
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.6 4.6L19 7.5'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.opt-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.opt-card:has(input:checked) .opt-price {
  color: var(--accent-strong);
}

/* ---------- Price box ---------- */

.price-box {
  padding: 20px;
  background: linear-gradient(165deg, #12302a 0%, #1d4b41 125%);
  color: #f2f9f6;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.price-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3cdbf;
}
.price-value {
  font-family: var(--headline);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price-value.bump {
  animation: price-bump 0.4s ease;
}
@keyframes price-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}
.price-note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #c1dbd1;
}
.price-monthly {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: #e1efe8;
}
.price-monthly span {
  color: #a3cdbf;
  font-size: 12px;
}
.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.price-box .btn-primary {
  background: #fff;
  color: var(--accent-strong);
}
.price-box .btn-primary:hover {
  background: #dcebe4;
}
.price-box .btn-ghost {
  color: #eef8f3;
  border-color: rgba(255, 255, 255, 0.35);
}
.price-box .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
}

/* ---------- Below grid ---------- */

.below-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card h2 {
  margin: 0 0 14px;
  font-family: var(--headline);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.summary-list li:last-child {
  border-bottom: 0;
}
.summary-list .sum-name {
  color: var(--ink);
}
.summary-list .sum-name small {
  display: block;
  color: var(--ink-faint);
  font-size: 12px;
}
.summary-list .sum-price {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-soft);
}
.summary-list li.sum-total {
  border-top: 2px solid var(--ink);
  margin-top: 4px;
}
.summary-list li.sum-total .sum-name,
.summary-list li.sum-total .sum-price {
  font-weight: 750;
  color: var(--ink);
  font-size: 15px;
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
}
.chip strong {
  color: var(--ink);
}
.chip .ic {
  color: var(--accent);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tech-table th,
.tech-table td {
  text-align: left;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
}
.tech-table tr:last-child :is(th, td) {
  border-bottom: 0;
}
.tech-table th {
  font-weight: 600;
  color: var(--ink-faint);
  width: 42%;
  padding-right: 14px;
}

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 0 30px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.site-foot p {
  margin: 0 0 6px;
}
.foot-note {
  color: var(--ink-faint);
}

/* ---------- Dialog ---------- */

.testride-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 24px 80px -24px rgba(15, 25, 30, 0.5);
  color: var(--ink);
}
.testride-dialog::backdrop {
  background: rgba(16, 24, 28, 0.45);
  backdrop-filter: blur(2px);
}
.testride-dialog form,
.dialog-success {
  padding: 24px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.dialog-head h2 {
  margin: 0;
  font-family: var(--headline);
  font-size: 19px;
}
.dialog-copy {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus);
  outline: none;
}
.dialog-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 4px 0 14px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dialog-success {
  text-align: center;
}
.dialog-success .success-ic {
  width: 52px;
  height: 52px;
  color: var(--accent);
  margin-bottom: 6px;
}
.dialog-success h2 {
  margin: 0 0 8px;
  font-family: var(--headline);
  font-size: 20px;
}
.dialog-success p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Demo ribbon ---------- */

.demo-ribbon {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 18, 22, 0.85);
  color: #fff;
  font:
    500 12px/1 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  padding: 9px 13px;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0.85;
}
.demo-ribbon:hover,
.demo-ribbon:focus-visible {
  opacity: 1;
}

/* ---------- Print ---------- */

.print-sheet {
  display: none;
}

@media print {
  .demo-ribbon {
    display: none;
  }
  body > *:not(.print-sheet) {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
    font-size: 13px;
  }
  .print-sheet {
    display: block;
    padding: 10mm 4mm;
  }
  .print-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 2px solid #1d4b41;
    padding-bottom: 10px;
    margin-bottom: 18px;
  }
  .print-head p {
    margin: 0;
  }
  .print-brand {
    font-family: var(--headline);
    font-size: 24px;
    font-weight: 700;
    color: #1d4b41;
    letter-spacing: -0.02em;
  }
  .print-model {
    font-weight: 600;
  }
  .print-sheet h1 {
    font-size: 22px;
    margin: 0 0 4px;
  }
  .print-meta {
    color: #555;
    margin: 0 0 16px;
  }
  .print-table {
    width: 100%;
    border-collapse: collapse;
  }
  .print-table th,
  .print-table td {
    text-align: left;
    padding: 7px 6px;
    border-bottom: 1px solid #ccc;
  }
  .print-table thead th {
    border-bottom: 2px solid #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .print-table .num,
  .print-table td:last-child {
    text-align: right;
    white-space: nowrap;
  }
  .print-total {
    text-align: right;
    font-size: 16px;
    margin: 14px 6px 4px;
  }
  .print-total strong {
    font-size: 20px;
  }
  .print-total span {
    font-size: 12px;
    color: #555;
  }
  .print-specs {
    color: #444;
    margin: 14px 6px 0;
  }
  .print-foot {
    margin-top: 26px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 11px;
    color: #777;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .config-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
  }
}

@media (max-width: 880px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
  .stage-col {
    position: static;
  }
  .stage {
    aspect-ratio: 5 / 4;
  }
  .below-grid {
    grid-template-columns: 1fr;
  }
  .intro {
    padding-top: 36px;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 0 16px;
  }
  .head-chip {
    display: none;
  }
  .stage {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
  }
  .stage-hint {
    display: none;
  }
  .stage-reset span {
    display: none;
  }
  .stage-reset {
    padding: 9px;
  }
  .opt-group,
  .card {
    padding: 16px;
  }
  .price-actions .btn {
    flex: 1 1 100%;
  }
  .intro-stats {
    gap: 8px 20px;
  }
}

/* ---------- Reduced motion ---------- */

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