/* ==========================================================================
   Ironhaul — Coming Soon
   Custom styles that sit on top of Tailwind utilities.
   Sections:
     1. Tokens
     2. Background: blueprint grids + floating plates
     3. Hero: headline reveal, metallic text, countdown, readiness bar
     4. Form controls
     5. Buttons
     6. Ticker
     7. Material cards
     8. Network map + stats
     9. Roadmap
    10. CTA panel
    11. Reduced motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ink: #0F172A;
  --navy: #1E3A8A;
  --signal: #2563EB;
  --frost: #DBEAFE;
  --chrome: #C7D2DE;
  --line: rgba(148, 163, 184, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { background: var(--ink); }

/* Content is hidden until the intro timeline runs, unless JS/GSAP fails
   (main.js removes .js-loading as a safety net). */
.js-loading .reveal-line,
.js-loading .reveal-item { opacity: 0; }

/* 2. Background ------------------------------------------------------------ */
.blueprint-grid {
  /* oversized so parallax translation never exposes an edge */
  inset: -20% !important;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 85%);
}

.blueprint-grid-fine {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Floating blueprint "plates": outlined rectangles with corner ticks */
.float-plate {
  position: absolute;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(148, 163, 184, 0.04) 10px 11px);
  border-radius: 4px;
  animation: plate-float 14s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}
.float-plate::before,
.float-plate::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-color: rgba(147, 197, 253, 0.5);
  border-style: solid;
}
.float-plate::before { top: -5px; left: -5px; border-width: 1px 0 0 1px; }
.float-plate::after  { bottom: -5px; right: -5px; border-width: 0 1px 1px 0; }

@keyframes plate-float {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50%      { translate: 0 -24px; rotate: 1.5deg; }
}

/* 3. Hero ------------------------------------------------------------------ */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; }

/* Brushed-metal headline accent */
.text-metal {
  background: linear-gradient(100deg, #93C5FD 0%, #F8FAFC 22%, #94A3B8 45%, #E2E8F0 62%, #2563EB 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: metal-sheen 7s ease-in-out infinite;
}
@keyframes metal-sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* Countdown cells */
.count-cell {
  position: relative;
  display: flex;
  min-width: 4.25rem;
  flex-direction: column;
  align-items: center;
  border-radius: 0.875rem;
  padding: 0.9rem 0.75rem 0.7rem;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
/* horizontal "split-flap" seam */
.count-cell::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(15, 23, 42, 0.8);
}
.count-num {
  font-family: Archivo, sans-serif;
  font-stretch: 110%;
  font-weight: 800;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.count-num.tick { animation: count-tick 0.45s var(--ease-out); }
@keyframes count-tick {
  from { transform: translateY(-35%); opacity: 0.2; filter: blur(2px); }
  to   { transform: none; opacity: 1; filter: none; }
}
.count-label {
  margin-top: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #94A3B8;
}
.count-sep {
  align-self: center;
  margin-top: -1.1rem;
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: rgba(37, 99, 235, 0.7);
  animation: sep-blink 1s steps(2, start) infinite;
}
@keyframes sep-blink { to { visibility: hidden; } }
@media (max-width: 400px) {
  .count-cell { min-width: 3.6rem; padding-inline: 0.5rem; }
  .count-sep { display: none; }
}

/* Readiness bar: striped "hazard tape" in brand blues, moving */
.readiness-fill {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.14) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, var(--navy), var(--signal));
  background-size: 17px 17px, 100% 100%;
  animation: stripes 0.8s linear infinite;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.55);
}
@keyframes stripes { to { background-position: 17px 0, 0 0; } }

/* 4. Form controls --------------------------------------------------------- */
.form-card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 40px 80px -30px rgba(2, 6, 23, 0.9),
    0 0 0 1px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(14px);
}
/* metallic top edge */
.form-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--chrome), var(--signal), transparent);
}

.field-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #94A3B8;
}

.field-input {
  min-height: 3.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  padding: 0 1rem;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field-input::placeholder { color: #64748B; }
.field-input:focus {
  outline: none;
  border-color: var(--signal);
  background: rgba(2, 6, 23, 0.75);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}
.field-input[aria-invalid="true"] { border-color: #F87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15); }

/* Segmented control + chips share the "selected = blue plate" look */
.segment span,
.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.4);
  color: #CBD5E1;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.25s var(--ease-out);
}
.segment span { border-radius: 0.625rem; padding: 0.7rem 0.25rem; }
.chip span    { border-radius: 999px; padding: 0.5rem 0.95rem; }
.chip span::before {
  content: "+";
  font-family: "IBM Plex Mono", monospace;
  color: #64748B;
  transition: transform 0.25s var(--ease-out), color 0.25s;
}
.segment:hover span, .chip:hover span { border-color: rgba(37, 99, 235, 0.6); color: #fff; }
.segment input:checked + span,
.chip input:checked + span {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.35), rgba(30, 58, 138, 0.45));
  border-color: var(--signal);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 20px -8px rgba(37, 99, 235, 0.8);
}
.chip input:checked + span::before { content: "✓"; color: var(--frost); }
.segment input:focus-visible + span,
.chip input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.success-check { stroke-dasharray: 24; stroke-dashoffset: 24; }
.is-success .success-check { animation: draw-check 0.6s 0.2s var(--ease-out) forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* 5. Buttons --------------------------------------------------------------- */
.btn-primary,
.btn-ghost,
.btn-light {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  overflow: hidden;
  border-radius: 0.75rem;
  font-family: Archivo, sans-serif;
  font-weight: 700;
  font-stretch: 108%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}
.btn-primary {
  min-height: 3.25rem;
  padding: 0 1.4rem;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(180deg, #3B82F6, var(--signal) 45%, var(--navy));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 30px -10px rgba(37, 99, 235, 0.9);
}
/* light sweep across the button on hover */
.btn-primary::after,
.btn-light::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}
.btn-primary:hover, .btn-light:hover { transform: translateY(-2px); }
.btn-primary:hover::after, .btn-light:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 18px 40px -12px rgba(37, 99, 235, 1); }
.btn-primary:active, .btn-light:active { transform: translateY(0) scale(0.98); }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .btn-light:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }
.btn-primary[disabled] { opacity: 0.7; cursor: progress; }

.btn-ghost {
  padding: 0.6rem 1rem;
  font-size: 0.7rem;
  color: #E2E8F0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.5);
}
.btn-ghost:hover { border-color: var(--signal); color: #fff; background: rgba(37, 99, 235, 0.2); }

.btn-light {
  padding: 1.05rem 2rem;
  font-size: 0.85rem;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #E2E8F0);
  box-shadow: 0 20px 40px -15px rgba(2, 6, 23, 0.7);
}

/* 6. Ticker ---------------------------------------------------------------- */
.ticker { animation: ticker 40s linear infinite; }
.ticker:hover { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* 7. Material cards -------------------------------------------------------- */
.section-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--signal);
}
.section-title {
  margin-top: 0.9rem;
  font-family: Archivo, sans-serif;
  font-stretch: 112%;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.95;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  color: #fff;
}

.material-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(170deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  transform-style: preserve-3d;
  transition: border-color 0.4s, box-shadow 0.4s;
  will-change: transform;
}
/* cursor-tracking spotlight */
.material-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(37, 99, 235, 0.18), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.material-card:hover { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 30px 60px -30px rgba(37, 99, 235, 0.55); }
.material-card:hover::before { opacity: 1; }

.material-icon {
  display: grid;
  place-items: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: 0.9rem;
  color: var(--frost);
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.35), rgba(30, 58, 138, 0.2));
  border: 1px solid rgba(37, 99, 235, 0.45);
  transition: transform 0.5s var(--ease-out);
}
.material-icon svg { width: 1.9rem; height: 1.9rem; }
.material-card:hover .material-icon { transform: translateZ(30px) rotate(-6deg) scale(1.06); }

.material-index {
  margin-top: 1.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: #64748B;
}
.material-title {
  margin-top: 0.4rem;
  font-family: Archivo, sans-serif;
  font-stretch: 110%;
  font-weight: 800;
  font-size: 1.6rem;
  text-transform: uppercase;
  color: #fff;
}
.material-copy { margin-top: 0.75rem; color: #94A3B8; line-height: 1.65; }
.material-specs {
  margin-top: 1.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.material-specs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.14);
  font-size: 0.8rem;
}
.material-specs dt { font-family: "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: 0.15em; color: #64748B; font-size: 0.68rem; }
.material-specs dd { color: #E2E8F0; font-weight: 500; text-align: right; }

/* 8. Network map + stats --------------------------------------------------- */
.network-frame {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: radial-gradient(ellipse at 45% 45%, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.9) 70%);
}
.routes-base path { animation: dash-flow 2.5s linear infinite; }
@keyframes dash-flow { to { stroke-dashoffset: -24; } }

.routes-active path { filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.65)); }

.node circle:first-child { transform-origin: center; animation: node-pulse 3.2s ease-in-out infinite; }
.node:nth-child(2n) circle:first-child { animation-delay: -1.6s; }
@keyframes node-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50%      { transform: scale(1.15); opacity: 1; }
}
/* Hide the text labels on small screens where they would be unreadable */
@media (max-width: 640px) { .node text { display: none; } }

.truck { opacity: 0; filter: drop-shadow(0 0 4px rgba(147, 197, 253, 0.7)); }

.stat-cell {
  background: rgba(15, 23, 42, 0.92);
  padding: 1.75rem 1.5rem;
  transition: background 0.3s;
}
.stat-cell:hover { background: rgba(30, 58, 138, 0.35); }
.stat-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748B;
}
.stat-value {
  margin-top: 0.6rem;
  font-family: Archivo, sans-serif;
  font-stretch: 112%;
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* 9. Roadmap --------------------------------------------------------------- */
.roadmap-step { position: relative; }
.roadmap-dot {
  position: absolute;
  top: 1.6rem;
  left: -2.45rem; /* centres on the mobile track (left 15px, ol padding 3rem) */
  width: 1rem; height: 1rem;
  border-radius: 999px;
  border: 3px solid #334155;
  background: var(--ink);
  transition: border-color 0.4s, box-shadow 0.4s, background 0.4s;
}
.roadmap-step.is-reached .roadmap-dot {
  border-color: var(--signal);
  background: var(--frost);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2), 0 0 20px rgba(37, 99, 235, 0.8);
}
.roadmap-step[data-status="active"].is-reached .roadmap-dot { animation: dot-beacon 1.8s ease-out infinite; }
@keyframes dot-beacon {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7), 0 0 20px rgba(37, 99, 235, 0.8); }
  100% { box-shadow: 0 0 0 16px rgba(37, 99, 235, 0), 0 0 20px rgba(37, 99, 235, 0.8); }
}

.roadmap-card {
  border-radius: 1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.55);
  transition: transform 0.4s var(--ease-out), border-color 0.4s;
}
.roadmap-card:hover { transform: translateY(-4px); border-color: rgba(37, 99, 235, 0.5); }
.roadmap-meta { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--signal); }
.roadmap-step[data-status="next"] .roadmap-meta { color: var(--chrome); }
.roadmap-title { margin-top: 0.45rem; font-family: Archivo, sans-serif; font-stretch: 108%; font-weight: 800; font-size: 1.25rem; text-transform: uppercase; color: #fff; }
.roadmap-copy { margin-top: 0.4rem; color: #94A3B8; line-height: 1.6; font-size: 0.95rem; }

/* Desktop: alternate cards either side of a centred track */
@media (min-width: 640px) {
  .roadmap-step { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4rem; }
  .roadmap-dot { left: 50%; transform: translateX(-50%); }
  .roadmap-step:nth-child(odd)  .roadmap-card { grid-column: 1; text-align: right; }
  .roadmap-step:nth-child(even) .roadmap-card { grid-column: 2; }
}

/* 10. CTA panel ------------------------------------------------------------ */
.cta-panel {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(147, 197, 253, 0.25), transparent 50%),
    linear-gradient(135deg, var(--navy), var(--signal) 60%, #1D4ED8);
  box-shadow: 0 50px 100px -40px rgba(37, 99, 235, 0.7);
}

/* 11. Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ticker { animation: none; }
}
