/* =============================================================================
   Neighbors for the Carrollton Car Wash
   -----------------------------------------------------------------------------
   Layered so new content sections drop in without touching anything here:
     1. Tokens          6. Buttons
     2. Base            7. Form
     3. Layout          8. Letter preview
     4. Header / nav    9. Toast
     5. Hero           10. Footer / print / motion
   Any new module only needs <section class="section"> (add --alt or --dark for
   an alternate ground) and, optionally, .section__head + .prose inside it.
   ========================================================================== */

/* 1 -------------------------------------------------------------- TOKENS -- */
:root {
  /* Tommy's Express brand (sampled from tommys-express.com) */
  --red:        #be1f24;
  --red-dark:   #99181c;
  --red-tint:   #f6e7e7;
  --red-line:   #ebbbbd;

  /* Mid-City warmth */
  --paper:      #f7f2ea;
  --paper-2:    #fffdfa;
  --white:      #ffffff;
  --ink:        #16120f;
  --ink-2:      #3d352f;
  --ink-3:      #6d6259;
  --line:       #e2d8ca;
  --line-2:     #cfc2b0;
  --gold:       #b8862f;
  --green:      #1f5b45;

  --font-body:    "Nunito Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-narrow:  "Archivo Narrow", "Archivo", "Arial Narrow", Arial, sans-serif;

  --shell:      1120px;
  --gutter:     clamp(20px, 5vw, 44px);
  --radius:     6px;
  --radius-lg:  10px;

  --shadow-sm:  0 1px 2px rgba(22, 18, 15, .06), 0 2px 8px rgba(22, 18, 15, .05);
  --shadow-md:  0 2px 4px rgba(22, 18, 15, .07), 0 12px 28px rgba(22, 18, 15, .09);

  --header-h:   66px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.015em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }

img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
  border-radius: 3px;
}

.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* 3 -------------------------------------------------------------- LAYOUT -- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Any in-page link target clears the sticky header instead of hiding under it. */
main [id], main .section { scroll-margin-top: calc(var(--header-h) + 20px); }

.section {
  padding-block: clamp(48px, 7vw, 84px);
  border-top: 1px solid var(--line);
}
.section--alt  { background: var(--paper-2); }
.section--dark { background: var(--ink); color: #d9d2cb; border-top-color: #2a2320; }
.section--dark h2, .section--dark h3 { color: #fff; }

.section__head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 40px); }
.section__title { font-size: clamp(28px, 4vw, 40px); }
.section__sub { margin-top: 14px; color: var(--ink-3); font-size: 17px; }

.eyebrow {
  margin: 0 0 12px;
  text-wrap: balance;
  font-family: var(--font-narrow);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}
.section--dark .eyebrow { color: var(--red-line); }

.prose > * + * { margin-top: 1em; }
.prose h3 { font-size: 21px; margin-top: 1.6em; }

/* 4 ------------------------------------------------------- HEADER / NAV -- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  border-bottom: 3px solid var(--red);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 34px; height: 24px; flex: none; overflow: visible; }
.brand__mark path {
  fill: none; stroke: var(--red); stroke-width: 3.4; stroke-linecap: round;
}
.brand__name {
  font-family: var(--font-narrow);
  font-size: 13px; line-height: 1.15; letter-spacing: .06em;
  text-transform: uppercase; color: #b3a99f;
}
.brand__name b { color: #fff; font-weight: 700; letter-spacing: .05em; }

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav:empty, .site-nav[hidden] { display: none; }
.site-nav a {
  font-family: var(--font-narrow);
  font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #cfc6bd; text-decoration: none;
  padding: 8px 12px; border-radius: var(--radius);
}
.site-nav a:hover { color: #fff; background: #2a2320; }
.site-nav a[aria-current="true"] { color: #fff; box-shadow: inset 0 -3px 0 var(--red); }

/* 5 ---------------------------------------------------------------- HERO -- */
.hero {
  position: relative; overflow: hidden;
  background: var(--red);
  color: #fff;
  padding-block: clamp(52px, 8vw, 92px);
}
.hero__inner { position: relative; z-index: 2; max-width: 46rem; }
.hero .eyebrow { color: rgba(255,255,255,.78); }

.hero__title {
  font-family: var(--font-narrow);
  font-weight: 700;
  font-size: clamp(40px, 8.4vw, 82px);
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: #fff;
}
.hero__title em { font-style: italic; color: #ffe9ea; }

.hero__lede {
  margin-top: 22px;
  max-width: 40rem;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.55;
  color: rgba(255,255,255,.93);
}

.hero__cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero__cta-note {
  font-family: var(--font-narrow); font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.75);
}

.hero__arcs {
  position: absolute; inset: 0 -10% -30% 40%; z-index: 1;
  opacity: .16; pointer-events: none;
}
.hero__arcs svg { width: 100%; height: 100%; }
.hero__arcs path { fill: none; stroke: #fff; stroke-width: 13; stroke-linecap: round; }

/* 6 ------------------------------------------------------------- BUTTONS -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: #fff; color: var(--ink); }

.btn--onred { background: #fff; border-color: #fff; color: var(--red); }
.btn--onred:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 7 ---------------------------------------------------------------- FORM -- */
.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.letter-form { display: grid; gap: 24px; }

.field { display: grid; gap: 7px; }
.field label {
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; color: var(--ink);
  letter-spacing: .01em;
}
.field__hint-inline {
  font-family: var(--font-body); font-weight: 400; font-size: 14px; color: var(--ink-3);
}
.field input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input[type="text"]::placeholder { color: #a89c8f; }
.field input[type="text"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
  outline: none;
}
.field input[aria-invalid="true"] { border-color: var(--red); background: #fffafa; }

.field__error {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--red);
}

.reasons { margin: 0; padding: 0; border: 0; }
.reasons legend {
  padding: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 17px; color: var(--ink);
}
.reasons__list { display: grid; gap: 8px; }

.reason { position: relative; }
.reason__row {
  display: grid; grid-template-columns: 22px 1fr; gap: 13px; align-items: start;
  padding: 13px 15px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}
.reason__row:hover { border-color: var(--line-2); }
.reason:has(input:checked) .reason__row { border-color: var(--red); background: var(--red-tint); }

.reason input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin: 1px 0 0;
  background: #fff;
  border: 2px solid var(--line-2);
  border-radius: 4px;
  cursor: pointer;
  display: grid; place-content: center;
  transition: background-color .12s ease, border-color .12s ease;
}
.reason input[type="checkbox"]::after {
  content: ""; width: 11px; height: 6px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px) scale(.4);
  opacity: 0; transition: opacity .12s ease, transform .12s ease;
}
.reason input[type="checkbox"]:checked { background: var(--red); border-color: var(--red); }
.reason input[type="checkbox"]:checked::after { opacity: 1; transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.reason__text { font-size: 16.5px; line-height: 1.45; color: var(--ink-2); }
.reason:has(input:checked) .reason__text { color: var(--ink); }

.reason--other .reason__row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.reason--other textarea {
  display: block; width: 100%;
  margin-top: -1px;
  padding: 12px 15px;
  font: inherit; font-size: 16.5px; color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  resize: vertical; min-height: 84px;
}
.reason--other textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); outline: none;
}
.reason--other:has(input:checked) textarea { border-color: var(--red); }
.reason__note { margin: 8px 2px 0; font-size: 14px; color: var(--ink-3); }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form-actions .btn { flex: 1 1 auto; }
.form-actions__note { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); }
.form-actions__note b { color: var(--ink-2); }

/* 8 -------------------------------------------------------------- PREVIEW -- */
.preview {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.preview__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: var(--ink);
}
.preview__title {
  font-family: var(--font-narrow);
  font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #fff;
}
.preview__toggle {
  display: none;
  padding: 6px 12px;
  background: transparent; color: #cfc6bd;
  border: 1px solid #4a413b; border-radius: var(--radius);
  font-family: var(--font-narrow); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.preview__toggle:hover { color: #fff; border-color: #7a6f66; }

.preview__meta {
  margin: 0; padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  display: grid; gap: 8px;
}
.preview__row { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; }
.preview__row dt {
  font-family: var(--font-narrow); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.preview__row dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }

.preview__body {
  padding: 20px 22px 24px;
  font-size: 15.5px; line-height: 1.62; color: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
  border-left: 4px solid var(--red);
  min-height: 260px;
}
.preview__body .ph {
  background: var(--red-tint);
  color: var(--red-dark);
  padding: 0 5px; border-radius: 3px; font-weight: 600;
}

/* 9 ---------------------------------------------------------------- TOAST -- */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  transform: translate(-50%, 14px);
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 460px);
  padding: 13px 20px;
  background: var(--ink); color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast[data-visible="true"] { opacity: 1; transform: translate(-50%, 0); }
.toast::before {
  content: ""; width: 9px; height: 9px; flex: none;
  border-radius: 50%; background: #4ade80;
}
.toast[data-tone="warn"]::before { background: #fbbf24; }

/* 10 ----------------------------------------------- FOOTER / PRINT / MOTION */
.site-footer {
  background: var(--ink);
  color: #a79d94;
  padding-block: 34px;
  border-top: 3px solid var(--red);
}
.site-footer__line { margin: 0 0 6px; font-size: 14.5px; }
.site-footer__line b { color: #fff; }
.site-footer__fine { margin-top: 14px; font-size: 13px; color: #7d746c; max-width: 62ch; }

@media (max-width: 560px) {
  .eyebrow { font-size: 12px; letter-spacing: .11em; }
  .hero__cta .btn { flex: 1 1 100%; }
}

@media (max-width: 860px) {
  .action-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  .preview__toggle { display: inline-block; }
  .preview__panel[hidden] { display: none; }
  .form-actions .btn { flex: 1 1 100%; }
  .brand__name { font-size: 12px; }
  .site-nav a { padding: 7px 9px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .hero, .letter-form, .toast, .skip-link, .preview__toggle { display: none !important; }
  body { background: #fff; }
  .preview { border: 0; box-shadow: none; }
  .preview__head { background: #fff; }
  .preview__title { color: #000; }
  .preview__body { border-left: 0; padding: 0; }
}
