/* =====================================================================
   Colts Customs
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0d10;
  --bg-alt: #101317;
  --panel: rgba(14, 17, 21, .9);
  --fg: #e9eef2;
  --muted: #98a3af;
  --line: rgba(255, 255, 255, .1);
  --accent: #155224;               /* brand green: fills, buttons, active states */
  --accent-ink: #5cbf74;           /* lighter tint of the brand green for small text and thin marks on dark */
  --on-accent: #f2f7f3;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 80px);
  --header: 64px;
  --cut: 12px;                     /* angled corner size */
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: var(--header); }
body {
  background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* ---------- Shared type + components ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-ink);
}
.label {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  color: var(--muted); text-transform: uppercase;
}
.display {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  line-height: .86; letter-spacing: .005em;
}
.section-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 6vw, 72px); line-height: .92; margin: 10px 0 28px;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }

.btn {
  display: inline-block; padding: 14px 30px 14px 24px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: background .2s;
}
.btn:hover { background: #fff; }
.btn:focus-visible { background: #fff; }   /* clip-path hides the outline */

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.chips li {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 5px 10px;
  border: 1px solid var(--line); background: rgba(11, 13, 16, .55); color: var(--fg);
}
.price { font-family: var(--mono); font-size: 22px; }

/* Segmented control */
.seg { display: inline-flex; }
.seg button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 14px; cursor: pointer; color: var(--muted);
  background: rgba(14, 17, 21, .72); border: 1px solid var(--line); margin-left: -1px;
  transition: color .2s, background .2s;
}
.seg button:first-child { margin-left: 0; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Header + footer ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--header);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(11, 13, 16, .85), rgba(11, 13, 16, 0));
}
.brand {
  font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .04em;
  text-transform: uppercase; text-decoration: none;
}
.site-nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.site-nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--muted); padding: 8px 0;
}
.site-nav a:hover { color: var(--accent-ink); }
.site-footer {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center;
  padding: 28px var(--gutter); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.site-footer .brand { font-size: 18px; color: var(--fg); }

/* ---------- Carousel ---------- */
.carousel { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.carousel-track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: none; }
.slide {
  position: relative; flex: 0 0 100%; height: 100%; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.slide-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  transform: translateX(12%);
  /* The shifted image starts inside the slide: fade its left edge into the page */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22%);
}
.slide::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 13, 16, .9) 0%, rgba(11, 13, 16, .5) 30%, rgba(11, 13, 16, 0) 55%);
}
.slide-copy {
  position: absolute; z-index: 1; left: var(--gutter); top: 50%; transform: translateY(-50%);
  width: min(520px, 44vw); display: grid; gap: 14px; justify-items: start;
}
.slide-title { font-size: clamp(56px, 6.8vw, 112px); }
.slide-note { color: var(--muted); max-width: 40ch; }
.slide .price { margin-top: 2px; }
.price-list { list-style: none; padding: 0; display: grid; gap: 4px; min-width: 260px; font-family: var(--mono); }
.price-list li { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.price-list li span:first-child { color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; align-self: center; }
.price-list li span:last-child { font-size: 17px; }
.slide.is-active .slide-copy > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.slide.is-active .slide-copy > :nth-child(2) { animation-delay: .05s; }
.slide.is-active .slide-copy > :nth-child(3) { animation-delay: .1s; }
.slide.is-active .slide-copy > :nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.slide-soon { background: radial-gradient(60% 70% at 62% 50%, #1c222a 0%, var(--bg) 100%); }
.carousel-controls {
  position: absolute; z-index: 2; left: var(--gutter); bottom: clamp(20px, 5vh, 44px);
  display: flex; align-items: center; gap: 14px;
}
.arrow {
  width: 44px; height: 44px; cursor: pointer; font-size: 18px;
  background: rgba(14, 17, 21, .72); border: 1px solid var(--line);
}
.arrow:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.dots { display: flex; gap: 0; }
.dots button {
  width: 22px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; position: relative;
}
.dots button::before {
  content: ''; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; background: var(--line);
}
.dots button[aria-current='true']::before { background: var(--accent-ink); height: 3px; }

/* ---------- Level cards ---------- */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 32px; }
.level-card { background: var(--bg); padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; align-content: start; }
.level-card h3 { font-family: var(--display); font-size: 44px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.level-card .price { font-size: 18px; color: var(--accent-ink); }
.tick-list { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--fg); }
.tick-list li { display: flex; gap: 10px; }
.tick-list li::before { content: ''; flex: none; width: 10px; height: 1px; background: var(--accent-ink); transform: translateY(11px); }

/* ---------- Pack hero ---------- */
.pack-hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.pack-hero .slide-copy { top: 54%; }
.your-vehicle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-family: var(--mono); font-size: 13px; }
.your-vehicle .label { flex-basis: 100%; }
.your-vehicle a, .overlay-change { color: var(--accent-ink); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.overlay-change { display: block; width: max-content; margin-top: 6px; }

/* ---------- Select your vehicle ---------- */
.is-gate main > :not(#gate), .is-gate .site-footer, .is-gate .site-nav { display: none; }
body.is-gate { background: #070708; }
.gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 100svh; padding: var(--header) var(--gutter) 14vh;
}
.gate[hidden] { display: none; }
.gate-title {
  font-family: 'Michroma', var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(26px, 4.6vw, 64px); line-height: 1.15; letter-spacing: .01em;
  -webkit-text-stroke: .04em currentColor;   /* Michroma has one weight: thicken it to match the reference */
}
.gate-lead { margin-top: 12px; font-size: 14px; letter-spacing: .03em; color: var(--muted); }
.gate-box { position: relative; width: min(525px, 100%); margin-top: clamp(28px, 5vh, 40px); text-align: left; }
.gate-field { position: relative; }
.gate-field input {
  display: block; width: 100%; height: 62px; padding: 0 52px 0 22px; background: #161617;
  border: 0; border-bottom: 1px solid transparent; border-radius: 0; font-size: 17px; outline: none;
}
.gate-field input::placeholder { color: var(--muted); }
.gate-field input:focus { border-bottom-color: var(--accent-ink); }
.gate-field svg { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
/* Results drop over the page so the centred stack doesn't move as you type */
.gate-list { position: absolute; left: 0; right: 0; z-index: 1; list-style: none; padding: 0; background: #161617; border: 1px solid var(--line); border-top: 0; }
.gate-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 10px 22px; cursor: pointer;
}
.gate-list li + li { border-top: 1px solid var(--line); }
.gate-list li.on { background: #13241a; }
.gate-list strong { display: block; font-weight: 500; }
.gate-list small { display: block; margin-top: 3px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gate-arrow { color: var(--accent-ink); font-size: 18px; }
.gate-empty { position: absolute; left: 0; right: 0; margin-top: 12px; font-size: 14px; color: var(--muted); }

.pack-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 13, 16, .9) 0%, rgba(11, 13, 16, .5) 30%, rgba(11, 13, 16, 0) 55%);
}

/* ---------- Pinned showcase ---------- */
.showcase { position: relative; height: 100svh; overflow: hidden; background: var(--bg); }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 13, 16, .9) 0%, rgba(11, 13, 16, .55) 30%, rgba(11, 13, 16, 0) 54%);
}
.showcase-controls {
  position: absolute; z-index: 3; left: var(--gutter); top: calc(var(--header) + 8px);
  display: flex; flex-wrap: wrap; gap: 10px;
}
.overlay {
  position: absolute; z-index: 2; left: var(--gutter); top: calc(50% + 28px); transform: translateY(-50%);
  width: min(420px, 38vw);
}
.level { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(56px, 7vw, 104px); line-height: .84; margin: 8px 0 10px; }
.level.swap { animation: rise .5s cubic-bezier(.2, .7, .2, 1); }
.caption { color: var(--muted); font-size: 15px; max-width: 34ch; }
.overlay .price { margin: 14px 0 12px; }
.features { list-style: none; padding: 0; display: grid; gap: 6px; font-family: var(--mono); font-size: 12.5px; }
.features li {
  display: flex; gap: 10px; align-items: baseline;
  animation: unlock .55s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i) * 70ms);
}
.features li::before { content: ''; flex: none; width: 10px; height: 1px; background: var(--accent-ink); transform: translateY(-4px); }
.features .new { color: var(--accent-ink); font-size: 10px; letter-spacing: .14em; }
@keyframes unlock { from { opacity: 0; transform: translateX(-14px); } }

.readout { display: flex; gap: 28px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.tint-num { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 6px; }
.tint-num small { font-size: 20px; color: var(--muted); }
.meter { flex: 1; min-width: 120px; }
.meter-track { position: relative; height: 6px; background: var(--line); margin-top: 18px; }
.meter-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.meter-ticks { display: flex; margin-top: 6px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.meter-ticks span { flex: 1; text-align: right; }

.rail { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); height: 44vh; width: 2px; background: var(--line); }
.rail-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.rail-mark { position: absolute; right: 12px; transform: translateY(-50%); font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.rail-mark.on { color: var(--accent-ink); }

/* ---------- Try it on ---------- */
.try-on { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.try-stage { aspect-ratio: 16 / 9; background: var(--bg-alt); }
.try-stage canvas { width: 100%; height: 100%; }
.try-panel { display: grid; gap: 16px; justify-items: start; }
.try-panel .section-title { margin: 0; font-size: clamp(36px, 4.4vw, 56px); }
.try-row { display: grid; gap: 6px; }

/* ---------- Single-level edition details ---------- */
.details { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); }
.details .tick-list { font-size: 16px; margin-bottom: 20px; }
.option-group + .option-group { margin-top: 28px; }
.option-group .label { margin-bottom: 10px; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border: 1px solid var(--line); vertical-align: -1px; }

/* ---------- Enquiry ---------- */
.enquire { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.enquire p.lead { color: var(--muted); max-width: 38ch; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  font-family: var(--sans); font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--fg);
  width: 100%; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 0;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent-ink); outline: none; }
.form .btn { justify-self: start; }
.form-note { grid-column: 1 / -1; color: var(--accent-ink); font-size: 14px; min-height: 1.5em; }

/* ---------- Edition prev/next ---------- */
.pack-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pack-nav a { padding: 28px var(--gutter); text-decoration: none; display: grid; gap: 4px; }
.pack-nav a + a { border-left: 1px solid var(--line); text-align: right; }
.pack-nav a:hover strong { color: var(--accent-ink); }
.pack-nav strong { font-family: var(--display); font-size: clamp(24px, 3.4vw, 36px); text-transform: uppercase; line-height: 1; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .level-grid, .details, .enquire, .try-on { grid-template-columns: 1fr; }
}

/* ---------- Mobile: image above, copy below ---------- */
@media (max-width: 760px) {
  :root { --header: 56px; }
  .brand { font-size: 20px; }
  .site-nav a { font-size: 10px; letter-spacing: .1em; }

  .slide-img {
    inset: auto; top: 11%; left: -19%; width: 138%; max-width: none; height: auto;
    aspect-ratio: 16 / 9; transform: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 80%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 80%, transparent 100%);
  }
  .slide::after, .pack-hero::after { background: linear-gradient(0deg, rgba(11, 13, 16, 1) 0%, rgba(11, 13, 16, .85) 40%, rgba(11, 13, 16, 0) 62%); }
  .slide-copy, .pack-hero .slide-copy {
    top: auto; bottom: 88px; right: var(--gutter); width: auto; transform: none; gap: 10px;
  }
  .slide-title { font-size: clamp(52px, 15vw, 72px); }
  .slide-note { font-size: 14px; }
  .pack-hero .slide-copy { bottom: 28px; }
  .carousel-controls { right: var(--gutter); justify-content: space-between; bottom: 20px; gap: 6px; }
  .dots button { width: 16px; }

  .scrim { background: linear-gradient(0deg, rgba(11, 13, 16, .97) 0%, rgba(11, 13, 16, .8) 46%, rgba(11, 13, 16, 0) 64%); }
  .showcase-controls { right: var(--gutter); gap: 6px; }
  .seg button { padding: 12px 11px; font-size: 10px; letter-spacing: .06em; }   /* ~40px tall: easy to tap */
  .overlay { top: auto; bottom: 16px; left: var(--gutter); right: var(--gutter); width: auto; transform: none; }
  .level { font-size: 56px; margin: 4px 0; }
  .caption { font-size: 13px; }
  .overlay .price { font-size: 18px; margin: 6px 0 8px; }
  .features { grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 10.5px; }
  .readout { margin-top: 10px; padding-top: 8px; }
  .tint-num { font-size: 28px; }
  .rail { display: none; }

  .form { grid-template-columns: 1fr; }
  .form label, .form .full { grid-column: auto; }

  /* While typing, the keyboard covers the lower half: move the search up so
     the results stay visible above it */
  .gate:focus-within { justify-content: flex-start; padding-top: calc(var(--header) + 20px); }
}

/* Short laptop screens: keep the level list clear of the controls */
@media (min-width: 761px) and (max-height: 680px) {
  .overlay .caption { display: none; }
  .level { font-size: clamp(48px, 6vw, 80px); }
  .readout { margin-top: 10px; padding-top: 10px; }
}

/* Short phones: drop the caption so the car keeps its space */
@media (max-width: 760px) and (max-height: 700px) {
  .overlay .caption { display: none; }
  .readout { display: none; }
  /* Home slides: the price list is taller than one price, so drop the tags
     and lift the car so the copy clears it */
  .slide .chips, .pack-hero .chips { display: none; }
  .slide .slide-img, .pack-hero .slide-img { top: 7%; }
  .slide .slide-title, .pack-hero .slide-title { font-size: clamp(46px, 13vw, 60px); }
  .pack-hero .slide-copy { gap: 8px; }
  .price-list { gap: 2px; }
  .price-list li { padding-bottom: 2px; }
  .price-list li span:last-child { font-size: 15px; }
}

/* ---------- Reduced motion: simple fades only ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .features li, .level.swap, .slide.is-active .slide-copy > * { animation-name: fade; animation-delay: 0s; }
  @keyframes fade { from { opacity: 0; } }
}

/* ---------- Page crossfade ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: .7s; animation-timing-function: cubic-bezier(.4, 0, .2, 1);
  }
  /* Browsers without page transitions still fade the new page in */
  @supports not selector(::view-transition) {
    body { animation: page-in .7s ease-out both; }
    @keyframes page-in { from { opacity: 0; } }
  }
}
