/* Caird Systems: concrete, stencil, international orange */
:root {
  --paper: #E8E5DE;
  --concrete: #C4C1B9;
  --steel: #55595B;
  --ink: #000000;
  --orange: #FF4F00;
  --rule: 3px solid var(--ink);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --stencil: "Big Shoulders Stencil Display", "Arial Narrow", Impact, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Scroll progress */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 5px; z-index: 50;
  background: var(--orange); transform-origin: 0 50%; transform: scaleX(0);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: stretch;
  height: 60px;
  background: var(--paper); border-bottom: var(--rule);
}
.wordmark {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem var(--pad);
  font-family: var(--stencil); font-weight: 800; font-size: 1.6rem;
  letter-spacing: .02em; text-decoration: none; line-height: 1; white-space: nowrap;
}
.wordmark .mark {
  width: 1.1rem; height: 1.1rem; background: var(--orange);
  border: 3px solid var(--ink);
}
.site-nav { display: flex; }
.site-nav a {
  display: flex; align-items: center;
  padding: 0 clamp(.9rem, 2.5vw, 1.8rem);
  border-left: var(--rule);
  font-weight: 700; text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* Hero */
.hero {
  position: relative; min-height: calc(100svh - 60px);
  background: var(--ink); color: var(--paper);
  display: grid; grid-template-rows: 1fr auto;
  overflow: hidden; border-bottom: var(--rule);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(232,229,222,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232,229,222,.07) 1px, transparent 1px);
  background-size: 80px 80px;
}
.hero-title {
  position: relative; align-self: end;
  margin: 0; padding: 0 var(--pad);
  font-family: var(--stencil); font-weight: 900;
  font-size: clamp(6rem, 30vw, 30rem);
  line-height: .78; letter-spacing: -.01em;
  will-change: transform;
}
.hero-foot {
  position: relative;
  display: grid; grid-template-columns: 1.4fr 1fr;
  border-top: 3px solid var(--paper);
  background: var(--ink);
}
.hero-foot > * { padding: 1.4rem var(--pad); }
.hero-lede {
  margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  font-weight: 600; line-height: 1.2; max-width: 30ch;
}
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.readout {
  border-left: 3px solid var(--paper);
  display: grid; align-content: center; gap: .35rem;
  font-variant-numeric: tabular-nums;
}
.readout div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(232,229,222,.25); padding-bottom: .35rem; }
.readout dt { color: var(--concrete); }
.readout dd { margin: 0; font-weight: 700; }
.readout .down { color: var(--orange); }

/* Buttons */
.btn {
  display: inline-block; padding: .8rem 1.2rem;
  border: 3px solid currentColor; font-weight: 800; text-decoration: none;
  background: transparent; transition: background .15s, color .15s;
}
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.light .btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Generic blocks */
.block { border-bottom: var(--rule); }
.split {
  display: grid; grid-template-columns: 1fr 1fr;
}
.split > * { padding: clamp(2rem, 6vw, 5rem) var(--pad); }
.split > * + * { border-left: var(--rule); }
.display {
  margin: 0; font-family: var(--stencil); font-weight: 900;
  font-size: clamp(3rem, 8vw, 7.5rem); line-height: .88;
}
.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.big-p { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.45; font-weight: 500; }

/* Scroll sequence */
.sequence { position: relative; height: 420vh; background: var(--concrete); border-bottom: var(--rule); }
.sequence-stick {
  position: sticky; top: 60px; height: calc(100svh - 60px);
  display: grid; grid-template-columns: 1fr 1.2fr;
}
.sequence-text { position: relative; border-right: var(--rule); overflow: hidden; }
.sequence-head {
  padding: 1.6rem var(--pad); border-bottom: var(--rule);
  font-weight: 800; font-size: 1.1rem;
}
.step {
  position: absolute; inset: 7.5rem var(--pad) auto var(--pad);
  opacity: 0; transform: translateY(1.5rem);
  transition: opacity .35s, transform .35s;
}
.step.on { opacity: 1; transform: none; }
.step-num { font-family: var(--stencil); font-weight: 900; font-size: clamp(4rem, 9vw, 8rem); line-height: .8; color: var(--steel); }
.step h3 { font-family: var(--stencil); font-weight: 800; font-size: clamp(2rem, 4vw, 3.4rem); line-height: .95; margin: 1rem 0 .8rem; }
.step p { margin: 0; max-width: 40ch; font-size: 1.1rem; }
.step-bar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--rule); }
.step-bar span { height: 14px; border-left: var(--rule); }
.step-bar span:first-child { border-left: 0; }
.step-bar span.lit { background: var(--ink); }
.sequence[data-step="3"] .step-bar span.lit { background: var(--orange); }

.diagram { display: grid; place-items: center; padding: var(--pad); }
.diagram svg { width: 100%; max-height: 78svh; }
.diagram .star { stroke: var(--ink); stroke-width: 3; transition: opacity .4s; }
.diagram .mesh { stroke: var(--orange); stroke-width: 4; opacity: 0; transition: opacity .5s; }
.diagram .unit { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.diagram .tower-body { fill: var(--ink); }
.diagram .tower-x { stroke: var(--orange); stroke-width: 6; opacity: 0; transition: opacity .3s; }
.diagram .jam { fill: none; stroke: var(--orange); stroke-width: 3; opacity: 0; }
.sequence[data-step="1"] .star { stroke-dasharray: 6 10; opacity: .55; }
.sequence[data-step="1"] .jam { opacity: 1; animation: jam 1.4s linear infinite; }
.sequence[data-step="2"] .star, .sequence[data-step="3"] .star { opacity: 0; }
.sequence[data-step="2"] .tower-x, .sequence[data-step="3"] .tower-x { opacity: 1; }
.sequence[data-step="2"] .unit { fill: var(--concrete); }
.sequence[data-step="3"] .mesh { opacity: 1; }
.sequence[data-step="3"] .unit { fill: var(--orange); }
@keyframes jam { from { r: 20; opacity: 1; } to { r: 120; opacity: 0; } }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--rule); }
.feature { padding: 1.6rem var(--pad) 2.2rem; border-left: var(--rule); }
.feature:first-child { border-left: 0; }
.feature h3 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 800; }
.feature p { margin: 0; color: #2a2c2d; }
.status {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 1.2rem var(--pad); border-top: var(--rule); background: var(--ink); color: var(--paper);
  font-weight: 600;
}
.status .dot { width: .9rem; height: .9rem; background: var(--orange); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Mission band */
.mission { background: var(--orange); border-bottom: var(--rule); padding: clamp(3rem, 9vw, 7rem) var(--pad); }
.mission .display { font-size: clamp(3.5rem, 12vw, 11rem); max-width: 12ch; }
.mission .light { margin-top: 2rem; }

/* About */
.page-hero { background: var(--ink); color: var(--paper); border-bottom: var(--rule); padding: clamp(3rem, 10vw, 8rem) var(--pad) clamp(2rem, 5vw, 3.5rem); }
.page-hero .display { font-size: clamp(4rem, 15vw, 14rem); }
.page-hero p { max-width: 46ch; margin: 1.5rem 0 0; font-size: clamp(1.15rem, 2vw, 1.5rem); }
.section-title { font-family: var(--stencil); font-weight: 900; font-size: clamp(2.6rem, 6vw, 5rem); line-height: .9; margin: 0; }

.route { padding: 2.5rem var(--pad) 3rem; border-top: var(--rule); background: var(--concrete); }
.route-line { position: relative; height: 18px; border: var(--rule); background: var(--paper); margin: 1rem 0 .8rem; }
.route-fill { position: absolute; inset: 0; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.route-ends { display: flex; justify-content: space-between; font-weight: 700; gap: 1rem; }
.route-miles { font-family: var(--stencil); font-weight: 900; font-size: clamp(3rem, 8vw, 6rem); line-height: .85; font-variant-numeric: tabular-nums; }

.contact { display: grid; grid-template-columns: 1fr 1fr; }
.contact > * { padding: clamp(2rem, 6vw, 4rem) var(--pad); }
.contact > * + * { border-left: var(--rule); }
.contact a.mail { font-family: var(--stencil); font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem); word-break: break-all; text-decoration-thickness: 3px; }

/* Footer */
.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding: 1.4rem var(--pad); background: var(--ink); color: var(--concrete); font-size: .95rem;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-foot, .split, .contact { grid-template-columns: 1fr; }
  .readout, .split > * + *, .contact > * + * { border-left: 0; }
  .readout { border-top: 3px solid var(--paper); }
  .split > * + *, .contact > * + * { border-top: var(--rule); }
  .features { grid-template-columns: 1fr 1fr; }
  .feature:nth-child(3) { border-left: 0; }
  .feature:nth-child(n+3) { border-top: var(--rule); }
  .sequence-stick { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sequence-text { border-right: 0; border-bottom: var(--rule); min-height: 46svh; }
  .step { inset: 6.5rem var(--pad) auto var(--pad); }
  .sequence-head { padding: 1.1rem var(--pad); }
  .step-num { font-size: 3.5rem; }
  .step p { font-size: 1rem; }
  .diagram svg { max-height: 40svh; }
}
@media (max-width: 520px) {
  .wordmark { font-size: 1.1rem; gap: .45rem; padding-right: .6rem; }
  .wordmark .mark { width: .85rem; height: .85rem; }
  .site-nav a { padding: 0 .65rem; font-size: .9rem; }
  .features { grid-template-columns: 1fr; }
  .feature { border-left: 0; border-top: var(--rule); }
  .feature:first-child { border-top: 0; }
}

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