/* Railgistics — styles */
:root {
  --night: #14181C;
  --steel: #2B333A;
  --steel-2: #353F47;
  --paper: #EDE7DA;
  --paper-2: #F6F2E9;
  --oxide: #D4502A;
  --oxide-dark: #A8401F;
  --amber: #F2B233;
  --patina: #4C8C99;

  --text: #1A1F23;
  --text-muted: #4B545B;
  --text-light: #EEF0F1;
  --text-light-muted: #B9C0C6;
  --line: rgba(20, 24, 28, 0.16);
  --line-light: rgba(238, 240, 241, 0.14);
  --error-light: #FF9C82;

  --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;
  --gutter: 1rem;
  --container: 74rem;

  --radius-sm: 3px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10, 12, 14, 0.2);
  --shadow-md: 0 14px 32px -16px rgba(10, 12, 14, 0.55);

  /* track: two rails over ties */
  --rails: linear-gradient(180deg, transparent 0 22%, #8A949C 22% 32%, transparent 32% 68%, #8A949C 68% 78%, transparent 78%);
  --ties: repeating-linear-gradient(90deg, #5A4636 0 10px, transparent 10px 26px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0 0 var(--space-4);
}
h1 { font-size: clamp(2.8rem, 12vw, 6.2rem); }
h2 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
h3 { font-size: 1.6rem; font-weight: 600; }
p { margin: 0 0 var(--space-4); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--amber); color: var(--night);
  border-radius: var(--radius-sm);
  transform: translateY(-200%); z-index: 100;
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.kicker {
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--oxide-dark);
  margin-bottom: var(--space-3);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 24, 28, 0.95);
  color: var(--text-light);
  border-bottom: 3px solid var(--oxide);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }
.brand-text {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1;
  display: inline-flex; align-items: baseline; gap: var(--space-2);
}
.brand-text small { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; color: var(--amber); }

.burger {
  width: 44px; height: 44px;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line-light); border-radius: var(--radius-sm);
  cursor: pointer; padding: 0;
}
.burger span { display: block; width: 20px; height: 2px; background: var(--text-light); transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--night); border-bottom: 1px solid var(--line-light);
  opacity: 0; transform: translateY(-8px); visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.site-nav.is-open { opacity: 1; transform: translateY(0); visibility: visible; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.site-nav ul { list-style: none; margin: 0; padding: var(--space-3) var(--gutter) var(--space-5); }
.site-nav a { display: block; padding: var(--space-3) 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line-light); }
.site-nav a:hover { color: var(--amber); }
.site-nav .nav-cta { color: var(--amber); border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--space-5);
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  text-decoration: none; border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--amber); color: var(--night); }
.btn-ghost { border-color: rgba(238, 240, 241, 0.5); color: var(--text-light); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(20, 24, 28, 0) 60%, rgba(20, 24, 28, 0.9)),
    repeating-linear-gradient(90deg, rgba(238, 240, 241, 0.035) 0 1px, transparent 1px 64px),
    radial-gradient(ellipse at 80% 0%, rgba(242, 178, 51, 0.16), transparent 50%),
    var(--night);
  color: var(--text-light);
  overflow: hidden;
}
.hero-inner { padding-top: var(--space-8); padding-bottom: var(--space-7); }
.hero .eyebrow {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-light-muted);
}
.signal {
  flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(242, 178, 51, 0.25);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero h1 span { display: block; color: var(--amber); }
.lead { font-size: 1.1rem; max-width: 38rem; color: var(--text-light-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

/* the consist (train) */
.consist { position: relative; padding: 0 0 var(--space-5); overflow: hidden; }
.consist-train {
  display: flex; align-items: flex-end; gap: 6px;
  padding-left: var(--gutter);
  width: max-content;
  animation: rollin 2.6s var(--ease) both;
}
@keyframes rollin { from { transform: translateX(-60%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.car {
  position: relative; flex: none;
  height: 74px; width: 170px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.car::before, .car::after {
  content: ""; position: absolute; bottom: -14px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #9AA3AA 0 3px, #2B333A 3px 8px, #59636B 8px);
}
.car::before { left: 16px; }
.car::after { right: 16px; }
.car-label {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 0.95rem; letter-spacing: 0.08em; color: var(--paper);
  text-align: center; padding: 0 var(--space-2); line-height: 1.1;
}
.car-loco {
  width: 150px; height: 84px;
  background: linear-gradient(180deg, var(--amber) 0 18%, var(--steel-2) 18% 100%);
  border-radius: 10px var(--radius-sm) var(--radius-sm) var(--radius-sm);
}
.car-loco .car-label { color: var(--amber); font-size: 0.85rem; padding-top: var(--space-4); }
.car-cab {
  position: absolute; top: 22px; left: 12px; width: 26px; height: 18px;
  background: var(--patina); border-radius: 2px;
}
.car-box { background: repeating-linear-gradient(90deg, var(--oxide) 0 14px, #BF4825 14px 16px); }
.car-hopper {
  background: var(--patina);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 88% 100%, 12% 100%, 0 70%);
}
.car-tank {
  background: linear-gradient(180deg, #5C6770, var(--steel) 55%, #20262B);
  border-radius: 40px;
  height: 60px;
}
.car-flat {
  height: 56px;
  background:
    linear-gradient(180deg, transparent 0 70%, var(--steel-2) 70%),
    repeating-linear-gradient(90deg, #8A6A3F 0 34px, transparent 34px 40px);
}
.car-flat .car-label { color: var(--night); background: var(--paper); padding: 2px var(--space-2); border-radius: 2px; margin-bottom: 12px; }
.track { height: 18px; background: var(--rails), var(--ties); }

/* ---------- Rail divider (signature) ---------- */
.rail-divider { height: 18px; background: var(--rails), var(--ties), var(--paper); }

/* ---------- Sections ---------- */
.section { padding: var(--space-8) 0; }
.section-dark { background: var(--night); color: var(--text-light); }
.section-dark .kicker { color: var(--amber); }
.section-dark p { color: var(--text-light-muted); }
.section-steel { background: var(--steel); color: var(--text-light); }
.section-steel .kicker { color: var(--amber); }
.section-steel p { color: var(--text-light-muted); }
.section-head { max-width: 44rem; margin-bottom: var(--space-7); }
.section-head p:last-child { color: var(--text-muted); }
.section-dark .section-head p:last-child { color: var(--text-light-muted); }

/* services */
.services { display: grid; gap: var(--space-5); }
.service {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 8px solid var(--oxide);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.service:nth-child(2) { border-top-color: var(--patina); }
.service:nth-child(3) { border-top-color: var(--steel); }
.service:nth-child(4) { border-top-color: var(--amber); }
.service-num {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.9rem; color: var(--oxide-dark);
  margin-bottom: var(--space-2);
}
.service p { color: var(--text-muted); }
.service ul { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.service li { position: relative; padding: var(--space-2) 0 var(--space-2) var(--space-5); border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.service li::before {
  content: ""; position: absolute; left: 0; top: 0.95em;
  width: 12px; height: 4px; background: var(--rails), var(--steel);
}

/* route map */
.route { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: var(--space-6); }
.route::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 6px;
  background: linear-gradient(90deg, #8A949C 0 1px, transparent 1px 5px, #8A949C 5px), repeating-linear-gradient(180deg, #5A4636 0 3px, transparent 3px 9px);
}
.stop { position: relative; padding-left: var(--space-7); }
.stop-dot {
  position: absolute; left: 0; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--night); border: 4px solid var(--amber);
}
.stop:last-child .stop-dot { border-color: var(--oxide); background: var(--oxide); }
.stop-code { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); margin-bottom: var(--space-1); }
.section-dark .stop-code { color: var(--amber); }
.stop h3 { color: var(--text-light); margin-bottom: var(--space-2); }
.stop p:last-child { margin: 0; }

/* manifest */
.clients-grid { display: grid; gap: var(--space-5); }
.manifest { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.manifest li {
  display: flex; align-items: baseline; gap: var(--space-4);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  font-size: 1.5rem; letter-spacing: 0.02em; line-height: 1.15;
}
.manifest span { font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; color: var(--oxide-dark); min-width: 1.6rem; }

/* about + waybill */
.about-grid { display: grid; gap: var(--space-7); align-items: center; }
.waybill {
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(26, 31, 35, 0.08) 31px 32px),
    var(--paper-2);
  color: var(--text);
  padding: var(--space-5);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: rotate(-1.5deg);
  max-width: 26rem;
  position: relative;
}
.waybill-head {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 1.8rem; letter-spacing: 0.06em; border-bottom: 2px solid var(--text);
  padding-bottom: var(--space-2);
}
.section-steel .waybill p.waybill-head { color: var(--text); }
.waybill dl { margin: 0; }
.waybill dl div { display: grid; grid-template-columns: 6rem 1fr; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px dashed var(--line); }
.waybill dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); padding-top: 0.2em; }
.waybill dd { margin: 0; font-weight: 500; }
.section-steel .waybill p.waybill-stamp {
  display: inline-block; margin: var(--space-4) 0 0;
  padding: var(--space-1) var(--space-3);
  border: 3px solid var(--oxide-dark); color: var(--oxide-dark);
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
  transform: rotate(-6deg);
}

/* contact */
.contact-grid { display: grid; gap: var(--space-7); }
.contact-list { margin: var(--space-5) 0 0; }
.contact-list div { padding: var(--space-3) 0; border-top: 1px solid var(--line-light); }
.contact-list dt { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.contact-list dd { margin: var(--space-1) 0 0; word-break: break-word; }
.contact-list a { color: var(--text-light); }

.form { padding: var(--space-5); background: var(--steel); border-top: 6px solid var(--amber); border-radius: var(--radius-sm); }
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 500; margin-bottom: var(--space-2); }
.optional { color: var(--text-light-muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  font: inherit; color: var(--text-light);
  background: rgba(20, 24, 28, 0.55);
  border: 1px solid rgba(238, 240, 241, 0.28); border-radius: var(--radius-sm);
}
.field select option { color: var(--text); }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9AA3AA; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 178, 51, 0.3); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error-light); }
.error { margin: var(--space-1) 0 0; min-height: 1.2em; font-size: 0.875rem; color: var(--error-light); }
.section-dark .form .error { color: var(--error-light); }
.form-success { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border-left: 4px solid var(--amber); background: rgba(242, 178, 51, 0.12); }
.section-dark .form-success { color: var(--text-light); }

/* ---------- Legal pages ---------- */
.page-hero { background: var(--night); color: var(--text-light); padding: var(--space-8) 0 var(--space-7); }
.page-hero .kicker { color: var(--amber); }
.page-hero p { color: var(--text-light-muted); margin: 0; }
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.9rem; margin-top: var(--space-7); }
.prose p, .prose li { color: var(--text-muted); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: var(--space-2); }
.prose a { color: var(--oxide-dark); }

.not-found { min-height: 60vh; display: flex; align-items: center; }
.not-found .code { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 24vw, 11rem); line-height: 1; color: var(--oxide-dark); margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--text-light); padding: 0 0 var(--space-6); }
.site-footer::before { content: ""; display: block; height: 18px; background: var(--rails), var(--ties), var(--steel); margin-bottom: var(--space-7); }
.footer-top { display: flex; flex-direction: column; gap: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line-light); }
.footer-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.footer-nav a { text-decoration: none; color: var(--text-light-muted); }
.footer-nav a:hover { color: var(--amber); }
.legal { padding-top: var(--space-5); font-size: 0.8125rem; line-height: 1.6; color: var(--text-light-muted); }
.legal-list { margin: 0 0 var(--space-4); display: grid; gap: var(--space-1) var(--space-6); }
.legal-list div { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); }
.legal-list dt { color: var(--text-light-muted); }
.legal-list dt::after { content: ":"; }
.legal-list dd { margin: 0; color: var(--text-light); word-break: break-word; }
.legal a { color: var(--text-light); }
.legal-copy { margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--line-light); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Breakpoints ---------- */
@media (min-width: 480px) {
  :root { --gutter: 1.5rem; }
  .form { padding: var(--space-6); }
}

@media (min-width: 768px) {
  :root { --gutter: 2rem; }
  .section { padding: var(--space-9) 0; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .route { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
  .route::before {
    left: 6px; right: 6px; top: 9px; bottom: auto; width: auto; height: 6px;
    background: linear-gradient(180deg, #8A949C 0 1px, transparent 1px 5px, #8A949C 5px), repeating-linear-gradient(90deg, #5A4636 0 3px, transparent 3px 9px);
  }
  .stop { padding-left: 0; padding-top: var(--space-7); }
  .about-grid { grid-template-columns: 1.3fr 1fr; }
  .legal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { flex-direction: row; justify-content: space-between; align-items: center; }
  .car { width: 200px; }
}

@media (min-width: 1024px) {
  .burger { display: none; }
  .site-nav { position: static; opacity: 1; transform: none; visibility: visible; background: transparent; border: 0; }
  .site-nav ul { display: flex; align-items: center; gap: var(--space-5); padding: 0; }
  .site-nav a { border: 0; padding: var(--space-2) 0; }
  .site-nav .nav-cta { padding: var(--space-2) var(--space-4); border: 1px solid var(--amber); border-radius: var(--radius-sm); }
  .hero-inner { padding-top: var(--space-9); }
  .services { grid-template-columns: repeat(4, 1fr); }
  .clients-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
  .contact-grid { grid-template-columns: 1fr 1.1fr; align-items: start; }
  .consist-train { padding-left: calc((100vw - var(--container)) / 2 + var(--gutter)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
