:root {
  --yellow: #fddc00;
  --ink: #141516;
  --muted: #666b73;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #f6f7f8;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  background: #f3f4f5;
  color: var(--ink);
  font-family: "Poppins", system-ui, sans-serif;
}

button, input { font: inherit; }

.simulator {
  width: min(1380px, calc(100% - 32px));
  margin: 24px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid rgba(20, 21, 22, .08);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(12, 17, 24, .10);
  overflow: hidden;
}

.simulator__header {
  padding-top: 18px;
  margin-bottom: 10px;
}
h1 { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.05; letter-spacing: -.045em; }
.intro { margin: 8px 0 0; color: var(--muted); font-size: clamp(15px, 1.8vw, 21px); }

.simulator__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, .85fr);
  gap: 26px;
  align-items: stretch;
}

.preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preview__stage {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 48% 62%, #fff 0 46%, #f5f6f7 82%, #eceef0 100%);
  isolation: isolate;
}

.vehicle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vehicle { transition: opacity .2s ease; }
.vehicle--base { z-index: 1; }
.vehicle--tinted {
  z-index: 2;
  clip-path: inset(0 0 0 var(--split));
}
.vehicle.is-changing { opacity: .55; }

.split-line {
  position: absolute;
  top: 9%;
  bottom: 8%;
  left: var(--split);
  width: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 21, 22, .14), 0 4px 18px rgba(0,0,0,.2);
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.split-line span {
  position: absolute;
  left: 50%;
  top: 52%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: #17181a;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  transform: translate(-50%, -50%);
  font-weight: 700;
}

.split-control {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
}

.split-control:focus-visible + * { outline: 3px solid var(--yellow); }

.preview__label {
  position: absolute;
  top: 7%;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(20,21,22,.86);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.preview__label--before { left: 17%; }
.preview__label--after { right: 14%; }
.preview__hint { margin: 10px 0 0; text-align: center; color: #777c83; font-size: 12px; }
.preview__hint span { color: #111; font-weight: 700; }

.controls {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #f9fafb);
}

fieldset { margin: 0; padding: 0; border: 0; }
.control-group + .control-group { margin-top: 22px; }
legend { margin-bottom: 10px; padding: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f3f4;
}

.segmented button,
.tone-options button {
  border: 0;
  color: #222;
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}

.segmented button {
  min-height: 42px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.segmented button[aria-pressed="true"] {
  background: #17181a;
  color: #fff;
  box-shadow: 0 0 0 2px var(--yellow), 0 7px 15px rgba(0,0,0,.14);
}

.tone-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.tone-options button {
  min-height: 53px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.tone-options strong,
.tone-options small { display: block; }
.tone-options strong { font-size: 12px; }
.tone-options small { margin-top: 2px; color: #747981; font-size: 9px; }
.tone-options button[aria-pressed="true"] { border-color: #17181a; background: #17181a; color: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.tone-options button[aria-pressed="true"] small { color: #e7e7e7; }

.color-options { display: flex; gap: 14px; align-items: center; }
.color {
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px #d3d6da, 0 5px 12px rgba(0,0,0,.1);
  transition: .2s ease;
}
.color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--yellow), 0 8px 17px rgba(0,0,0,.14); transform: scale(1.06); }
.color--black { background: #121416; }
.color--graphite { background: linear-gradient(145deg, #8b8f94, #34373b); }
.color--white { background: #f4f4f2; }
.color--blue { background: #173e79; }
.color--red { background: #d91c23; }

.film-card {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(224, 188, 0, .7);
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf1, #fff);
}
.film-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.film-card__badge { margin: 0 0 4px; color: #8c7400; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.film-card h2 { margin: 0; font-size: 19px; line-height: 1.2; }
.film-card > p { margin: 10px 0 16px; color: #5f646b; font-size: 12px; line-height: 1.55; }
.film-card__dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 6px rgba(253,220,0,.18); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); }
.metric strong, .metric span, .metric small { display: block; }
.metric strong { font-size: 22px; line-height: 1.05; }
.metric small { margin-bottom: 1px; font-size: 8px; font-weight: 700; }
.metric span { margin-top: 4px; font-size: 9px; font-weight: 600; line-height: 1.15; }

.precision-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 9px;
  padding: 11px 13px;
  border: 1px solid rgba(224, 188, 0, .55);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(253,220,0,.13), rgba(255,255,255,.96));
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}
.precision-feature__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--yellow);
  color: #111;
  font-size: 13px;
}

.information {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 24px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8f9fa;
}
.information__icon { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); font-weight: 800; }
.information p { margin: 0; color: #4f545b; font-size: 12px; line-height: 1.5; }
.disclaimer { margin: 8px 0 0; text-align: center; color: #8a8f95; font-size: 9px; }

button:focus-visible,
input:focus-visible { outline: 3px solid rgba(253,220,0,.72); outline-offset: 3px; }

@media (max-width: 900px) {
  .simulator { width: min(100% - 20px, 720px); margin: 10px auto; padding: 20px; border-radius: 22px; }
  .simulator__header { padding-top: 8px; margin-bottom: 10px; }
  .simulator__grid { grid-template-columns: 1fr; gap: 16px; }
  .controls { padding: 18px; }
  .preview__label { top: 5%; padding: 6px 9px; font-size: 9px; }
  .preview__label--before { left: 8%; }
  .preview__label--after { right: 7%; }
}

@media (max-width: 520px) {
  body { background: #fff; }
  .simulator { width: 100%; margin: 0; padding: 16px; border: 0; border-radius: 0; box-shadow: none; }
  h1 { font-size: 31px; }
  .intro { font-size: 14px; }
  .preview__stage { border-radius: 16px; }
  .preview__hint { font-size: 10px; }
  .controls { padding: 14px; border-radius: 18px; }
  .control-group + .control-group { margin-top: 18px; }
  .segmented button { min-height: 38px; font-size: 10px; }
  .tone-options { gap: 5px; }
  .tone-options button { min-height: 48px; border-radius: 11px; }
  .tone-options strong { font-size: 10px; }
  .tone-options small { font-size: 8px; }
  .color-options { gap: 12px; }
  .color { width: 37px; height: 37px; }
  .film-card { padding: 15px; }
  .film-card h2 { font-size: 17px; }
  .metric { min-height: 70px; padding: 10px; }
  .metric strong { font-size: 19px; }
  .information { align-items: flex-start; margin-top: 16px; padding: 12px; }
  .information__icon { width: 27px; height: 27px; }
  .information p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
