/* ==========================================================================
   CYR Garage site. Built on brand.css: only brand variables, no raw colours.
   ========================================================================== */

/* ---------- Hero ---------- */
.hero { padding: var(--s-4) 0 var(--s-8); }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; }
.top-mark { font-size: 40px; }
.top-mail { font-size: var(--fs-small); }
.hero-label { margin-top: var(--s-6); }
.hero-title {
  margin-top: var(--s-4); font-weight: 900;
  font-size: clamp(40px, 4.75vw, 72px); line-height: .98; letter-spacing: -.035em;
}
.hero-title .line { display: block; }
.hero-title .line > span { display: inline-block; }
.hero-row { display: grid; grid-template-columns: 1fr; gap: var(--s-6); margin-top: var(--s-6); }
.hero-copy { display: grid; gap: var(--s-5); align-content: start; max-width: 34em; }
.hero-copy p { text-wrap: pretty; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-photo { margin-inline: calc(var(--margin) * -1); }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--gunmetal); }
.coverage-map { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.map { width: 100%; height: auto; }
.map .city text { fill: var(--text); }
/* Labels get a halo in the ground colour so lines never run through them. */
.map text { paint-order: stroke; stroke: var(--ground); stroke-width: 6px; stroke-linejoin: round; }
@media (max-width: 1023px) { .map text { font-size: 15px; } }
@media (min-width: 1024px) { .map text { font-size: 13px; } }
@media (min-width: 1024px) {
  .hero-row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: var(--s-6); }
  .hero-copy { grid-column: 1 / span 4; align-self: end; }
  .hero-photo { grid-column: 5 / span 8; margin-inline: 0; }
  /* Shorter screens: the photo gives up height so the buttons stay above the fold. */
  .hero-photo img { border-radius: var(--radius-md); aspect-ratio: auto; height: min(56.25vw * 8 / 12, 100dvh - 400px); min-height: 300px; }
}

/* Headline wipes open from the cut line; the map's routes draw out from the base. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .line > span { animation: wipe 1.1s var(--ease) both; }
  .js .hero-title .line:nth-child(2) > span { animation-delay: .12s; }
  .js .hero-title .cut-word::after { animation: cut .9s var(--ease) .7s both; transform-origin: left; }
  .js .hero-photo img { animation: wipe 1.3s var(--ease) .25s both; }
  .js .coverage-map .route { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease); }
  .js .coverage-map.in .route { stroke-dashoffset: 0; }
  /* nth-of-type counts every path: the shore and the state line come first, then the routes. */
  .js .coverage-map .route:nth-of-type(4) { transition-delay: .1s; }
  .js .coverage-map .route:nth-of-type(5) { transition-delay: .2s; }
  .js .coverage-map .route:nth-of-type(6) { transition-delay: .3s; }
}
@keyframes wipe { from { clip-path: inset(47% 0 53% 0); } to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes cut { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Scroll reveal (only when JS runs and motion is allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Fleet ---------- */
.fleet { padding: var(--s-9) 0 var(--s-8); }
.sec-head { display: grid; gap: var(--s-3); max-width: 40em; margin-bottom: var(--s-6); }
.cars { display: grid; grid-template-columns: 1fr; gap: var(--s-6) var(--gutter); }
.car { display: grid; gap: var(--s-3); align-content: start; }
.car-photo { position: relative; overflow: hidden; border-radius: var(--radius-md); aspect-ratio: 16 / 10;
  /* Dark field inside a light section: reset the roles to dark. */
  --text-muted: var(--aluminium); --line-soft: var(--slate); --line: var(--hairline); }
button.car-photo { display: block; width: 100%; padding: 0; border: 0; background: var(--steel); cursor: zoom-in; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { button.car-photo:hover img { transform: scale(1.03); } }
button.car-photo:focus-visible { outline: 2px solid var(--gunmetal); outline-offset: 3px; }
/* Placeholder until photos arrive: a viewfinder frame. */
.ph {
  position: absolute; inset: var(--s-4); display: flex; align-items: flex-end;
  --c: var(--line-soft); --k: 22px;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--k) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px var(--k) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--k) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px var(--k) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--k) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px var(--k) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--k) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px var(--k) no-repeat,
    linear-gradient(var(--c), var(--c)) center / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) center / 1px 18px no-repeat;
}
.ph .label { padding: var(--s-3); }
.car-body { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.car-body .label { margin-top: var(--s-2); }
.facts { margin-top: var(--s-1); font-size: var(--fs-small); color: var(--text-muted); }

.add {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-size: var(--fs-small); font-weight: 600; font-stretch: 112.5%; white-space: nowrap;
  background: transparent; color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.add:hover { box-shadow: inset 0 0 0 1px var(--line); }
.add:active { transform: translateY(1px) scale(.985); }
.add .add-off { display: none; }
.add[aria-pressed="true"] { background: var(--text-strong); color: var(--ground); box-shadow: none; }
.add[aria-pressed="true"] .add-on { display: none; }
.add[aria-pressed="true"] .add-off { display: inline; }

@media (min-width: 768px) {
  .cars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:not(.js) .cars > .car:first-child, .js .cars > .car[data-first] { grid-column: 1 / -1; }
  .car-photo { aspect-ratio: auto; height: clamp(260px, 30vw, 420px); }
}
/* Desktop: first row 7 + 5, then rows of three. The last row fills itself:
   one leftover car spans the full width, two leftovers split 5 + 7. Works for any count. */
@media (min-width: 1024px) {
  .cars { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .cars > .car { grid-column: span 4; }
  /* Without JavaScript the pattern comes from position; with it, site.js sets data-span on visible cards. */
  html:not(.js) .cars > .car:first-child { grid-column: span 7; }
  html:not(.js) .cars > .car:nth-child(2) { grid-column: span 5; }
  html:not(.js) .cars > .car:nth-child(3n+3):last-child { grid-column: span 12; }
  html:not(.js) .cars > .car:nth-child(3n+3):nth-last-child(2) { grid-column: span 5; }
  html:not(.js) .cars > .car:nth-child(3n+4):last-child { grid-column: span 7; }
  .js .cars > .car[data-span="4"] { grid-column: span 4; }
  .js .cars > .car[data-span="5"] { grid-column: span 5; }
  .js .cars > .car[data-span="7"] { grid-column: span 7; }
  .js .cars > .car[data-span="12"] { grid-column: span 12; }
}

/* Filter: same control language as the Add to quote buttons. */
.filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: calc(var(--s-6) * -1 + var(--s-4)) 0 var(--s-6); }
.filter[hidden], .car[hidden], .garage-more[hidden], .g-nav[hidden] { display: none; }
.filter button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-size: var(--fs-small); font-weight: 600; font-stretch: 112.5%;
  background: transparent; color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.filter button:hover { box-shadow: inset 0 0 0 1px var(--line); }
.filter button:active { transform: translateY(1px) scale(.985); }
.filter button[aria-pressed="true"] { background: var(--text-strong); color: var(--ground); box-shadow: none; }
.filter .num { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; opacity: .7; }

/* Vehicles without photos yet: a compact grid under the photo cards. */
.garage-more { margin-top: var(--s-8); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.more-grid { display: grid; grid-template-columns: 1fr; gap: var(--gutter); margin-top: var(--s-4); }
.car-more { padding: var(--s-4); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--rule); }
.car-more { min-width: 0; }
.car-more .car-body { height: 100%; flex-direction: column; justify-content: space-between; gap: var(--s-4); }
.car-more h3 { font-size: clamp(20px, 1.6vw, 24px); }
@media (min-width: 640px) { .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- How a booking works ---------- */
.process { padding: var(--s-8) 0 var(--s-9); }
.process-title { margin-bottom: var(--s-6); max-width: 12em; }
.steps { display: grid; gap: var(--s-5); }
.step { position: relative; display: grid; gap: var(--s-2); align-content: start; padding-left: var(--s-5); max-width: 28em; }
.step p { color: var(--text-muted); }
/* Linework: a rail with a node per step; the last node carries the Floor Line. */
.step::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: calc(var(--s-5) * -1); width: 1px; background: var(--line-soft); }
.step:last-child::before { display: none; }
.step::after { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.25px var(--line); background: var(--ground); }
.step-hot::after { background: var(--floor-line); box-shadow: 0 0 0 5px var(--ground), 0 0 0 6.5px var(--floor-line); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gutter); }
  .step { padding-left: 0; padding-top: var(--s-5); }
  .step::before { left: 6px; right: calc(var(--gutter) * -1); top: 5px; bottom: auto; width: auto; height: 1px; }
  .step::after { top: 0; }
}

/* ---------- Shoot types: photo band ----------
   House treatment: greyscale, with the cut through the photo in the ground colour. */
.band { padding: 0 0 var(--s-8); }
.band-photo { position: relative; overflow: hidden; background: var(--gunmetal); }
.band-photo img { width: 100%; height: clamp(160px, 42vw, 640px); object-fit: cover; filter: grayscale(1) contrast(1.08); }
.band-cut { position: absolute; left: 0; right: 0; top: 47%; height: clamp(6px, .9vw, 14px); background: var(--ground); transform-origin: left; }
@media (prefers-reduced-motion: no-preference) {
  .js .band-cut { transform: scaleX(0); transition: transform 1.4s var(--ease); }
  .js .band-photo.in .band-cut { transform: scaleX(1); }
}
.band-copy { margin-top: var(--s-6); }
.uses-title { color: var(--text-muted); }
.use-list { display: flex; flex-wrap: wrap; column-gap: .45em; margin-top: var(--s-3); max-width: 22em;
  font-family: var(--font-display); font-weight: 800; font-stretch: 125%;
  font-size: clamp(24px, 3.9vw, 56px); line-height: 1.15; letter-spacing: var(--tr-heading); color: var(--text-strong); }
.use-list li:not(:last-child)::after { content: "/" / ""; margin-left: .45em; color: var(--line-soft); font-weight: 400; }

/* ---------- Quote ---------- */
.quote { padding: var(--s-8) 0 var(--s-7); }
.quote-grid { display: grid; gap: var(--s-6); }
.quote-intro { display: grid; gap: var(--s-4); align-content: start; }
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--gutter); margin: var(--s-4) 0 0; padding-top: var(--s-4); box-shadow: inset 0 1px 0 var(--rule); }
.terms div { display: grid; gap: var(--s-1); align-content: start; }
.terms dd { margin: 0; color: var(--text-strong); font-weight: 500; }
.quote-panel { background: var(--gunmetal-raised); border-radius: var(--radius-lg); padding: var(--s-4); }
@media (min-width: 768px) { .quote-panel { padding: var(--s-5); } }
@media (min-width: 1024px) {
  .quote-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .quote-intro { grid-column: 1 / span 4; position: sticky; top: var(--s-5); }
  .quote-panel { grid-column: 6 / span 7; }
}

.form { display: grid; gap: var(--s-4) var(--gutter); }
@media (min-width: 640px) { .form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-wide { grid-column: 1 / -1; } }
.field { display: grid; gap: var(--s-2); align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend { font-weight: 600; font-size: 15px; color: var(--text-strong); padding: 0; }
.field legend { margin-bottom: var(--s-2); }
.opt { font-weight: 400; color: var(--text-muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--ground); color: var(--text-strong); font: inherit; font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--text-muted); transition: box-shadow .2s var(--ease);
  color-scheme: dark;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(-45deg, transparent 50%, var(--text-muted) 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:hover, .field select:hover, .field textarea:hover { box-shadow: inset 0 0 0 1px var(--line); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--floor-line); }
.field [aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--error); }
.help { font-size: var(--fs-small); color: var(--text-muted); }
.err { font-size: var(--fs-small); color: var(--error); }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-small); font-weight: 500; color: var(--text); box-shadow: inset 0 0 0 1px var(--text-muted);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.chip span:hover { box-shadow: inset 0 0 0 1px var(--line); }
.chip input:checked + span { background: var(--text-strong); color: var(--ground); box-shadow: none; }
.chip input:focus-visible + span { outline: 2px solid var(--floor-line); outline-offset: 2px; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.form-status { font-size: var(--fs-small); color: var(--text-muted); }
.form-status.is-error { color: var(--error); }
.form[aria-busy="true"] button[type="submit"] { opacity: .6; pointer-events: none; }

.sent[hidden], .form[hidden] { display: none; }
.sent { display: grid; gap: var(--s-3); padding: var(--s-6) 0; }
.sent:focus { outline: none; }
.sent b { color: var(--text-strong); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Photo viewer ---------- */
.gallery {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  grid-template-rows: auto minmax(0, 1fr) auto; overscroll-behavior: contain;
}
.gallery[open] { display: grid; }
.gallery::backdrop { background: var(--steel); }
.g-head, .g-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-3); }
.g-count { margin-top: var(--s-1); }
.g-stage { position: relative; min-height: 0; touch-action: pan-y; }
.g-img { position: absolute; inset: 0 var(--margin); width: calc(100% - 2 * var(--margin)); height: 100%; object-fit: contain; }
@media (prefers-reduced-motion: no-preference) {
  .g-img { animation: g-in .5s var(--ease); }
  .gallery[open] { animation: g-in .4s var(--ease); }
}
@keyframes g-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Phone-only quote button ---------- */
.sticky-cta { display: none; }
@media (max-width: 767px) {
  .js .sticky-cta {
    display: inline-flex; position: fixed; z-index: 30; left: var(--margin); right: var(--margin); bottom: 16px; justify-content: space-between;
    box-shadow: 0 0 0 1px var(--steel); transform: translateY(calc(100% + 24px)); visibility: hidden;
    transition: transform .5s var(--ease), visibility 0s linear .5s;
  }
  .js .sticky-cta.on { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
  .foot { padding-bottom: calc(var(--s-5) + 72px); }
}

/* ---------- Footer ---------- */
.foot { padding: var(--s-7) 0 var(--s-5); box-shadow: inset 0 1px 0 var(--rule); }
.foot-mark { font-size: clamp(96px, 13vw, 190px); }
.foot-row { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-top: var(--s-6); font-size: var(--fs-small); }
.foot-row p:last-child { margin-left: auto; }
@media (max-width: 767px) { .foot-row { flex-direction: column; align-items: flex-start; } .foot-row p:last-child { margin-left: 0; } }

/* ---------- Thanks page ---------- */
.thanks { min-height: 100dvh; display: grid; align-content: center; gap: var(--s-4); padding-block: var(--s-7); }
