:root {
  --ink: #080a0c;
  --panel: #11161a;
  --panel-2: #171d22;
  --line: #30373d;
  --muted: #9ba3aa;
  --white: #f7f8f8;
  --accent: #e5aa24;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, select { font: inherit; }
button, select { touch-action: manipulation; }

.prototype-header {
  width: min(1440px, calc(100% - 48px));
  min-height: 84px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: block; width: clamp(210px, 24vw, 292px); }
.brand img { display: block; width: 100%; height: auto; }

.prototype-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c6ccd0;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.prototype-state span { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(229,170,36,.12); }

.prototype-shell { width: min(1440px, calc(100% - 48px)); margin-inline: auto; padding: 52px 0 70px; }
.intro { display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(260px, .55fr); align-items: end; gap: 56px; margin-bottom: 36px; }
.intro .eyebrow { grid-column: 1 / -1; margin: 0 0 -38px; color: var(--accent); font-size: .77rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.intro h1, .control-heading h2 { margin: 0; font-family: Impact, "Arial Black", "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .01em; line-height: .92; }
.intro h1 { max-width: 900px; font-size: clamp(3.2rem, 7vw, 7.4rem); }
.intro-copy { margin: 0 0 6px; }
.intro-copy > p:first-child { margin: 0; color: #b6bdc2; font-size: 1.02rem; line-height: 1.65; }
.prototype-note { margin: 18px 0 0; padding-left: 14px; border-left: 2px solid var(--accent); color: #d7dadd; font-size: .78rem; font-weight: 700; line-height: 1.5; }

.configurator {
  --ink: #080a0c;
  --line: #30373d;
  --muted: #9ba3aa;
  --white: #f7f8f8;
  --accent: #e5aa24;
  display: grid;
  grid-template-columns: minmax(285px, .3fr) minmax(0, 1fr);
  min-height: 650px;
  border: 1px solid var(--line);
  color: var(--white);
  color-scheme: dark;
  background: #0c0f12;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.control-panel { padding: 34px 28px; border-right: 1px solid var(--line); background: linear-gradient(155deg, #151b20, #0d1114); }
.control-heading { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.control-heading > span { color: var(--accent); font-size: .75rem; font-weight: 900; padding-top: 4px; }
.control-heading p { margin: 0 0 5px; color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.control-heading h2 { font-size: 2rem; }

.select-control { display: block; margin-top: 24px; }
.select-control > span { display: block; margin-bottom: 8px; color: #ccd1d5; font-size: .76rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.select-control select {
  width: 100%;
  min-height: 52px;
  padding: 0 42px 0 14px;
  border: 1px solid #3c444b;
  border-radius: 0;
  color: var(--white);
  background: #0a0d10;
  cursor: pointer;
}
.select-control select:focus-visible { outline: 3px solid rgba(229,170,36,.42); outline-offset: 2px; border-color: var(--accent); }

.paint-panel { padding: 18px 20px 15px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #171d22, #101519); }
.paint-heading { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; margin-bottom: 13px; }
.paint-heading > span { padding-top: 3px; color: var(--accent); font-size: .75rem; font-weight: 900; }
.paint-heading p { margin: 0 0 4px; color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.paint-heading h3 { margin: 0; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.paint-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.paint-control { display: block; }
.paint-label { display: block; margin-bottom: 6px; color: #d8dde0; font-size: .72rem; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.paint-input { display: grid; grid-template-columns: 42px minmax(0, 1fr); min-height: 46px; border: 1px solid #3c444b; background: #0a0d10; }
.paint-chip { display: block; margin: 7px; background: var(--paint-color, #edf0f2); border: 1px solid rgba(255,255,255,.45); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.paint-input select { min-width: 0; width: 100%; padding: 0 34px 0 10px; border: 0; color: var(--white); background: #0a0d10; font-size: .78rem; cursor: pointer; }
.paint-input:focus-within { border-color: var(--accent); outline: 3px solid rgba(229,170,36,.35); outline-offset: 2px; }
.paint-input select:focus { outline: 0; }
.paint-control small { display: block; margin-top: 5px; color: #8f99a1; font-size: .66rem; font-weight: 700; line-height: 1.35; }
.rear-door-note { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; color: #aeb6bc; font-size: .62rem; font-weight: 750; line-height: 1.35; }
.rear-door-icon { display: grid; grid-template-columns: 1fr 1fr; width: 34px; height: 27px; padding: 2px; border: 1px solid #8b949b; background: #0a0d10; }
.rear-door-icon i { display: block; border: 1px solid rgba(0,0,0,.48); background: repeating-linear-gradient(0deg, rgba(0,0,0,.19) 0 1px, transparent 1px 5px), var(--paint-color, #edf0f2); }
.rear-door-icon i + i { border-left: 0; }
.paint-note { margin: 11px 0 0; color: #7f8991; font-size: .66rem; line-height: 1.45; }

.selection-summary { margin: 28px 0; border-top: 1px solid var(--line); }
.selection-summary div { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.selection-summary dt { color: var(--muted); font-size: .69rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.selection-summary dd { margin: 0; font-size: .82rem; font-weight: 750; text-align: right; }

.demo-button {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  color: var(--ink);
  background: var(--accent);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.demo-button:hover { background: #f0b83a; }
.demo-button:focus-visible { outline: 3px solid rgba(229,170,36,.42); outline-offset: 3px; }

.stage-column { min-width: 0; display: grid; grid-template-rows: auto auto auto; align-content: start; background: #0a0d10; }
.truck-stage { position: relative; width: 100%; min-height: 0; aspect-ratio: 16 / 9; margin: 0; overflow: hidden; isolation: isolate; background: #14191d; }
.truck-render { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: contain; object-position: center; opacity: 0; transform: scale(1.006); transition: opacity .32s ease, transform .48s ease; }
.truck-render.active { opacity: 1; transform: scale(1); }
.truck-render.is-changing { opacity: .25; transform: scale(1.006); }
.stage-shade { position: absolute; z-index: -2; inset: 0; background: linear-gradient(0deg, rgba(3,4,5,.78), transparent 30%), linear-gradient(90deg, rgba(3,4,5,.2), transparent 35%); pointer-events: none; }
.view-switch { position: absolute; z-index: 2; top: 18px; left: 18px; display: inline-flex; gap: 3px; padding: 4px; border: 1px solid rgba(255,255,255,.22); background: rgba(9,11,13,.82); box-shadow: 0 8px 24px rgba(0,0,0,.2); backdrop-filter: blur(8px); }
.view-switch button { min-height: 34px; padding: 0 13px; border: 0; color: #c9ced2; background: transparent; font-size: .68rem; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; cursor: pointer; }
.view-switch button.active { color: #0b0e10; background: var(--accent); }
.view-switch button:disabled { opacity: .38; cursor: not-allowed; }
.view-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stage-labels { position: absolute; top: 18px; right: 18px; display: flex; gap: 7px; }
.stage-labels span { padding: 7px 9px; color: #d7dbde; background: rgba(9,11,13,.78); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); font-size: .64rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.truck-stage figcaption { position: absolute; left: 28px; right: 28px; bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.truck-stage figcaption span { color: #d2d7da; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.truck-stage figcaption strong { max-width: 54%; font-family: Impact, "Arial Black", sans-serif; font-size: clamp(1.8rem, 4vw, 4rem); line-height: .95; text-align: right; text-transform: uppercase; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #d9dde0; background: rgba(9,11,13,.72); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stage-loading[hidden] { display: none; }

.configuration-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #11161a;
}
.configuration-action small,
.configuration-action strong { display: block; }
.configuration-action small { color: var(--accent); font-size: .65rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.configuration-action strong { margin-top: 3px; color: var(--white); font-size: .86rem; }
.configuration-action .button { flex: 0 0 auto; min-height: 46px; padding: 11px 16px; font-size: .74rem; }

.layer-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: #0a0d10; }
.layer-strip div { min-width: 0; display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; padding: 17px 18px; border-right: 1px solid var(--line); }
.layer-strip div:last-child { border-right: 0; }
.layer-strip span { grid-row: 1 / span 2; color: var(--accent); font-size: .68rem; font-weight: 900; }
.layer-strip strong { font-size: .73rem; letter-spacing: .065em; text-transform: uppercase; }
.layer-strip small { color: var(--muted); font-size: .71rem; }

@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; gap: 18px; }
  .intro .eyebrow { margin-bottom: 0; }
  .configurator { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .selection-summary { display: grid; grid-template-columns: repeat(3, 1fr); }
  .selection-summary div { display: block; padding: 13px 10px; border-right: 1px solid var(--line); }
  .selection-summary div:last-child { border-right: 0; }
  .selection-summary dd { margin-top: 5px; text-align: left; }
}

@media (max-width: 620px) {
  .prototype-header, .prototype-shell { width: min(100% - 28px, 1440px); }
  .prototype-header { min-height: 72px; }
  .brand { width: 190px; }
  .prototype-state { font-size: .62rem; }
  .prototype-state { max-width: 116px; text-align: right; }
  .prototype-shell { padding-top: 34px; }
  .intro h1 { font-size: clamp(2.8rem, 15vw, 4.7rem); }
  .intro-copy > p:first-child { font-size: .95rem; }
  .control-panel { padding: 27px 20px; }
  .paint-panel { padding: 18px; }
  .paint-grid { grid-template-columns: 1fr; }
  .selection-summary { grid-template-columns: 1fr; }
  .selection-summary div { display: grid; border-right: 0; }
  .truck-stage { min-height: 0; aspect-ratio: 16 / 9; }
  .truck-render { object-position: 48% center; }
  .view-switch { top: 10px; left: 10px; padding: 3px; }
  .view-switch button { min-height: 30px; padding: 0 9px; font-size: .61rem; }
  .stage-labels { top: 12px; right: 12px; }
  .stage-labels { display: none; }
  .truck-stage figcaption { left: 18px; right: 18px; bottom: 18px; display: block; }
  .truck-stage figcaption strong { display: block; max-width: 100%; margin-top: 6px; text-align: left; }
  .layer-strip { grid-template-columns: 1fr; }
  .layer-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .layer-strip div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .truck-render { transition: none; }
}
