/* ============================================================
   Miles Foundation Engineering — geotechnical descent
   ============================================================ */

:root {
  /* substrate / surface — forest green (from Miles logo) */
  --bedrock:    #0c2615;
  --substrate:  #123a22;
  --substrate2: #17472a;
  --concrete:   #eaebe3;
  --concrete2:  #dee0d4;

  /* lines & type */
  --steel:      #5e6b5a;
  --steel-l:    #8c9a83;
  --ink:        #0d321b;
  --ink-soft:   #33473a;
  --paper-soft: rgba(234, 235, 227, 0.64);

  /* signal — Miles green accent */
  --signal:     #59933f;
  --signal-d:   #3c7a28;
  --signal-l:   #7faf4e;

  /* soil tones — illustration only (khaki / olive strata) */
  --sand:   #bcbb9c;
  --clay:   #9ea581;
  --ochre:  #808c5c;
  --clay-d: #4f5e3e;

  /* type */
  --display: "Archivo", system-ui, sans-serif;
  --body:    "IBM Plex Sans", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --fs-display: clamp(2.7rem, 7vw, 6.1rem);
  --fs-h2:      clamp(1.85rem, 4.2vw, 3.2rem);
  --fs-lead:    clamp(1.4rem, 3vw, 2.3rem);

  --rail-w: 76px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--body);
  background: var(--bedrock);
  color: var(--concrete);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--bedrock); }

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }

.skip-link {
  position: fixed; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--signal); color: var(--bedrock); padding: 10px 18px;
  font-family: var(--mono); font-size: 0.8rem; z-index: 200; border-radius: 0 0 6px 6px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ============================================================
   DEPTH RAIL — signature
   ============================================================ */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail-w);
  z-index: 90; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 86px 0 22px; pointer-events: none;
  border-right: 1px solid rgba(140, 154, 131, 0.16);
  background: linear-gradient(180deg, rgba(8,26,15,0.9), rgba(8,26,15,0));
  mix-blend-mode: normal;
}
.rail__top, .rail__bottom { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rail__cap { font-family: var(--mono); font-size: 0.82rem; color: var(--signal); font-weight: 600; }
.rail__unit { font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.12em; color: var(--steel-l); writing-mode: vertical-rl; }
.rail__top .rail__unit, .rail__bottom .rail__unit { writing-mode: horizontal-tb; }

.rail__track {
  position: relative; flex: 1; width: 2px; margin: 18px 0;
  background:
    repeating-linear-gradient(180deg, rgba(140,154,131,0.35) 0 1px, transparent 1px 28px),
    rgba(140,154,131,0.12);
}
.rail__pile {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 4px; height: 0; background: var(--signal);
  box-shadow: 0 0 12px rgba(127,175,78,0.45);
}
.rail__marker {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 2px;
  background: var(--signal); color: var(--bedrock);
  padding: 3px 6px; border-radius: 3px;
}
.rail__depth { font-family: var(--mono); font-weight: 600; font-size: 0.74rem; line-height: 1; }
.rail__depth-unit { font-family: var(--mono); font-size: 0.55rem; }

/* ============================================================
   HEADER
   ============================================================ */
.head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 clamp(1.25rem, 4vw, 2.4rem); height: 72px;
  background: rgba(8, 26, 15, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(140, 154, 131, 0.12);
  transition: background 0.3s, height 0.3s;
}
.head.scrolled { height: 62px; background: rgba(8, 26, 15, 0.92); }

.brand { display: flex; align-items: center; gap: 11px; }
.brand__logo { height: 34px; width: auto; display: block; transition: height 0.3s; }
.head.scrolled .brand__logo { height: 29px; }
.brand__mark { color: var(--signal); display: flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong { font-family: var(--display); font-weight: 800; font-size: 1.18rem; letter-spacing: 0.04em; }
.brand__text span { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.22em; color: var(--signal-l); margin-top: 3px; }

.nav { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); margin-left: auto; }
.nav__link {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--paper-soft); position: relative; padding: 4px 0; transition: color 0.2s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--signal); transition: width 0.25s var(--ease);
}
.nav__link:hover, .nav__link.active { color: var(--concrete); }
.nav__link.active::after, .nav__link:hover::after { width: 100%; }

.head__cta { margin-left: 0.6rem; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.burger span { width: 24px; height: 2px; background: var(--concrete); transition: transform 0.3s, opacity 0.3s; }
.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); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.03em;
  padding: 13px 22px; border-radius: 4px; cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--solid { background: var(--signal); color: var(--bedrock); font-weight: 600; }
.btn--solid:hover { background: #6fb049; transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--steel); color: var(--concrete); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }
.btn--ghost-light { border-color: rgba(234,235,227,0.4); }

/* ============================================================
   SHARED SECTION ATOMS
   ============================================================ */
.eyebrow {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.6rem;
}
.eyebrow--light { color: var(--paper-soft); }
.eyebrow__tick {
  font-weight: 600; color: var(--signal); white-space: nowrap;
  border: 1px solid currentColor; padding: 3px 8px; border-radius: 3px;
  font-size: 0.68rem;
}

.h2 {
  font-family: var(--display); font-weight: 800; font-size: var(--fs-h2);
  line-height: 1.04; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 2.4rem;
}
.h2--light { color: var(--concrete); }

.text { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-soft); max-width: 52ch; }

.band { padding: clamp(4.5rem, 9vw, 8rem) 0; padding-left: var(--rail-w); }
.band--dark { background: var(--bedrock); color: var(--concrete); }
.band--concrete { background: var(--concrete); color: var(--ink); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 128px 0 clamp(4rem, 8vw, 7rem); padding-left: var(--rail-w);
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(127,175,78,0.06), transparent 60%),
    var(--bedrock);
  min-height: 100vh; display: flex; align-items: center;
}
.hero__grid {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.hero__title {
  font-family: var(--display); font-weight: 900; font-size: var(--fs-display);
  line-height: 0.98; letter-spacing: -0.02em; margin-bottom: 1.6rem;
}
.hero__title .hl { color: var(--signal); }
.hero__lede { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--paper-soft); max-width: 42ch; line-height: 1.5; font-weight: 400; margin-bottom: 2.4rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 3.4rem; }

.hero__stats { display: flex; gap: clamp(1.5rem, 4vw, 3.2rem); flex-wrap: wrap; border-top: 1px solid rgba(140,154,131,0.18); padding-top: 1.8rem; }
.stat__num { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.7rem); color: var(--signal); line-height: 1; }
.stat__label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--steel-l); margin-top: 0.5rem; max-width: 16ch; }

/* hero cross-section */
.section-svg svg { width: 100%; height: auto; display: block; border-radius: 8px; overflow: hidden; }
.hero__section { position: relative; }
.hero__section figcaption {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.03em;
  color: var(--steel-l); margin-top: 0.9rem; text-align: center;
}
.strata rect { transform-box: fill-box; }

/* ============================================================
   WHAT WE DO
   ============================================================ */
.lead {
  font-family: var(--display); font-weight: 600;
  font-size: var(--fs-lead); line-height: 1.18; letter-spacing: -0.01em;
  max-width: 22ch; color: var(--concrete);
}
.lead em { font-style: normal; color: var(--signal); }
#what .lead { max-width: 38ch; }

/* ============================================================
   HISTORY
   ============================================================ */
.history__grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.history__lead .h2 { margin-bottom: 1.4rem; }

.timeline { list-style: none; position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--signal), var(--clay-d)); }
.timeline__item { position: relative; padding: 0 0 1.7rem; display: grid; grid-template-columns: 88px 1fr; gap: 1.1rem; align-items: baseline; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: -1.6rem; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); border: 2px solid var(--concrete); }
.timeline__year { font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.timeline__text { color: var(--ink-soft); font-size: 1.02rem; }

/* ============================================================
   HISTORY PHOTO ARCHIVE
   ============================================================ */
.harchive { margin-top: clamp(3rem, 6vw, 5rem); }
.harchive__label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--steel); margin-bottom: 1.4rem; display: flex; align-items: center; gap: 0.9rem;
}
.harchive__hint { color: var(--signal-d); font-size: 0.72rem; letter-spacing: 0.04em; }

.harchive__row {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 1.1rem; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--signal) rgba(20,40,25,0.12);
}
.harchive__row::-webkit-scrollbar { height: 6px; }
.harchive__row::-webkit-scrollbar-track { background: rgba(20,40,25,0.1); border-radius: 3px; }
.harchive__row::-webkit-scrollbar-thumb { background: var(--signal); border-radius: 3px; }

.harchive__item { flex: 0 0 clamp(240px, 30vw, 330px); scroll-snap-align: start; margin: 0; }
.harchive__media {
  position: relative; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(13,50,27,0.14);
}
.harchive__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.04); transition: transform 0.6s var(--ease), filter 0.4s;
}
.harchive__item:hover .harchive__media img { transform: scale(1.05); filter: grayscale(1) contrast(1.08) brightness(1.05); }
.harchive__year {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 500;
  background: var(--ink); color: var(--concrete); padding: 3px 8px; border-radius: 3px;
}
.harchive__item figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.7rem; line-height: 1.35; }

/* ============================================================
   APPLICATION
   ============================================================ */
.areas { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(140,154,131,0.16); border: 1px solid rgba(140,154,131,0.16); }
.area {
  background: var(--bedrock); padding: 2.1rem 1.6rem; display: flex; flex-direction: column; gap: 1rem;
  font-family: var(--display); font-weight: 600; font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.15;
  transition: background 0.25s, color 0.25s; min-height: 140px;
}
.area__code { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; color: var(--signal); }
.area:hover { background: var(--substrate2); }

/* ============================================================
   ADVANTAGES
   ============================================================ */
.adv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.adv {
  background: var(--concrete2); border: 1px solid rgba(8,26,15,0.08);
  border-radius: 8px; padding: 1.9rem 1.7rem; position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.adv::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--signal); transform: scaleY(0); transform-origin: top; transition: transform 0.3s var(--ease); }
.adv:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(8,26,15,0.12); border-color: rgba(8,26,15,0.14); }
.adv:hover::before { transform: scaleY(1); }
.adv__spec { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel); }
.adv__title { font-family: var(--display); font-weight: 700; font-size: 1.22rem; line-height: 1.15; color: var(--ink); margin: 0.7rem 0 0.8rem; }
.adv__text { font-size: 0.98rem; color: var(--ink-soft); }

/* ============================================================
   PROJECTS
   ============================================================ */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.proj {
  border: 1px solid rgba(140,154,131,0.18); border-radius: 8px; padding: 1.7rem;
  background: linear-gradient(180deg, var(--substrate), var(--bedrock));
  transition: transform 0.25s var(--ease), border-color 0.25s;
  display: flex; flex-direction: column; gap: 1.1rem; min-height: 180px;
}
.proj:hover { transform: translateY(-4px); border-color: var(--signal); }
.proj__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; }
.proj__loc { color: var(--steel-l); }
.proj__year { color: var(--signal); font-weight: 600; }
.proj__title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; color: var(--concrete); margin-top: auto; }
.proj__type { font-size: 0.92rem; color: var(--paper-soft); }

/* photo project cards */
.proj--photo { padding: 0; overflow: hidden; min-height: 0; }
.proj__media { aspect-ratio: 16 / 10; overflow: hidden; }
.proj__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.proj--photo:hover .proj__media img { transform: scale(1.05); }
.proj__body { padding: 1.3rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.7rem; }
.proj--photo .proj__title { margin-top: 0.2rem; }

.proj-geo { margin-top: 2rem; font-family: var(--mono); font-size: 0.86rem; color: var(--paper-soft); line-height: 1.7; }
.proj-geo__label { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal-l); margin-bottom: 0.5rem; }

/* leader photo */
.leader__photo { width: 100%; max-width: 220px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; margin-bottom: 1.4rem; }
.leader__photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about__main .h2 { margin-bottom: 1.5rem; }
.leader { border-left: 3px solid var(--signal); padding-left: 1.6rem; }
.leader__role { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.leader__name { font-family: var(--display); font-weight: 800; font-size: 1.7rem; color: var(--ink); margin: 0.4rem 0 0.9rem; }
.leader__bio { color: var(--ink-soft); font-size: 1rem; margin-bottom: 1.4rem; }
.leader__cos { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.leader__cos li { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.03em; color: var(--ink-soft); border: 1px solid rgba(8,26,15,0.18); padding: 5px 10px; border-radius: 4px; }

/* ============================================================
   CTA / BEDROCK
   ============================================================ */
.cta {
  padding: clamp(5rem, 10vw, 9rem) 0; padding-left: var(--rail-w);
  background:
    repeating-linear-gradient(45deg, rgba(127,175,78,0.05) 0 2px, transparent 2px 16px),
    linear-gradient(180deg, var(--substrate), #07180d);
  position: relative;
}
.cta::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: repeating-linear-gradient(90deg, var(--signal) 0 14px, transparent 14px 28px); opacity: 0.5; }
.cta__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta__inner .hero__actions { justify-content: center; margin-bottom: 0; }
.cta__title { font-family: var(--display); font-weight: 900; font-size: var(--fs-display); line-height: 0.98; letter-spacing: -0.02em; color: var(--concrete); margin-bottom: 2.4rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { background: #07180d; padding: clamp(3.5rem, 7vw, 5.5rem) 0 1.8rem; padding-left: var(--rail-w); border-top: 1px solid rgba(140,154,131,0.12); }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.brand__text--foot strong { font-size: 1.4rem; }
.foot__logo { height: 44px; width: auto; display: block; margin-bottom: 0.4rem; }
.foot__tag { font-family: var(--mono); font-size: 0.74rem; color: var(--steel-l); margin-top: 1rem; }
.foot__label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); margin-bottom: 1.1rem; }
.foot__link { display: block; color: var(--paper-soft); margin-bottom: 0.55rem; transition: color 0.2s; }
.foot__link:hover { color: var(--signal); }
.foot__addr { color: var(--paper-soft); }
.foot__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.6rem; border-top: 1px solid rgba(140,154,131,0.12); font-family: var(--mono); font-size: 0.72rem; color: var(--steel-l); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.adv-grid .adv, .proj-grid .proj, .areas .area { transition-delay: calc(var(--i, 0) * 60ms); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  :root { --rail-w: 0px; }
  .rail { display: none; }
  .nav { position: fixed; top: 72px; left: 0; right: 0; height: calc(100dvh - 72px);
    flex-direction: column; gap: 0;
    background: var(--bedrock); overflow-y: auto; justify-content: flex-start;
    padding: 1rem clamp(1.25rem, 4vw, 2.4rem) 2.4rem; transform: translateX(100%);
    transition: transform 0.35s var(--ease); margin-left: 0; }
  .nav.open { transform: translateX(0); }
  .nav__link { padding: 1.15rem 0; border-bottom: 1px solid rgba(140,154,131,0.12); font-size: 1.15rem; }
  .nav__link::after { display: none; }
  .nav__link.active { color: var(--signal-l); }
  .head.scrolled .nav { top: 62px; height: calc(100dvh - 62px); }
  .head__cta { display: none; }
  .burger { display: flex; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__section { max-width: 380px; margin: 0 auto; }
  .history__grid, .about__grid { grid-template-columns: 1fr; }
  .adv-grid, .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .areas { grid-template-columns: repeat(2, 1fr); }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 600px) {
  .adv-grid, .proj-grid, .areas { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 110px; }
  .foot__grid { grid-template-columns: 1fr; gap: 2rem; }
  .foot__bottom { flex-direction: column; gap: 0.6rem; text-align: center; }
  .hero__stats { gap: 1.4rem 2rem; }
  /* full-width, comfortable tap targets */
  .hero__actions, .cta__inner .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; justify-content: center; padding: 15px 22px; }
  .foot__link { padding: 4px 0; }
}

/* ============================================================
   TECHNOLOGY — 5 STEPS
   ============================================================ */
.band--divider { border-top: 1px solid rgba(140,154,131,0.16); }
.lead--sm { font-size: clamp(1.15rem, 2.2vw, 1.7rem); max-width: 60rem; margin-bottom: 3rem; }

.psteps {
  list-style: none; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1.1rem; counter-reset: none;
}
.pstep {
  position: relative; background: var(--substrate); border: 1px solid rgba(140,154,131,0.14);
  border-radius: 10px; padding: 1.3rem 1.1rem 1.5rem; display: flex; flex-direction: column;
}
.pstep__num {
  position: absolute; top: -14px; left: 1.1rem; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--signal); color: var(--bedrock); border-radius: 50%;
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  border: 3px solid var(--bedrock);
}
.pstep__fig { margin: 0.4rem 0 1rem; }
.pstep__fig svg { width: 100%; height: auto; max-height: 180px; display: block; }
.pstep__title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.15; color: var(--concrete); margin-bottom: 0.5rem; }
.pstep__text { font-size: 0.9rem; color: var(--paper-soft); }

/* bearing capacity table */
.spec { margin-top: 3.4rem; }
.spec__label { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal-l); margin-bottom: 1.1rem; }
.spec__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spec__table th, .spec__table td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid rgba(140,154,131,0.16); }
.spec__table thead th { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--steel-l); font-weight: 500; }
.spec__table tbody td { font-family: var(--mono); font-size: 0.95rem; color: var(--concrete); }
.spec__table tbody td:first-child { color: var(--signal-l); font-weight: 600; }
.spec__table tbody tr:hover { background: rgba(140,154,131,0.06); }
.spec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; }
.spec__cap { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--steel-l); margin-bottom: 0.6rem; }
.spec__note { font-size: 0.86rem; color: var(--steel-l); margin-top: 1.3rem; max-width: 68ch; }
.spec__proof { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid rgba(140,154,131,0.16); }
.spec__proof-num { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); color: var(--signal-l); line-height: 1; }
.spec__proof-unit { font-family: var(--mono); font-size: 1rem; color: var(--signal-l); }
.spec__proof-text { font-size: 0.92rem; color: var(--paper-soft); max-width: 40ch; }

@media (max-width: 760px) {
  .spec__grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 980px) {
  .psteps { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.6rem; margin-left: calc(-1 * clamp(1.25rem, 4vw, 3rem)); margin-right: calc(-1 * clamp(1.25rem, 4vw, 3rem)); padding-left: clamp(1.25rem, 4vw, 3rem); padding-right: clamp(1.25rem, 4vw, 3rem); }
  .pstep { flex: 0 0 72%; scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .pstep { flex-basis: 84%; }
  .spec__table th, .spec__table td { padding: 0.7rem 0.6rem; font-size: 0.85rem; }
}

/* ============================================================
   FRANKI ADJUST HIGHLIGHT (chapter VI)
   ============================================================ */
.adjust {
  margin-top: 1.6rem; background: var(--bedrock); border-radius: 12px;
  padding: clamp(1.8rem, 3vw, 2.6rem); display: grid;
  grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  position: relative; overflow: hidden;
}
.adjust::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--signal); }
.adjust__tag { display: inline-block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bedrock); background: var(--signal); padding: 4px 10px; border-radius: 4px; margin-bottom: 1rem; }
.adjust__title { font-family: var(--display); font-weight: 800; font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.08; color: var(--concrete); margin-bottom: 0.8rem; }
.adjust__text { color: var(--paper-soft); font-size: 1rem; max-width: 40ch; }
.adjust__list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.adjust__list li { display: flex; align-items: center; gap: 1rem; font-family: var(--display); font-weight: 600; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--concrete); padding-bottom: 0.9rem; border-bottom: 1px solid rgba(140,154,131,0.16); }
.adjust__list li:last-child { border-bottom: 0; padding-bottom: 0; }
.adjust__num { font-family: var(--mono); font-weight: 600; font-size: 0.82rem; color: var(--signal-l); border: 1px solid var(--signal-d); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

@media (max-width: 760px) {
  .adjust { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* ============================================================
   COST COMPARISON
   ============================================================ */
.costc__tabs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2rem; }
.costc__tab {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em;
  padding: 9px 16px; border-radius: 5px; cursor: pointer;
  background: transparent; color: var(--paper-soft);
  border: 1px solid rgba(140,154,131,0.24); transition: all 0.2s;
}
.costc__tab:hover { border-color: var(--signal); color: var(--concrete); }
.costc__tab.is-active { background: var(--signal); color: var(--bedrock); border-color: var(--signal); font-weight: 600; }

.costc__panel { display: none; }
.costc__panel.is-active { display: block; animation: ccfade 0.4s var(--ease); }
@keyframes ccfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.costc__soil { font-family: var(--mono); font-size: 0.8rem; color: var(--steel-l); margin-bottom: 1.6rem; }

.cc-row {
  display: grid; grid-template-columns: minmax(220px, 1.1fr) 2fr auto;
  align-items: center; gap: 1.2rem; padding: 1rem 0;
  border-bottom: 1px solid rgba(140,154,131,0.12);
}
.cc-row__head { display: flex; flex-direction: column; gap: 0.25rem; }
.cc-row__name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--concrete); }
.cc-row__spec { font-family: var(--mono); font-size: 0.72rem; color: var(--steel-l); }
.cc-row__bar { height: 16px; background: rgba(140,154,131,0.1); border-radius: 3px; overflow: hidden; }
.cc-row__bar span { display: block; height: 100%; width: 0; background: var(--steel); border-radius: 3px; transition: width 0.8s var(--ease); }
.cc-row__val { font-family: var(--mono); font-weight: 600; font-size: 1.15rem; color: var(--concrete); white-space: nowrap; text-align: right; }
.cc-row__val i { font-style: normal; font-size: 0.72rem; font-weight: 400; color: var(--steel-l); }

.cc-row--win .cc-row__name { color: var(--signal-l); }
.cc-row--win .cc-row__bar span { background: var(--signal); box-shadow: 0 0 14px rgba(127,175,78,0.4); }
.cc-row--win .cc-row__val { color: var(--signal-l); }

.costc__note { font-size: 0.84rem; color: var(--steel-l); margin-top: 1.6rem; max-width: 64ch; }

@media (max-width: 720px) {
  .cc-row { grid-template-columns: 1fr auto; gap: 0.5rem 1rem; }
  .cc-row__bar { grid-column: 1 / -1; order: 3; }
  .cc-row__val { order: 2; }
}

/* ============================================================
   BRIDGES PAGE
   ============================================================ */
.page-bridges .band,
.page-bridges .cta,
.page-bridges .foot { padding-left: 0; }

/* horizontal span progress rail */
.span-rail {
  position: fixed; top: 72px; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; gap: 12px;
  padding: 8px clamp(1.25rem, 4vw, 2.4rem);
  background: rgba(8, 26, 15, 0.55); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.14em; color: var(--steel-l);
  transition: top 0.3s;
}
.head.scrolled + .span-rail { top: 62px; }
.span-rail__cap--end { text-align: right; }
.span-rail__track { flex: 1; height: 2px; background: rgba(140,154,131,0.22); position: relative; }
.span-rail__fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--signal); box-shadow: 0 0 10px rgba(127,175,78,0.5); }
.span-rail__fill::after { content: ""; position: absolute; right: -4px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }

/* hero with photo */
.bhero { position: relative; min-height: 100vh; display: flex; align-items: flex-end; padding: 150px 0 clamp(3rem, 7vw, 6rem); overflow: hidden; }
.bhero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bhero__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,20,12,0.5) 0%, rgba(6,20,12,0.35) 35%, rgba(6,20,12,0.92) 100%); }
.bhero__inner { position: relative; z-index: 2; }
.bhero__title { font-family: var(--display); font-weight: 900; font-size: var(--fs-display); line-height: 0.96; letter-spacing: -0.02em; color: var(--concrete); margin-bottom: 1.4rem; }
.bhero__lede { font-size: clamp(1.05rem, 1.7vw, 1.28rem); color: var(--concrete); max-width: 56ch; line-height: 1.55; margin-bottom: 2.2rem; text-shadow: 0 1px 14px rgba(0,0,0,0.4); }
.bhero__stats { display: flex; gap: clamp(1.6rem, 5vw, 3.6rem); flex-wrap: wrap; border-top: 1px solid rgba(234,235,227,0.22); padding-top: 1.7rem; margin-top: 2.6rem; }
.bhero__stats .stat__num { font-size: clamp(1.5rem, 3vw, 2.3rem); }
.bhero__stats .stat__label { color: var(--paper-soft); }

/* alternating type rows */
.btype { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.8rem, 4vw, 4rem); align-items: center; margin-top: clamp(3rem, 6vw, 5rem); }
.btype--rev .btype__media { order: 2; }
.btype__media { margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 18px 44px rgba(8,26,15,0.18); }
.btype__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.btype__media:hover img { transform: scale(1.04); }
.btype__mat { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal-d); }
.band--dark .btype__mat { color: var(--signal); }
.btype__title { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.05; color: var(--ink); margin: 0.7rem 0 1.1rem; }
.band--dark .btype__title { color: var(--concrete); }
.btype__text { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 1.4rem; max-width: 46ch; }
.band--dark .btype__text { color: var(--paper-soft); }

/* checklist */
.checklist { list-style: none; display: grid; gap: 0.7rem; }
.checklist li { position: relative; padding-left: 2rem; font-size: 1rem; color: var(--ink); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.18em; width: 18px; height: 18px;
  border-radius: 4px; background: var(--signal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/74% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/74% no-repeat;
}
.checklist--light li { color: var(--concrete); }

/* temporary bridge feature */
.tmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); margin-top: 3rem; align-items: start; }
.tmp-col__label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); margin-bottom: 1.3rem; padding-bottom: 0.7rem; border-bottom: 1px solid rgba(140,154,131,0.22); }
.applics { list-style: none; display: grid; gap: 0.7rem; }
.applics li { position: relative; padding-left: 1.5rem; color: var(--paper-soft); font-size: 1rem; }
.applics li::before { content: "→"; position: absolute; left: 0; color: var(--signal); font-family: var(--mono); }
.services { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid rgba(140,154,131,0.2); font-family: var(--mono); font-size: 0.92rem; }
.services__label { color: var(--signal); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.services__item { color: var(--concrete); }
.services__sep { color: var(--steel); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 2.6rem; padding: 0 clamp(1.25rem, 4vw, 3rem); max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.gallery__item { margin: 0; overflow: hidden; border-radius: 8px; aspect-ratio: 1 / 1; }
.gallery__item--wide { grid-column: span 2; aspect-ratio: 2 / 1; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease), filter 0.4s; filter: grayscale(0.15); }
.gallery__item:hover img { transform: scale(1.05); filter: grayscale(0); }

/* why us */
.why-grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(8,26,15,0.1); border: 1px solid rgba(8,26,15,0.1); margin-top: 2rem; }
.why { background: var(--concrete); padding: 1.8rem; display: flex; gap: 1.2rem; align-items: flex-start; transition: background 0.25s; }
.why:hover { background: var(--concrete2); }
.why__code { font-family: var(--mono); font-weight: 600; color: var(--signal-d); font-size: 0.95rem; }
.why p { color: var(--ink); font-size: 1.05rem; }
.cta__text { color: var(--paper-soft); max-width: 52ch; margin: 0 auto 2.4rem; font-size: 1.05rem; }

@media (max-width: 980px) {
  .btype, .tmp-grid { grid-template-columns: 1fr; }
  .btype--rev .btype__media { order: 0; }
  .why-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery__item--wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  .bhero { min-height: auto; padding-top: 130px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery__item, .gallery__item--wide { grid-column: span 1; aspect-ratio: 16 / 10; }
}

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