/* ============================================================
   RAIL TECH INFRA WELDS — Design System
   "Engineered for the line"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900&family=Archivo+Expanded:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* core palette */
  --paper:        #F4F1EC;   /* warm off-white */
  --paper-2:      #ECE7DF;   /* slightly deeper paper */
  --card:         #FBFAF7;
  --ink:          #15171C;   /* near-black steel */
  --steel-900:    #1B1E24;
  --steel-700:    #2C313A;
  --steel-500:    #565E6B;
  --steel-400:    #7A828F;
  --steel-300:    #A7AEB8;
  --steel-200:    #CDD2D9;
  --line:         rgba(21,23,28,0.12);
  --line-soft:    rgba(21,23,28,0.07);
  --line-dark:    rgba(255,255,255,0.10);

  /* molten accent */
  --orange:       #E8500A;
  --orange-bright:#FF6A1A;
  --orange-deep:  #B83C05;
  --ember:        #FFB088;

  /* type */
  --font-display: 'Archivo Expanded', 'Archivo', sans-serif;
  --font-body:    'Archivo', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* spacing rhythm */
  --section: clamp(72px, 9vw, 150px);
  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1320px;

  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; border: 0; }
h1, h2, h3, h4, p, li { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; }
p, .lead { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }
[id] { scroll-margin-top: 100px; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--orange); color: #fff; }

/* ---------- layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1560px; margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.grid { display: grid; gap: clamp(24px, 3vw, 48px); }

/* ---------- typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.02; letter-spacing: -0.01em; }
.h-xxl { font-size: clamp(44px, 8.5vw, 124px); line-height: 0.9; letter-spacing: -0.02em; }
.h-xl  { font-size: clamp(34px, 5.2vw, 76px);  line-height: 0.96; }
.h-lg  { font-size: clamp(28px, 3.6vw, 52px);  line-height: 1.0; }
.h-md  { font-size: clamp(22px, 2.4vw, 34px);  line-height: 1.05; }
.lead  { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.55; color: var(--steel-700); font-weight: 400; }
.muted { color: var(--steel-500); }
.measure { max-width: 60ch; }
.measure-sm { max-width: 46ch; }
strong, b { font-weight: 700; }

/* kicker / mono label */
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--orange);
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 4px rgba(232,80,10,0.16);
}
.kicker.on-dark { color: var(--steel-300); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.mono-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel-400);
}

.orange { color: var(--orange); }
.outline-text {
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px var(--orange);
  color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 26px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  transition: background .25s, color .25s, transform .25s;
  white-space: nowrap;
}
.btn .arrow { transition: transform .3s cubic-bezier(.6,0,.2,1); }
.btn:hover { background: var(--orange); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ghost.on-dark { color: var(--paper); border-color: var(--line-dark); }
.btn-ghost.on-dark:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

.text-link {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 4px;
  transition: color .2s, border-color .2s, gap .2s;
}
.text-link:hover { color: var(--orange); border-color: var(--orange); gap: 12px; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background .3s, box-shadow .3s, transform .4s;
}
/* over dark hero (before scroll): light text */
.site-header:not(.scrolled) .brand-text .name { color: var(--paper); }
.site-header:not(.scrolled) .brand-text .sub { color: var(--steel-300); }
.site-header:not(.scrolled) .nav-links a { color: var(--steel-200); }
.site-header:not(.scrolled) .nav-links a:hover,
.site-header:not(.scrolled) .nav-links a.active { color: #fff; }
.site-header:not(.scrolled) .nav-toggle span { background: var(--paper); }
.site-header.scrolled {
  background: rgba(244,241,236,0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-mark {
  width: 40px; height: 40px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: 5px;
  overflow: hidden;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 4px; height: 150%;
  background: var(--orange);
  transform: rotate(24deg);
}
.brand-mark::before { left: 13px; }
.brand-mark::after  { right: 13px; background: var(--paper); }
.brand-logo { height: 44px; width: auto; max-width: 220px; object-fit: contain; flex: none; }
.brand-text { line-height: 1; }
.brand-text .name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.brand-text .sub {
  font-family: var(--font-mono);
  letter-spacing: 0.26em;
  font-size: 10px;
  color: var(--steel-500);
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--steel-700);
  transition: color .2s, background .2s;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 2px;
  height: 2px; background: var(--orange);
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; align-items: center; margin-right: -10px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); transition: transform .35s cubic-bezier(.6,0,.2,1), opacity .2s, background .3s; }
.nav-toggle.active span { background: var(--paper); }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--ink);
  color: var(--paper);
  padding: 110px var(--gutter) 40px;
  transform: translateY(-100%);
  transition: transform .5s cubic-bezier(.7,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mobile-drawer.open { transform: translateY(0); }
.mobile-drawer a {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(30px, 9vw, 52px);
  padding: 14px 0;
  border-bottom: 1px solid var(--line-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-drawer a .idx { font-family: var(--font-mono); font-size: 13px; color: var(--orange); font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-top: clamp(60px,7vw,110px); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: clamp(32px, 4vw, 64px);
  padding-bottom: 60px;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-400);
  font-weight: 500;
  margin-bottom: 22px;
}
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: var(--steel-200); transition: color .2s; }
.footer-col a:hover { color: var(--orange); }
.footer-brand .name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
}
.footer-brand p { color: var(--steel-300); margin-top: 16px; max-width: 34ch; font-size: 15px; }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-block: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--steel-400);
}
.footer-bottom a { color: var(--steel-300); }
.footer-bottom a:hover { color: var(--orange); }
.footer-social { display: flex; gap: 20px; flex-wrap: wrap; }

/* big footer wordmark */
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(60px, 16vw, 260px);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px var(--steel-700);
  text-align: center;
  white-space: nowrap;
  padding-top: 30px;
  user-select: none;
  overflow: hidden;
}

/* ---------- rail divider motif ---------- */
.rail-rule {
  height: 0;
  border-top: 2px solid var(--ink);
  position: relative;
}
.rail-rule::before {
  content: "";
  position: absolute;
  top: 6px; left: 0; right: 0;
  border-top: 2px solid var(--ink);
}

/* ---------- section heading block ---------- */
.section-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(40px,5vw,72px); }
.section-head .kicker { margin-bottom: 4px; }
.section-head.center { align-items: center; text-align: center; }

/* ---------- image placeholder ---------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(21,23,28,0.05) 0 12px, transparent 12px 24px),
    var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--steel-500);
}
.ph::after {
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel-500);
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: rgba(244,241,236,0.7);
  border-radius: 3px;
  text-align: center;
  max-width: 80%;
}
.ph.dark {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 12px, transparent 12px 24px),
    var(--steel-900);
  border-color: var(--line-dark);
}
.ph.dark::after { color: var(--steel-300); border-color: var(--line-dark); background: rgba(0,0,0,0.25); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.6,.2,1), transform .8s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { animation: none !important; }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; white-space: nowrap; display: flex; }
.marquee-track { display: inline-flex; align-items: center; will-change: transform; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-item {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(28px, 4vw, 60px);
  display: inline-flex;
  align-items: center;
  padding-inline: 28px;
  color: var(--ink);
}
.marquee-item .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--orange); margin-left: 56px; }
.marquee-item.hollow { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }

/* ---------- breadcrumb hero (inner pages) ---------- */
.page-hero {
  background: var(--ink);
  color: var(--paper);
  padding-top: clamp(140px, 16vw, 220px);
  padding-bottom: clamp(60px, 7vw, 110px);
  position: relative;
  overflow: hidden;
}
.page-hero .glow {
  position: absolute;
  right: -10%; top: -40%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(232,80,10,0.30), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.breadcrumb { display: flex; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel-400); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { color: var(--orange); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 2.4vw, 40px);
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s, border-color .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -30px rgba(21,23,28,0.4); border-color: var(--steel-300); }

/* utility */
.flex { display: flex; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap-gap { flex-wrap: wrap; gap: 16px; }
.eyebrow-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .nav-links a { padding: 10px 11px; font-size: 12px; }
  .nav-links a.active::after { left: 11px; right: 11px; }
}
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-bar { height: 70px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  /* comfortable tap targets */
  .footer-col li { margin-bottom: 2px; }
  .footer-col a { display: inline-block; padding: 9px 0; }
  .footer-social { gap: 8px 22px; }
  .footer-social a { display: inline-flex; align-items: center; min-height: 44px; }
  .breadcrumb { gap: 12px; }
  .breadcrumb a, .breadcrumb span { display: inline-flex; align-items: center; min-height: 44px; }
  .mobile-drawer { padding-top: 96px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-right .btn { display: none; }
  .site-footer { padding-top: 60px; }
  .footer-bottom { flex-direction: column; gap: 16px; }
  .footer-wordmark { font-size: 19vw; padding-top: 18px; }
  .btn { padding: 15px 22px; font-size: 12px; }
}
/* short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .mobile-drawer { padding-top: 84px; }
  .mobile-drawer a { font-size: 24px; padding: 9px 0; }
}
