/* ============================================================
   JLP CIVIL INC. - DESIGN SYSTEM
   Single source of truth per 03-BUILD-STANDARD.md v1.1.
   Every color, font, size, and spacing value lives in :root.
   No raw hex, font name, or magic number appears below this
   block. If a value is used twice, it is a token.
   ============================================================ */

:root {
  /* ---- Color roles (section 1a: every color has a job) ----
     --red        INTERACTIVE: buttons, link underlines, slider
                  handle, plus exactly two sanctioned brand
                  moments (headline periods, hazard stripes).
     --red-deep   DEPTH ONLY: hover states, stripe alternation,
                  shadows. Never a resting-state control surface.
     --ink/--panel/--steel  SURFACES, never text colors.
     --bone       Ink on dark. --dust/--faint are its quieter
                  steps. Color never carries meaning alone.     */
  --red:       #E11D1D;
  --red-deep:  #A81111;
  --ink:       #0C0C0B;
  --panel:     #14140F;
  --steel:     #1D1C17;
  --bone:      #F2EFE9;
  --dust:      rgba(242, 239, 233, 0.70);
  --faint:     rgba(242, 239, 233, 0.50);
  --line:      rgba(242, 239, 233, 0.12);
  --line-strong: rgba(242, 239, 233, 0.35);

  /* Focus ruling: the standard's section 2 names the 2px bone
     outline as the established focus indicator. Bone wins over
     red here because red-on-ink fails the 3:1 UI contrast floor
     that a focus ring must clear. Red keeps every other
     interactive job. Reasoning recorded so this is not
     "unified" back to red later. */
  --focus-ring: var(--bone);

  /* ---- Type ---- */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body:    'Barlow', 'Helvetica Neue', sans-serif;
  --font-label:   'Barlow Semi Condensed', 'Arial Narrow', sans-serif;

  --text-base: 1.0625rem;
  --text-sm:   0.9rem;
  --text-xs:   0.76rem;
  --text-h1:   clamp(2.9rem, 7.2vw, 5.4rem);
  --text-h2:   clamp(2rem, 4.4vw, 3.2rem);
  --text-h3:   1.05rem;
  --leading-body: 1.7;
  --leading-tight: 1.04;
  --tracking-label: 0.16em;
  --tracking-kicker: 0.22em;

  /* ---- Spacing scale (fixed, never arbitrary) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ---- Layout ---- */
  --wrap-max: 1200px;
  --wrap-gutter: 48px;
  --touch-min: 44px;

  /* ---- Motion ---- */
  --ease: 0.2s ease;
}

/* ============================================================
   BASE
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  background: var(--ink);
  color: var(--dust);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

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

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

/* Skip link: first focusable element on every page (section 2) */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--space-3) var(--space-4);
}
.skip-link:focus-visible { top: var(--space-4); }

/* ============================================================
   TYPE COMPONENTS
   ============================================================ */

h1, h2, h3,
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bone);
  line-height: var(--leading-tight);
  letter-spacing: 0.005em;
}
h1 { font-size: var(--text-h1); }
h2, .section-title { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); letter-spacing: 0.06em; }

/* Sanctioned brand moment 1 of 2: the headline period */
.title-period { color: var(--red); }

.eyebrow {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--red);
}

.lead { max-width: 56ch; }

/* ============================================================
   LAYOUT COMPONENTS
   ============================================================ */

.section { padding: var(--space-9) 0; }

.wrap {
  width: min(var(--wrap-max), 100% - var(--wrap-gutter));
  margin: 0 auto;
}

.card {
  background: var(--steel);
  border: 1px solid var(--line);
}

/* Sanctioned brand moment 2 of 2: the hazard stripe band */
.hazard-band {
  height: var(--space-2);
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 var(--space-4),
    var(--red-deep) var(--space-4) var(--space-6)
  );
}

/* ============================================================
   BUTTONS (section 1b: button law)
   One shape family. Primary = filled --red. Secondary =
   outlined. The 44px touch floor lives HERE so no variant can
   ship without it. One primary per section. No hover-only
   behavior anywhere.
   ============================================================ */

.btn {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover,
.btn-primary:active { background: var(--red-deep); }

.btn-secondary {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
}
.btn-secondary:hover,
.btn-secondary:active { border-color: var(--bone); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   FIELDS (section 4: the form rules)
   Real labels always. Errors pair icon + text with the color,
   never color alone, and attach via aria-describedby.
   ============================================================ */

.field { margin-bottom: var(--space-5); }

.field label {
  display: block;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--space-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-3) var(--space-4);
  min-height: var(--touch-min);
  transition: border-color var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--red);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--bone);
}
.field-error svg {
  width: 15px;
  height: 15px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 3px;
}

.field-hint {
  font-size: var(--text-sm);
  color: var(--faint);
  margin-top: var(--space-2);
}

/* Status blocks: transient feedback lives in one consistent
   place per pattern (section 2a). Success and failure both
   pair the color bar with words. */
.status {
  border-left: 3px solid var(--red);
  background: var(--steel);
  padding: var(--space-5);
  color: var(--bone);
}

/* ============================================================
   PAGE SECTIONS
   Layout for the site's structural sections. Tokens only; any
   raw value appearing below this line is a defect.
   ============================================================ */

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(12, 12, 11, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) 0;
}
.logo-link { display: inline-flex; }
.logo-img { height: 44px; width: auto; display: block; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.nav-links a {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dust);
  padding: var(--space-2) 0;
  transition: color var(--ease);
}
.nav-links a:hover,
.nav-links a:active { color: var(--bone); }
.nav-cta { display: inline-flex; }
.nav-cta .btn { padding: var(--space-3) var(--space-4); }
.nav-cta-mobile { display: none; }
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--bone);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }
@media (max-width: 1100px) {
  .menu-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    display: none;
    padding: var(--space-2) var(--space-5) var(--space-4);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
    min-height: var(--touch-min);
  }
  .nav-cta-mobile { display: block; }
  .nav-cta-mobile a { color: var(--red); }
}
@media (max-width: 560px) { .logo-img { height: 36px; } }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img, .hero-media .ph { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(12,12,11,0.94) 0%, rgba(12,12,11,0.78) 42%, rgba(12,12,11,0.25) 100%);
}
.hero .wrap { position: relative; z-index: 2; padding: var(--space-9) 0; }
.hero h1 { max-width: 14ch; }
.hero-slogan {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--red);
  margin: var(--space-5) 0 var(--space-2);
}
.hero-sub { max-width: 46ch; margin-bottom: var(--space-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: var(--space-7) 0; }
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.footer-logo-img { height: 56px; width: auto; display: block; }
.footer-nav { display: flex; gap: var(--space-5); list-style: none; flex-wrap: wrap; }
.footer-nav a {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--faint);
  padding: var(--space-2) 0;
}
.footer-nav a:hover, .footer-nav a:active { color: var(--bone); }
.footer-fine {
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: var(--space-5);
}
.footer-fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-fine a:hover, .footer-fine a:active { color: var(--bone); }
@media (max-width: 560px) { .footer-logo-img { height: 44px; } }

/* ---- Placeholder blocks (auto-swap when real images exist) ---- */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
  background:
    repeating-linear-gradient(-45deg, rgba(242,239,233,0.03) 0 14px, transparent 14px 28px),
    var(--steel);
  color: var(--faint);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ---- Services strip (exactly three insured services) ---- */
.services-strip {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
.service-cell {
  background: var(--panel);
  padding: var(--space-6) var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  justify-content: center;
}
.service-cell svg {
  width: 26px;
  height: 26px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: var(--space-1);
}
.service-cell h2 {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}
.service-cell p {
  font-size: var(--text-sm);
  color: var(--faint);
  line-height: 1.5;
}
@media (max-width: 800px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-cell { justify-content: flex-start; }
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 460px) 1fr;
  gap: var(--space-8);
  align-items: center;
}
.about-media { position: relative; }
.about-media img { width: 100%; }
.about-media .ph {
  width: 100%;
  aspect-ratio: 4 / 5;
}
.about-media::after {
  content: "";
  position: absolute;
  inset: auto -14px -14px auto;
  width: 46%;
  height: 46%;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  pointer-events: none;
}
.about-copy p { margin-bottom: var(--space-4); max-width: 54ch; }
.about-sign {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--bone);
  letter-spacing: 0.06em;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .about-media { max-width: 420px; }
}

/* ---- Fleet ---- */
.fleet-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
  flex-wrap: wrap;
}
.fleet-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(320px, 78vw);
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-4);
  scrollbar-color: var(--red) var(--steel);
}
.fleet-card { scroll-snap-align: start; }
.fleet-card figure { aspect-ratio: 4 / 3; overflow: hidden; margin: 0; }
.fleet-card img, .fleet-card .ph { width: 100%; height: 100%; object-fit: cover; }
.fleet-meta { padding: var(--space-4) var(--space-5) var(--space-5); }
.fleet-meta h3 { margin-bottom: var(--space-1); }
.fleet-meta p { font-size: 0.84rem; color: var(--faint); }

/* ---- Projects: before / after sliders ---- */
.projects {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ba-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-7);
}
.ba-item h3 { margin-top: var(--space-4); text-align: center; }
.ba-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  user-select: none;
}
.ba-frame img, .ba-frame .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ba-after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--cut, 50%);
  width: 2px;
  background: var(--red);
  pointer-events: none;
}
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6-6 6 6 6'/%3E%3Cpath d='m15 6 6 6-6 6'/%3E%3C/svg%3E");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: center;
}
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.ba-range:focus-visible ~ .ba-focus-ring,
.ba-frame:has(.ba-range:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.ba-tag {
  position: absolute;
  bottom: var(--space-2);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  pointer-events: none;
}
.ba-tag.before { left: var(--space-2); background: rgba(12,12,11,0.8); color: var(--dust); }
.ba-tag.after { right: var(--space-2); background: var(--red); color: #fff; }
@media (max-width: 900px) {
  .ba-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}

/* ---- Instagram ---- */
.ig-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-7);
}
.ig-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
}
.ig-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
}
.ig-grid img, .ig-grid .ph { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.ig-grid a:hover img, .ig-grid a:focus-visible img { transform: scale(1.05); }
@media (max-width: 900px) { .ig-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- Contact ---- */
.contact { background: var(--panel); border-top: 1px solid var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) 1fr;
  gap: var(--space-8);
}
.contact-list { list-style: none; margin-top: var(--space-6); display: grid; gap: var(--space-4); }
.contact-list li { display: flex; gap: var(--space-4); align-items: center; }
.contact-list svg { width: 20px; height: 20px; color: var(--red); flex-shrink: 0; }
.contact-list a { color: var(--bone); text-decoration: none; font-weight: 500; }
.contact-list a:hover, .contact-list a:active { text-decoration: underline; }
.contact-list .sub { display: block; font-size: 0.84rem; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 0; }
.form-note { font-size: 0.85rem; color: var(--faint); margin-top: var(--space-3); }
.form-status { margin-top: var(--space-4); display: none; }
.form-status.show { display: block; }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-7); }
  .form-grid { grid-template-columns: 1fr; }
}

/* Required tag: sits beside the label, outside it, so Netlify's
   email headings stay clean while required stays marked in text. */
.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.field-label-row label { margin-bottom: var(--space-2); }
.field-req {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- Projects: coming-soon teaser (temporary until real before/afters; ba slider styles kept for restoration) ---- */
.ba-coming {
  margin-top: var(--space-7);
  background: var(--steel);
  border: 1px solid var(--line);
  text-align: center;
  padding: var(--space-8) var(--space-5);
}
.ba-coming h3 { margin-bottom: var(--space-3); }
.ba-coming p { color: var(--faint); max-width: 48ch; margin: 0 auto var(--space-5); }

/* ---- Projects: real project grid ---- */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7) var(--space-6); margin-top: var(--space-7); }
.proj-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.proj-shot { position: relative; }
.proj-item h3 { margin-top: var(--space-4); text-align: center; }
.proj-note { color: var(--faint); text-align: center; margin-top: var(--space-7); font-size: var(--text-sm); }
@media (max-width: 900px) { .proj-grid { grid-template-columns: 1fr; } }

.proj-loc { font-family: var(--font-label); font-weight: 600; font-size: 0.68rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--faint); text-align: center; margin-top: var(--space-1); }

/* Nav labels and the CTA never wrap internally; below 1100px the menu takes over */
.nav-links a { white-space: nowrap; }
.nav-cta .btn { white-space: nowrap; }

/* Fleet carries the panel band now that Projects is retired (keeps the page rhythm) */
#fleet { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Tighter section rhythm on phones */
@media (max-width: 700px) {
  .section { padding: var(--space-8) 0; }
}
