/* Freightyard — holding page */

:root {
  color-scheme: light dark;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --hairline: rgba(0, 0, 0, 0.08);
  --accent: #ff6b1a;
  --accent-soft: rgba(255, 107, 26, 0.12);
  --positive: #248a3d;
  --material: rgba(245, 245, 247, 0.72);
  --material-strong: rgba(255, 255, 255, 0.78);
  --material-edge: rgba(255, 255, 255, 0.7);
  --shadow-float: 0 1px 1px rgba(0, 0, 0, 0.04), 0 12px 32px -8px rgba(0, 0, 0, 0.18);

  /* Yard scene (read by yard.js) */
  --yard-ground: #ebebef;
  --yard-lane: #e0e0e6;
  --yard-line: rgba(0, 0, 0, 0.07);
  --yard-dash: rgba(255, 255, 255, 0.95);
  --yard-text: rgba(0, 0, 0, 0.26);
  --yard-shadow: 0.11;
  --crane-top: #ffffff;
  --crane-side: #e8e8ed;
  --crane-end: #d2d2d8;
  --steel: #3a3a3f;
  --cable: rgba(45, 45, 50, 0.6);
  --glass: #2c3440;

  --gutter: max(20px, env(safe-area-inset-left));
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --hairline: rgba(255, 255, 255, 0.1);
    --accent: #ff7a2e;
    --accent-soft: rgba(255, 122, 46, 0.16);
    --positive: #30d158;
    --material: rgba(0, 0, 0, 0.66);
    --material-strong: rgba(36, 36, 38, 0.74);
    --material-edge: rgba(255, 255, 255, 0.1);
    --shadow-float: 0 1px 1px rgba(0, 0, 0, 0.3), 0 16px 40px -10px rgba(0, 0, 0, 0.7);

    --yard-ground: #111113;
    --yard-lane: #18181b;
    --yard-line: rgba(255, 255, 255, 0.07);
    --yard-dash: rgba(255, 255, 255, 0.16);
    --yard-text: rgba(255, 255, 255, 0.24);
    --yard-shadow: 0.42;
    --crane-top: #f2f2f7;
    --crane-side: #d1d1d6;
    --crane-end: #a9a9ae;
    --steel: #4a4a50;
    --cable: rgba(210, 210, 215, 0.5);
    --glass: #1f2630;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Navigation: a translucent layer content scrolls beneath ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 var(--gutter);
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 240ms ease;
}

.nav.is-scrolled {
  box-shadow: 0 1px 0 var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 26px;
  height: 26px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.status-dot,
.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.status-dot::after,
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: ping 2.4s var(--ease-out) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ---------- Hero ---------- */

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 104px) var(--gutter) 0;
  text-align: center;
}

.eyebrow,
.section-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(2.5rem, 1.35rem + 5.2vw, 5.25rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 .soft {
  display: block;
  color: var(--text-secondary);
}

.lede {
  max-width: 36em;
  margin: 24px auto 0;
  color: var(--text-secondary);
  font-size: clamp(1.0625rem, 0.98rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}

/* ---------- Yard ---------- */

.yard {
  margin-top: clamp(0px, 2vh, 24px);
}

.yard-stage {
  position: relative;
  height: clamp(340px, 46vw, 680px);
}

#yard {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, #000 82%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, #000 82%, transparent);
  mask-composite: intersect;
}

.tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  min-width: 190px;
  max-width: 260px;
  padding: 12px 14px 11px;
  border-radius: 14px;
  background: var(--material-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--material-edge), var(--shadow-float);
  pointer-events: none;
  transform-origin: 0 0;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  scale: 0.94;
  transition:
    opacity 160ms ease,
    scale 220ms var(--ease-out);
}

.tooltip.is-visible {
  opacity: 1;
  scale: 1;
}

.tip-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.tip-name {
  font: 600 0.9375rem/1.25 ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tip-meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.tip-prov {
  margin-top: 2px;
  color: var(--positive);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tip-action {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.tip-action:empty {
  display: none;
}

.tip-action.is-queued {
  color: var(--accent);
}

.yard-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 20px;
  max-width: 1080px;
  margin: 4px auto 0;
  padding: 0 var(--gutter);
}

.ticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 0;
  padding: 9px 16px 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}

#ticker-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition:
    opacity 200ms ease,
    transform 200ms var(--ease-out);
}

#ticker-text.is-changing {
  opacity: 0;
  transform: translateY(3px);
}

.yard-meta {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.yard-meta .sep {
  margin: 0 6px;
}

/* ---------- Features ---------- */

.features {
  max-width: 1080px;
  margin: clamp(88px, 14vh, 160px) auto 0;
  padding: 0 var(--gutter);
}

h2 {
  max-width: 16em;
  margin: 10px 0 0;
  font-size: clamp(1.875rem, 1.2rem + 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.card {
  padding: 26px 24px 28px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 18px 0 8px;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96875rem;
  line-height: 1.5;
  letter-spacing: -0.004em;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1080px;
  margin: clamp(88px, 14vh, 160px) auto 0;
  padding: 24px var(--gutter) max(40px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

/* ---------- Motion ---------- */

.rise {
  animation: rise 1s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .yard-meta .sep,
  .yard-meta #yard-count {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    animation-name: fade;
    animation-duration: 0.4s;
  }

  @keyframes fade {
    from {
      opacity: 0;
    }
  }

  .js .reveal {
    transform: none;
    transition: opacity 0.4s ease;
  }

  .status-dot::after,
  .live-dot::after {
    animation: none;
    opacity: 0;
  }

  .tooltip {
    scale: 1;
  }

  #ticker-text {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .tooltip {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hairline: rgba(127, 127, 127, 0.6);
  }

  .tooltip {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--text-secondary), var(--shadow-float);
  }
}
