/* Marshall Electrical Services
   Colours sampled from Marshall's logo: navy disc, deep bolt blue, bright bolt blue.
   White is the working surface. Navy is reserved for the hero, the work band and
   the footer. Bright blue only ever sits on navy. No gradients. */

:root {
  --white: #FFFFFF;
  --tint: #F2F5F9;
  --sea: #DCE5F0;
  --line: #D7DFE9;
  --navy: #0F2137;
  --navy-raise: #18304D;
  --ink: #0F2137;
  --ink-soft: #4A5A6E;
  --blue: #1860B8;
  --blue-press: #134E96;
  --blue-soft: #E6EFFA;
  --bright: #10A0E8;
  --highlight: #4ADBEC;
  --on-navy: #FFFFFF;
  --on-navy-soft: rgba(255, 255, 255, 0.78);

  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  --text-h3: clamp(1.3rem, 1.15rem + 0.55vw, 1.625rem);
  --text-h2: clamp(2.125rem, 1.35rem + 3vw, 4rem);
  --text-h1: clamp(2.75rem, 1.5rem + 5vw, 6rem);

  --space-section: clamp(5.5rem, 3.75rem + 7.75vw, 11rem);
  --wrap: 78rem;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.75rem);
  --nav-h: 72px;
  --r-btn: 6px;
  --r-card: 10px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-fast: 160ms;
  --dur: 240ms;
  --dur-reveal: 380ms;
  --dur-lift: 200ms;
  --lift: 0 14px 32px -12px rgba(15, 33, 55, 0.28), 0 3px 8px -2px rgba(15, 33, 55, 0.1);
  --lift-dark: 0 22px 44px -14px rgba(3, 9, 18, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--font); font-size: var(--text-base); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
h2 { line-height: 1.08; }
h3 { line-height: 1.2; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hero :focus-visible, .section-navy :focus-visible, .site-footer :focus-visible, .lightbox :focus-visible { outline-color: var(--highlight); }

.skip-link {
  position: absolute; left: 1rem; top: 0.75rem; z-index: 100;
  padding: 0.75rem 1rem; background: var(--navy); color: var(--white);
  text-decoration: none; transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }
section[id], main[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.8rem 1.35rem;
  border: 1.5px solid transparent; border-radius: var(--r-btn);
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; background: transparent; position: relative;
  transition: transform var(--dur-lift) var(--ease-out), background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-on-dark { border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--blue-press); }
  .btn-ghost:hover { background: var(--ink); color: var(--white); }
  .btn-on-dark:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
  .btn:hover { transform: translateY(-2px); }
  .btn:hover:active { transform: translateY(-1px) scale(0.97); }
}

/* Hover lift: the shadow sits on a pseudo-element and only fades in, so the
   motion stays on transform and opacity. */
.btn::after, .contact-card::after, .service::after, .slide::before, .tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: var(--lift); opacity: 0; transition: opacity var(--dur-lift) var(--ease-out);
}
.hero .btn::after, .slide::before { box-shadow: var(--lift-dark); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover::after, .contact-card:hover::after, .service:hover::after, .slide:hover::before, .tile:hover::before { opacity: 1; }
}

/* Action chips: every text link that leads somewhere looks tappable */
.chip {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px;
  padding: 0.65rem 0.85rem 0.65rem 0.95rem; border-radius: var(--r-btn);
  background: var(--blue-soft); color: var(--blue);
  font-weight: 600; font-size: 0.9875rem; line-height: 1.2; text-decoration: none;
  transition: background-color var(--dur) ease, color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.chip svg, .card-action svg {
  width: 1.05rem; height: 1.05rem; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur) var(--ease-out);
}
.chip:active { transform: scale(1.02); }
.chip-on-dark { background: rgba(255, 255, 255, 0.12); color: var(--white); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { background: var(--blue); color: var(--white); }
  .chip:hover svg { transform: translateX(4px); }
  .chip-on-dark:hover { background: var(--white); color: var(--navy); }
}

/* ---------- Navigation ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.nav-links { display: none; align-items: center; gap: 0.25rem; }
.nav-links a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.8rem;
  border-radius: var(--r-btn); text-decoration: none; font-weight: 500;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.nav-links a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:not(.btn):hover { background: var(--blue-soft); color: var(--blue); }
}
.nav-links .btn { margin-left: 0.5rem; min-height: 44px; }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1.5px solid var(--ink); border-radius: var(--r-btn); background: transparent; cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--white); padding: 0.5rem var(--gutter) 1.25rem; }
.mobile-menu.is-open { display: block; }
.mobile-menu a:not(.btn) {
  display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line);
  text-decoration: none; font-weight: 500; font-size: 1.125rem;
}
.mobile-menu a[aria-current="page"] { color: var(--blue); font-weight: 600; }
.mobile-menu .btn { margin-top: 1rem; width: 100%; }
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .menu-toggle, .mobile-menu, .mobile-menu.is-open { display: none; }
}

/* ---------- Section scaffolding ---------- */
.section { padding-block: var(--space-section); }
.section-tint { background: var(--tint); }
.section-navy { background: var(--navy); color: var(--on-navy); }
.eyebrow { font-weight: 600; font-size: 1rem; color: var(--blue); }
.section-navy .eyebrow { color: var(--bright); }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 1.6rem + 3vw, 4.5rem); }
.section-head h2 { font-size: var(--text-h2); max-width: 17ch; }
.section-head p:not(.eyebrow) { max-width: 52ch; color: var(--ink-soft); font-size: var(--text-lead); }
.section-navy .section-head p:not(.eyebrow) { color: var(--on-navy-soft); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: max(560px, calc(100svh - var(--nav-h)));
  display: flex; align-items: flex-end;
  background: var(--navy); color: var(--on-navy);
}
.hero-media { position: absolute; inset: 0; z-index: -1; will-change: transform; }
.hero-frames { position: absolute; inset: 0; }
.hero-frame { position: absolute; inset: 0; opacity: 0; transition: opacity 400ms var(--ease-out); }
.hero-frame.is-active { opacity: 1; }
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }
/* Flat navy wash plus one blurred navy mass bottom-left, so the copy always reads. */
.hero-media::after { content: ""; position: absolute; inset: 0; background: rgba(15, 33, 55, 0.3); }
.hero-shade {
  position: absolute; left: -18%; bottom: -30%; width: 100%; height: 95%; z-index: 1;
  background: var(--navy); opacity: 0.86; filter: blur(70px); border-radius: 50%;
}
/* The logo's hexagon and bolt, oversized and near-invisible: texture over the
   navy shade, not a decoration. */
.hero::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: -6%; bottom: -22%; width: min(78vw, 980px); aspect-ratio: 410 / 490;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 410 490'%3E%3Cpath d='M200 8L398 118V312L200 420L12 312V118Z' fill='none' stroke='%23fff' stroke-width='16' stroke-linejoin='round'/%3E%3Cpath d='M170 25L245 20L200 160L300 150L140 480L190 245H105Z' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0.04;
}
.hero-inner {
  position: relative; display: grid; gap: 2rem; align-items: end;
  padding-block: clamp(5rem, 3rem + 8vw, 8rem) clamp(2.25rem, 1.5rem + 3vw, 4rem);
}
.hero h1 { font-size: var(--text-h1); max-width: 15ch; }
.hero-line { display: block; }
/* A ch cap is measured in the h1's own font, so keep the town line whole instead. */
@media (min-width: 640px) { .hero h1 .hero-line + .hero-line { white-space: nowrap; } }
.hero-lede { margin-top: 1.5rem; max-width: 40ch; font-size: var(--text-lead); color: var(--on-navy-soft); }
.hero-side { display: grid; gap: 1.25rem; justify-items: start; }
.coc-chip {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 40px; padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--bright); border-radius: var(--r-btn);
  font-weight: 600; font-size: 0.9875rem; background: rgba(15, 33, 55, 0.55);
}
.coc-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--highlight); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-controls { display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 22rem; }
.hero-pause {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border: 1.5px solid rgba(255, 255, 255, 0.6); border-radius: var(--r-btn);
  background: transparent; color: var(--white); cursor: pointer;
}
.hero-pause svg { width: 16px; height: 16px; }
.hero-pause .i-play, .hero.is-paused .hero-pause .i-pause { display: none; }
.hero.is-paused .hero-pause .i-play { display: block; }
.hero-progress { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg { height: 3px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.seg span { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }
.seg.is-done span { transform: scaleX(1); }
.seg.is-running span { animation: seg-fill 5500ms linear forwards; }
.hero.is-held .seg.is-running span { animation-play-state: paused; }
@keyframes seg-fill { to { transform: scaleX(1); } }
@media (min-width: 900px) {
  /* 1.6fr keeps the nowrap town line inside the copy column at 1440. */
  .hero-inner { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 3rem; }
  .hero-side { justify-items: end; }
  .hero-ctas { justify-content: flex-end; }
}
/* Load choreography (JS adds .is-ready) */
.js .hero .hero-frames { opacity: 0; transform: scale(1.04); transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); }
.js .hero.is-ready .hero-frames { opacity: 1; transform: none; }
.js .hero .hero-line, .js .hero .hero-btn, .js .hero .hero-controls {
  opacity: 0; transform: translateY(14px);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 100ms + 150ms);
}
.js .hero.is-ready .hero-line, .js .hero.is-ready .hero-btn, .js .hero.is-ready .hero-controls { opacity: 1; transform: none; }
.hero-no-rotate .hero-controls { display: none; }

/* ---------- Services ---------- */
.services-grid { display: grid; gap: clamp(3rem, 2rem + 4vw, 6rem); align-items: start; }
.service-list { display: grid; gap: clamp(2.5rem, 2rem + 1.5vw, 3.5rem); }
.service { display: grid; gap: 0.85rem; justify-items: start; }
/* On hover each entry becomes a borderless card. The negative margin cancels
   the padding, so the layout is identical to before. */
@media (hover: hover) and (pointer: fine) {
  .service {
    position: relative; margin: -1.25rem; padding: 1.25rem; border-radius: var(--r-card);
    transition: transform var(--dur-lift) var(--ease-out);
  }
  .service:hover { transform: translateY(-2px); }
}
.service h3 { font-size: var(--text-h3); }
.service p { color: var(--ink-soft); max-width: 50ch; }
.service .chip { margin-top: 0.35rem; }
.services-aside { display: grid; gap: 1.5rem; }
.aside-photo { width: 100%; max-width: 30rem; border-radius: var(--r-card); aspect-ratio: 4 / 5; object-fit: cover; }
.coc-callout { padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem); border-radius: var(--r-card); background: var(--blue-soft); max-width: 30rem; }
.coc-callout strong { display: block; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--blue); }
.coc-callout p { margin-top: 0.6rem; color: var(--ink-soft); }
@media (min-width: 1024px) {
  .services-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .services-aside { position: sticky; top: calc(var(--nav-h) + 2rem); }
}

/* ---------- Coverage: toggle, map box, towns ---------- */
.map-toggle { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 1rem; border-radius: 9px; background: var(--white); border: 1px solid var(--line); }
.toggle-btn {
  min-height: 44px; padding: 0.5rem 1rem; border: 0; border-radius: var(--r-btn);
  background: transparent; font-weight: 600; font-size: 0.9875rem; color: var(--ink-soft); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.toggle-btn[aria-pressed="true"] { background: var(--navy); color: var(--white); }
@media (hover: hover) and (pointer: fine) {
  .toggle-btn[aria-pressed="false"]:hover { background: var(--blue-soft); color: var(--blue); }
}
.map-box {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden;
  background: var(--white); border: 1px solid var(--line);
}
@media (min-width: 720px) { .map-box { aspect-ratio: var(--map-ratio); } }
.map-view { position: absolute; inset: 0; }
.map-view[hidden] { display: none; }
.map-view-svg { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
.map-frame { position: relative; height: 100%; aspect-ratio: var(--map-ratio); min-width: 100%; }
.chart-svg { width: 100%; height: 100%; }
.chart-svg .sea { fill: var(--sea); }
.chart-svg .lagoon { fill: var(--sea); stroke: var(--navy); stroke-width: 1.2; }
.chart-svg .coast { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .contour { fill: none; stroke: rgba(24, 96, 184, 0.28); stroke-width: 0.9; }
.chart-svg .isobath { fill: none; stroke: rgba(15, 33, 55, 0.3); stroke-width: 0.8; stroke-dasharray: 2 5; }
.chart-svg .grat { fill: none; stroke: rgba(15, 33, 55, 0.1); stroke-width: 0.8; }
.chart-svg .grat-label { font-family: var(--font); font-size: 13px; font-weight: 500; fill: var(--ink-soft); }
.chart-svg .area-label { font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0.3em; fill: rgba(15, 33, 55, 0.5); }
.chart-svg .sea-label { fill: var(--blue); }
.street-map { width: 100%; height: 100%; background: var(--sea); }

.pin {
  position: absolute; z-index: 2; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.pin-dot, .lf-pin-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 3px solid var(--white); box-shadow: 0 0 0 1.5px var(--navy);
  transition: transform var(--dur) var(--ease-out);
}
.pin-base .pin-dot, .lf-pin.is-base .lf-pin-dot { width: 26px; height: 26px; background: var(--bright); border-width: 4px; box-shadow: 0 0 0 2px var(--navy); }
.pin.is-active .pin-dot, .lf-pin.is-active .lf-pin-dot { transform: scale(1.3); }
.pin-label, .lf-pin-label {
  position: absolute; left: 50%; bottom: calc(100% - 4px); transform: translateX(-50%);
  white-space: nowrap; padding: 0.2rem 0.55rem; border-radius: 5px;
  background: var(--white); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line);
  font-size: 0.8125rem; font-weight: 600; line-height: 1.3;
  transition: transform var(--dur) var(--ease-out);
}
.pin-below .pin-label { bottom: auto; top: calc(100% - 4px); }
.pin.is-active .pin-label, .lf-pin.is-active .lf-pin-label { background: var(--navy); color: var(--white); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .pin:hover .pin-dot, .lf-pin:hover .lf-pin-dot { transform: scale(1.18); }
  .pin.is-active:hover .pin-dot { transform: scale(1.3); }
  .pin:hover .pin-label, .lf-pin:hover .lf-pin-label { transform: translateX(-50%) translateY(-3px); }
  .pin-below:hover .pin-label { transform: translateX(-50%) translateY(3px); }
}
/* Leaflet divIcon: Leaflet sizes the box; the dot and label sit inside it. */
.lf-pin { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lf-pin-label { bottom: calc(100% - 6px); }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 0.75rem; }
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }

.town-panel { display: grid; gap: 1.5rem; margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.town-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: start; }
.town-tab {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  min-height: 48px; padding: 0.55rem 1rem; border: 1px solid var(--line); border-radius: var(--r-btn);
  background: var(--white); font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.town-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tab-dist { font-weight: 500; font-size: 0.875rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.town-tab[aria-selected="true"] .tab-dist { color: var(--highlight); }
/* The illustrated map only overflows below 720px, where the box is 4:3. */
.pan-hint {
  display: none; align-items: center; gap: 0.5rem; margin-top: 0.75rem;
  font-weight: 600; font-size: 0.9375rem; color: var(--blue);
}
.pan-hint svg { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 719px) { .pan-hint { display: flex; } .pan-hint[hidden] { display: none; } }
.map-caption { margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-soft); max-width: 72ch; }
@media (hover: hover) and (pointer: fine) {
  .town-tab[aria-selected="false"]:hover { border-color: var(--blue); color: var(--blue); }
}
.town-note { padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.5rem); border-radius: var(--r-card); background: var(--white); }
.js .town-note[hidden] { display: none; }
.town-note.is-fresh { animation: note-in var(--dur) var(--ease-out); }
@keyframes note-in { from { opacity: 0; transform: translateY(6px); } }
.town-note h3 { font-size: var(--text-h3); }
.town-note p { margin-top: 0.75rem; color: var(--ink-soft); max-width: 52ch; }
.note-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
@media (min-width: 900px) {
  .town-panel { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
}

/* ---------- Recent installs carousel ---------- */
.carousel { position: relative; }
.car-track {
  display: flex; gap: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-block: 1.5rem; margin-block: -1.25rem; cursor: grab;
  --fade: clamp(1.5rem, 8vw, 7rem);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
.car-track::-webkit-scrollbar { display: none; }
.car-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.car-track:focus-visible { outline-offset: -3px; }
.slide {
  position: relative; flex: 0 0 min(78vw, 380px); scroll-snap-align: center; border-radius: var(--r-card);
  transition: transform var(--dur-lift) var(--ease-out);
}
@media (min-width: 640px) { .slide { flex-basis: min(44vw, 380px); } }
.slide-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--r-card); overflow: hidden; }
.slide-btn img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; user-select: none; -webkit-user-drag: none;
}
@media (hover: hover) and (pointer: fine) { .slide:hover { transform: scale(1.02); } }
.car-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.car-controls { display: flex; align-items: center; gap: 0.75rem; }
.car-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--r-btn); background: rgba(255, 255, 255, 0.08); color: var(--white); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease, transform var(--dur-fast) var(--ease-out);
}
.car-btn svg { width: 22px; height: 22px; }
.car-btn:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .car-btn:hover { background: var(--white); border-color: var(--white); color: var(--navy); } }
.car-count { min-width: 4.5ch; text-align: center; font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.06em; color: var(--on-navy-soft); font-variant-numeric: tabular-nums; }
.car-count [data-car-cur] { color: var(--white); font-weight: 600; }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 1rem clamp(3rem, 2rem + 4vw, 7rem); }
.about-grid .section-head { margin-bottom: 0; align-content: start; }
.about-copy { display: grid; gap: 1.25rem; justify-items: start; max-width: 58ch; color: var(--ink-soft); }
.about-lead { font-size: var(--text-lead); color: var(--ink); }
.about-lead strong { color: var(--blue); font-weight: 700; }
.about-copy .chip { margin-top: 0.75rem; }
@media (min-width: 960px) { .about-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }

/* ---------- Contact ---------- */
.contact-cards { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .contact-cards { grid-template-columns: 1.1fr 0.9fr 1.2fr; } }
.contact-card {
  display: flex; flex-direction: column; gap: 0.4rem; height: 100%;
  padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem); border-radius: var(--r-card);
  position: relative; background: var(--white); text-decoration: none;
  transition: transform var(--dur-lift) var(--ease-out), background-color var(--dur) ease, color var(--dur) ease;
}
.contact-card:active { transform: scale(0.98); }
.card-label { font-weight: 500; color: var(--ink-soft); }
.contact-card strong { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.contact-card strong.is-email { font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.1875rem); overflow-wrap: normal; }
.card-action {
  display: inline-flex; align-items: center; gap: 0.55rem; align-self: flex-start;
  margin-top: auto; min-height: 44px; padding: 0.6rem 0.85rem 0.6rem 0.95rem; border-radius: var(--r-btn);
  background: var(--blue-soft); color: var(--blue); font-weight: 600;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.contact-card strong + .card-action { margin-top: 1.5rem; }
.contact-card.is-primary { background: var(--blue); color: var(--white); }
.contact-card.is-primary .card-label { color: rgba(255, 255, 255, 0.82); }
.contact-card.is-primary .card-action { background: var(--white); color: var(--blue); }
@media (hover: hover) and (pointer: fine) {
  .contact-card:hover { transform: translateY(-2px); }
  .contact-card:hover:active { transform: translateY(-1px) scale(0.98); }
  .contact-card:hover .card-action { background: var(--blue); color: var(--white); }
  .contact-card:hover .card-action svg { transform: translateX(4px); }
  .contact-card.is-primary:hover { background: var(--blue-press); }
  .contact-card.is-primary:hover .card-action { background: var(--navy); color: var(--white); }
}
.contact-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; }
.contact-address { color: var(--ink-soft); }

/* Quote form: the secondary path under the WhatsApp/Call/Email cards */
.quote-block {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem clamp(2rem, 1rem + 4vw, 5rem); margin-top: clamp(3rem, 2rem + 3vw, 5rem);
  padding: clamp(1.5rem, 1rem + 2vw, 3rem); border-radius: var(--r-card); background: var(--white);
}
.quote-intro h3 { font-size: var(--text-h3); }
.quote-intro p { margin-top: 0.6rem; color: var(--ink-soft); max-width: 34ch; }
.quote-form { display: grid; gap: 1.1rem 1.25rem; grid-template-columns: minmax(0, 1fr); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; align-content: start; min-width: 0; }
.field label { font-weight: 600; font-size: 0.9875rem; }
.optional { font-weight: 400; color: var(--ink-soft); }
.field input[type="text"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem;
  border: 1.5px solid #B9C5D4; border-radius: var(--r-btn); background: var(--white); color: var(--ink);
  font: inherit; font-size: 1rem; line-height: 1.4;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field select {
  appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231860B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.1rem;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px; border-color: var(--blue);
}
/* Matches the specificity of the typed-input rule above so the error border wins. */
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #B42318; }
@media (hover: hover) and (pointer: fine) {
  .field input:not([type="file"]):hover, .field select:hover, .field textarea:hover { border-color: var(--blue); }
}
.photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.field input[type="file"] { flex: 1 1 16rem; min-height: 48px; min-width: 0; max-width: 100%; font: inherit; font-size: 0.9375rem; color: var(--ink-soft); }
.field input[type="file"]::file-selector-button {
  min-height: 44px; margin-right: 0.85rem; padding: 0.6rem 0.95rem; border: 0; border-radius: var(--r-btn);
  background: var(--blue-soft); color: var(--blue); font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
@media (hover: hover) and (pointer: fine) {
  .field input[type="file"]::file-selector-button:hover { background: var(--blue); color: var(--white); }
}
.photo-clear { border: 0; cursor: pointer; font-family: inherit; font-size: 0.9375rem; font-weight: 600; }
.photo-clear[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.quote-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.quote-submit[disabled] { opacity: 0.7; cursor: progress; }
.quote-status { font-weight: 600; }
.quote-status:empty { display: none; }
.quote-status.is-ok { color: #1D6B3A; }
.quote-status.is-error { color: #B42318; }
.quote-status .chip { margin-top: 0.5rem; }
@media (min-width: 640px) {
  .quote-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .quote-block { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--on-navy); padding-block: 4rem 2rem; }
.foot-top { display: grid; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.foot-tag { margin-top: 1rem; max-width: 42ch; color: var(--on-navy-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.foot-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.75rem; border-radius: var(--r-btn);
  text-decoration: none; font-weight: 500; transition: background-color var(--dur) ease;
}
@media (hover: hover) and (pointer: fine) { .foot-links a:hover { background: var(--navy-raise); } }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 2rem; padding-top: 1.5rem; font-size: 0.9375rem; color: var(--on-navy-soft); }
.foot-credit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.foot-credit a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.75rem; border-radius: var(--r-btn);
  background: var(--navy-raise); color: var(--white); font-weight: 600; text-decoration: none;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
@media (hover: hover) and (pointer: fine) { .foot-credit a:hover { background: var(--white); color: var(--navy); } }
@media (min-width: 760px) { .foot-top { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }

/* ---------- Gallery page ---------- */
.page-head { padding-block: clamp(3rem, 2rem + 5vw, 7rem) clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.page-head h1 { margin-top: 1rem; font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem); max-width: 16ch; }
.page-head p:not(.eyebrow) { margin-top: 1.25rem; max-width: 52ch; color: var(--ink-soft); font-size: var(--text-lead); }
.gal { padding-bottom: var(--space-section); }
.gal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: clamp(0.5rem, 0.3rem + 0.9vw, 1.1rem); }
@media (min-width: 768px) { .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .gal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; transition: transform var(--dur-lift) var(--ease-out); }
/* Two 3:4 columns side by side come out at roughly 3:2, and a 2x2 block at 3:4,
   so wide and feature tiles line up with the portrait rows around them. */
.tile.is-wide { grid-column: span 2; aspect-ratio: 3 / 2; }
.tile.is-feature { grid-column: span 2; grid-row: span 2; aspect-ratio: 3 / 4; }
.tile-btn { position: absolute; inset: 0; display: block; padding: 0; border: 0; background: var(--tint); cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.tile-btn img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { z-index: 1; transform: scale(1.02); }
}
.gal-cta h2 { font-size: var(--text-h2); max-width: 18ch; }
.gal-cta .hero-ctas { margin-top: 2rem; }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; align-content: center; padding-block: 4rem; }
.lost h1 { font-size: var(--text-h1); max-width: 14ch; margin-top: 1rem; }
.lost p:not(.eyebrow) { margin-top: 1.25rem; max-width: 48ch; color: var(--ink-soft); font-size: var(--text-lead); }
.lost .hero-ctas { margin-top: 2rem; }

/* ---------- Lightbox ---------- */
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 0.5rem;
  padding: 1rem; background: rgba(9, 20, 34, 0.95); color: var(--white);
  opacity: 0; transition: opacity var(--dur) ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-figure { grid-column: 2; display: grid; justify-items: center; gap: 0.9rem; margin: 0; min-height: 0; max-height: 100%; }
.lightbox-img { max-width: 100%; max-height: calc(100dvh - 9rem); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.25rem 0.9rem; text-align: center; }
.lightbox-cat { color: var(--bright); font-weight: 600; }
.lightbox-caption { font-weight: 500; }
.lightbox-count { color: var(--on-navy-soft); font-variant-numeric: tabular-nums; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1.5px solid rgba(255, 255, 255, 0.6); border-radius: var(--r-btn); background: transparent; color: var(--white); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur) ease, color var(--dur) ease;
}
.lb-btn:active { transform: scale(0.95); }
.lb-btn svg { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { background: var(--white); color: var(--navy); } }
.lb-close { position: absolute; top: 1rem; right: 1rem; }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
@media (max-width: 600px) {
  .lightbox { grid-template-columns: minmax(0, 1fr); padding-top: 4.5rem; }
  .lightbox-figure { grid-column: 1; }
  .lb-prev, .lb-next { position: absolute; bottom: 1rem; }
  .lb-prev { left: 1rem; }
  .lb-next { right: 1rem; }
  .lightbox-img { max-height: calc(100dvh - 12rem); }
}

/* ---------- Privacy notice ---------- */
.notice {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 80;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem;
  max-width: 34rem; padding: 1rem 1.25rem; border-radius: var(--r-card); background: var(--white);
  box-shadow: 0 12px 34px rgba(15, 33, 55, 0.2), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out);
}
.notice[hidden] { display: none; }
.notice.is-visible { opacity: 1; transform: none; }
.notice p { font-size: 0.9375rem; }
.notice .btn { min-height: 44px; padding-block: 0.5rem; }

/* ---------- Reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion: nothing structural moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .chip, .chip svg, .card-action svg, .contact-card, .service, .slide, .tile, .lb-btn, .car-btn, .pin-dot, .lf-pin-dot, .pin-label, .lf-pin-label, .hero-frame { transition: none; }
  .btn:active, .btn:hover:active, .chip:active, .contact-card:active, .contact-card:hover:active, .lb-btn:active, .car-btn:active { transform: none; }
  .btn:hover, .service:hover, .contact-card:hover, .slide:hover, .tile:hover, .chip:hover svg, .contact-card:hover .card-action svg, .pin:hover .pin-dot, .lf-pin:hover .lf-pin-dot { transform: none; }
  .pin:hover .pin-label, .lf-pin:hover .lf-pin-label, .pin-below:hover .pin-label { transform: translateX(-50%); }
  .pin.is-active .pin-dot, .lf-pin.is-active .lf-pin-dot { transform: none; box-shadow: 0 0 0 4px var(--navy); }
  .js .hero .hero-frames, .js .hero .hero-line, .js .hero .hero-btn, .js .hero .hero-controls { opacity: 1; transform: none; transition: none; }
  .hero-media { will-change: auto; }
  .js .reveal { transform: none; transition: opacity var(--dur-reveal) ease; }
  .town-note.is-fresh { animation: note-fade var(--dur) ease; }
  .notice { transform: none; transition: opacity var(--dur) ease; }
}
@keyframes note-fade { from { opacity: 0; } }

/* Pin positions and map aspect, generated by scripts/build_marshall_map.py */
/* pins:start */
.pin-george { left: 11.256%; top: 40.949%; }
.pin-wilderness { left: 21.248%; top: 51.220%; }
.pin-sedgefield { left: 40.171%; top: 58.923%; }
.pin-knysna { left: 61.436%; top: 65.225%; }
.pin-plett { left: 89.026%; top: 70.928%; }
:root { --map-ratio: 1200 / 371; }
/* pins:end */
