/* Town & Country Auto & Wrecker Service
   Fresh build; paired layouts on a shared spine, split day/night world.
   See DESIGN.md. No section of this file is copied from a sibling site. */

*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--day);
}

[id] { scroll-margin-top: 130px; }

img { max-width: 100%; height: auto; display: block; }

svg[hidden] { display: none; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.16;
  margin: 0 0 var(--s2);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--t-h1); font-weight: 700; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

p { margin: 0 0 var(--s2); max-width: 62ch; }

a { color: var(--signal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--gold); color: var(--night); }

* { scrollbar-color: var(--night-3) var(--day-2); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-night :focus-visible, .site-foot :focus-visible { outline-color: var(--gold); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--night); color: var(--star);
  padding: 10px 18px; border-radius: var(--radius);
}
.skip-link:focus-visible { left: 8px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- header: A6 two-division split band ---------- */

.masthead { position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 var(--hair-day); display: flex; flex-direction: column; }
.masthead-mobile-name { order: -1; }

.divisions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  background: linear-gradient(90deg, var(--night) 50%, var(--day-2) 50%);
}

.division {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
  padding: 10px var(--gutter);
  text-decoration: none;
  transition: filter var(--t-fast) var(--ease-out);
}
.division:hover { filter: brightness(1.08); }
.division:active { filter: brightness(0.96); }

.division-night { grid-column: 1; grid-row: 1; background: var(--night); color: var(--star); align-items: flex-end; text-align: right; padding-right: calc(var(--gutter) + 24px); }
.division-day { grid-column: 3; grid-row: 1; background: var(--day-2); color: var(--ink); align-items: flex-start; padding-left: calc(var(--gutter) + 24px); }

.division .div-role { font-size: var(--t-tiny); letter-spacing: 0.02em; }
.division-night .div-role { color: var(--mist); }
.division-day .div-role { color: var(--slate); }
.division .div-tel { font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1.2; }
.division-night .div-tel { color: var(--gold); }
.division-day .div-tel { color: var(--signal-deep); }

.wordmark {
  grid-column: 2; grid-row: 1;
  align-self: center;
  margin: 8px 14px;
  background: var(--day);
  border: 1px solid var(--hair-day);
  border-radius: var(--radius);
  padding: 8px 18px 9px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}
.wordmark .wm-name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; display: block; }
.wordmark .wm-sub { font-size: 0.7rem; color: var(--slate); display: block; letter-spacing: 0.04em; }
/* the day/night color seam behind the wordmark is the header's spine */

.site-nav { background: var(--day); border-bottom: 1px solid var(--hair-day); }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; gap: clamp(12px, 3vw, 40px);
}
.site-nav a {
  display: inline-block;
  padding: 14px 6px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--t-small);
  font-weight: 500;
  position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 8px; height: 2px;
  background: var(--signal); border-radius: 1px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-fast) var(--ease-out);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--signal-deep); }

.nav-toggle { display: none; }

/* ---------- hero: B17 four-cell grid ---------- */

.hero { padding: var(--s3) 0 var(--s6); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  grid-template-rows: minmax(300px, auto) minmax(220px, auto);
  gap: 14px;
}

.hero-cell {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.hero-cell img { width: 100%; height: 100%; object-fit: cover; }
.cell-road img { object-position: center 62%; }
.cell-chain img { object-position: center 45%; }

.cell-h1 {
  background: var(--night);
  color: var(--star);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 3.4vw, 44px);
}
.cell-h1 h1 { color: var(--star); margin-bottom: var(--s2); position: relative; z-index: 2; }
.cell-h1 .hero-line { color: var(--mist); position: relative; z-index: 2; margin-bottom: var(--s3); }

/* E9: day-to-night wash, two crossfading layers, ~40s */
.wash { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.wash .layer { position: absolute; inset: 0; }
.wash .layer-dawn {
  background: linear-gradient(160deg, var(--dawn-a) 0%, var(--dawn-b) 46%, var(--dusk-b) 100%);
  opacity: 0;
  animation: washDawn 40s ease-in-out infinite;
}
.wash .layer-dusk {
  background: linear-gradient(160deg, var(--dusk-a) 0%, var(--dusk-b) 58%, var(--night) 100%);
  opacity: 0.9;
  animation: washDusk 40s ease-in-out infinite;
}
.wash .scrim { position: absolute; inset: 0; background: rgba(34, 40, 64, 0.58); }
@keyframes washDawn { 0% {opacity:0} 40% {opacity:0.85} 55% {opacity:0.85} 95% {opacity:0} 100% {opacity:0} }
@keyframes washDusk { 0% {opacity:0.9} 40% {opacity:0.15} 55% {opacity:0.15} 95% {opacity:0.9} 100% {opacity:0.9} }

/* C10: one filled button + labelled second line */
.btn-fill {
  display: inline-block;
  background: var(--signal);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative; z-index: 2;
  align-self: flex-start;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.btn-fill:hover { background: #B93B2D; transform: translateY(-1px); }
.btn-fill:active { transform: translateY(1px); }

.cta-second { position: relative; z-index: 2; margin: var(--s2) 0 0; font-size: var(--t-small); color: var(--mist); }
.cta-second a { color: var(--gold); font-weight: 500; }

/* ---------- D13 pairs on a shared spine ---------- */

section { padding: var(--s7) 0; }
section.tight { padding: var(--s6) 0; }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  position: relative;
}
.pair > * { min-width: 0; }
.pair::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 50%;
  width: 2px; margin-left: -1px;
  background: var(--spine-day);
  border-radius: 1px;
}
.on-night .pair::before { background: var(--spine-night); }
.pair.no-spine::before { content: none; }

.pair-node { position: relative; }
.pair-node::before {
  content: ""; position: absolute; top: 10px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--signal);
}
.pair > :nth-child(odd).pair-node::before { right: calc(-1 * clamp(14px, 2.5vw, 36px) - 5px); }
.pair > :nth-child(even).pair-node::before { left: calc(-1 * clamp(14px, 2.5vw, 36px) - 5px); }

.photo-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.photo-card.tall img { aspect-ratio: 4 / 5; }
.photo-card.wide img { aspect-ratio: 3 / 2; }

figure { margin: 0; }
figcaption { font-size: var(--t-tiny); color: var(--slate); padding-top: 8px; }
.on-night figcaption { color: var(--mist); }

.lede { font-size: 1.08rem; }
.muted { color: var(--slate); }
.on-night .muted, .band-dusk .muted, .call-band .muted { color: var(--mist); }

/* ruled fact rows */
.fact-rows { list-style: none; margin: 0; padding: 0; }
.fact-rows li {
  display: flex; justify-content: space-between; gap: var(--s2);
  padding: 12px 2px;
  border-bottom: 1px solid var(--hair-day);
  font-size: var(--t-small);
}
.fact-rows li:first-child { border-top: 1px solid var(--hair-day); }
.fact-rows .src { color: var(--slate); text-align: right; flex-shrink: 0; font-size: var(--t-tiny); align-self: center; }
.on-night .fact-rows li { border-color: var(--hair-night-2); }
.on-night .fact-rows li:first-child { border-color: var(--hair-night-2); }
.on-night .fact-rows .src { color: var(--mist); }

/* ---------- F11 signature: comparison rail ---------- */

.rail-section { background: var(--day-2); }

.rail-head { text-align: center; max-width: 560px; margin: 0 auto var(--s5); }
.rail-head p { margin-inline: auto; }

.rail { position: relative; max-width: 980px; margin-inline: auto; }
.rail-spine {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; margin-left: -1px;
  background: var(--spine-day);
  border-radius: 1px;
  transform-origin: top;
}
.rail-labels {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px);
  margin-bottom: var(--s3);
}
.rail-labels .rl { font-family: var(--display); font-weight: 700; font-size: var(--t-h3); }
.rail-labels .rl-left { text-align: right; }
.rail-labels .rl-left em { font-style: normal; color: var(--signal-deep); }
.rail-labels .rl-right em { font-style: normal; color: var(--signal-deep); }

.rail-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px);
  position: relative;
  padding: 7px 0;
}
.rail-row::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--signal);
}
.rail-row.gap::before { background: var(--day-2); border: 2px dashed var(--slate); width: 8px; height: 8px; }

.rail-item {
  background: var(--day);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
  font-size: var(--t-small);
}
.rail-row .rail-item:first-child { grid-column: 1; text-align: right; }
.rail-row .rail-item:last-child { grid-column: 2; text-align: left; }
.rail-row.left-only .rail-item { grid-column: 1; }
.rail-row.right-only .rail-item { grid-column: 2; }
.rail-item .ri-fact { font-weight: 700; display: block; }
.rail-item .ri-src { color: var(--slate); font-size: var(--t-tiny); display: block; margin-top: 2px; }
.rail-row.gap .rail-item {
  background: transparent; box-shadow: none;
  border: 1px dashed var(--slate);
  color: var(--slate);
}
.rail-row.gap .ri-fact { font-weight: 500; }

/* ---------- day-to-night band (E9 second panel) ---------- */

.band-dusk {
  position: relative;
  background: var(--night);
  color: var(--star);
  overflow: hidden;
  border-radius: 0;
}
.band-dusk .wrap { position: relative; z-index: 2; }
.band-dusk h2 { color: var(--star); }
.band-dusk .wash .scrim { background: rgba(34, 40, 64, 0.66); }

/* dark sections generally */
.on-night { background: var(--night); color: var(--star); }
.on-night h2, .on-night h3 { color: var(--star); }
.on-night a { color: var(--gold); }
.on-night .btn-fill { background: var(--signal); color: #fff; }
.on-night .photo-card { box-shadow: none; }

/* ---------- call band ---------- */

.call-band { background: var(--night); color: var(--star); text-align: center; }
.call-band h2 { color: var(--star); }
.call-band .tel-big {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--gold); text-decoration: none;
  display: inline-block; padding: 4px 10px;
  transition: transform var(--t-fast) var(--ease-out);
}
.call-band .tel-big:hover { transform: translateY(-1px); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- split page (repair-uhaul) ---------- */

.split-col h2 { margin-bottom: var(--s1); }
.split-col .col-tel { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.split-col .col-tel a { text-decoration: none; }
.split-col .col-tel a:hover { text-decoration: underline; }

.trademark-note { font-size: var(--t-tiny); color: var(--slate); border-top: 1px solid var(--hair-day); padding-top: var(--s2); margin-top: var(--s4); }

/* ---------- forms ---------- */

.form-grid { display: grid; gap: var(--s2); }
.form-grid label { font-size: var(--t-small); font-weight: 500; display: block; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hair-day);
  border-radius: var(--radius);
  padding: 11px 12px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(168, 50, 38, 0.18);
}
.form-grid textarea { min-height: 120px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note {
  display: none;
  background: var(--day-2);
  border: 1px solid var(--hair-day);
  border-left: 4px solid var(--signal);
  border-radius: var(--radius);
  padding: var(--s2) var(--s3);
  margin-top: var(--s2);
}
.form-note.show { display: block; }

/* ---------- footer ---------- */

.site-foot { background: var(--night); color: var(--mist); padding: var(--s6) 0 calc(var(--s6) + 64px); font-size: var(--t-small); }
.site-foot a { color: var(--gold); }
.site-foot .foot-cols { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: var(--s4); }
.site-foot .foot-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--star); margin-bottom: var(--s1); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { padding: 4px 0; }
.site-foot .foot-fine { border-top: 1px solid var(--hair-night-2); margin-top: var(--s4); padding-top: var(--s3); font-size: var(--t-tiny); }
.site-foot .foot-fine p { max-width: none; }

/* ---------- mobile sticky call bar ---------- */

.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hair-night-2);
  transition: transform var(--t-med) var(--ease-out);
}
.callbar.hidden-bar { transform: translateY(110%); }
.callbar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px;
  font-weight: 700; font-size: var(--t-small);
  text-decoration: none;
}
.callbar .cb-tow { background: var(--signal); color: #fff; }
.callbar .cb-shop { background: var(--night); color: var(--gold); }

/* ---------- reveals: H5 sequential ---------- */

.js [data-seq] > * { opacity: 0; transform: translateY(14px); }
.js .rail .rail-labels > *, .js .rail .rail-row > * { opacity: 0; transform: translateY(14px); }
.js .rail-spine { transform: scaleY(0); }
.js [data-load] { opacity: 0; transform: translateY(12px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-seq] > *, .js [data-load] { opacity: 1; transform: none; }
  .js .rail .rail-labels > *, .js .rail .rail-row > * { opacity: 1; transform: none; }
  .js .rail-spine { transform: none; }
  .wash .layer { animation: none !important; }
  .wash .layer-dawn { opacity: 0; }
  .wash .layer-dusk { opacity: 0.9; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .division-night { padding-right: calc(var(--gutter) + 8px); }
  .division-day { padding-left: calc(var(--gutter) + 8px); }
  .wordmark { display: none; }
  .masthead-mobile-name { display: block; }
}

@media (min-width: 981px) {
  .masthead-mobile-name { display: none; }
}

.masthead-mobile-name {
  background: var(--day);
  text-align: center;
  padding: 10px var(--gutter) 8px;
  text-decoration: none;
  color: var(--ink);
}
.masthead-mobile-name .wm-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: block; line-height: 1.15; }
.masthead-mobile-name .wm-sub { font-size: 0.7rem; color: var(--slate); letter-spacing: 0.04em; }

@media (max-width: 760px) {
  section { padding: var(--s6) 0; }

  .hero-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .hero-cell:not(.cell-h1) { min-height: 200px; max-height: 260px; }
  .cell-h1 { order: -1; min-height: 340px; }

  .pair { grid-template-columns: 1fr; gap: var(--s4); }
  .pair::before { left: 8px; top: 0; bottom: 0; }
  .pair > * { padding-left: 28px; }
  .pair-node::before { display: none; }

  .rail-labels { grid-template-columns: 1fr; gap: 4px; margin-bottom: var(--s2); }
  .rail-labels .rl-left { text-align: left; }
  .rail-spine { left: 8px; }
  .rail-row { grid-template-columns: 1fr; gap: 8px; padding-left: 28px; }
  .rail-row::before { left: 8px; margin-left: -4px; }
  .rail-row .rail-item:first-child, .rail-row .rail-item:last-child { grid-column: 1; text-align: left; }
  .rail-row.right-only .rail-item { grid-column: 1; }

  .site-foot .foot-cols { grid-template-columns: 1fr; }

  .callbar { display: grid; }

  .division .div-tel { font-size: 0.95rem; }
  .division { min-height: 56px; padding-block: 8px; }

  .site-nav { position: relative; }
  .site-nav ul {
    flex-direction: column; align-items: stretch; gap: 0;
    display: none;
    border-top: 1px solid var(--hair-day);
  }
  .site-nav.open ul { display: flex; }
  .site-nav a { padding: 13px var(--gutter); }
  .site-nav a::after { content: none; }
  .site-nav a[aria-current="page"] { background: var(--day-2); }

  .nav-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    min-height: 46px;
    background: var(--day);
    color: var(--ink);
    border: 0;
    border-top: 1px solid var(--hair-day);
    font: inherit; font-size: var(--t-small); font-weight: 500;
    padding: 0 var(--gutter);
    cursor: pointer;
  }
  .nav-toggle .chev { transition: transform var(--t-fast) var(--ease-out); }
  .site-nav.open .nav-toggle .chev { transform: rotate(180deg); }
}
