/* services. Loaded after main.css and /assets/site/projects.css (tokens, hero, cards,
   .pd-link, .pd-section-head, .pd-related). Every class here is prefixed sv-. */

/* ---------- Sticky chapter nav with scrollspy ---------- */
.sv-nav {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(255,255,255,.98); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.sv-nav ul { position: relative; display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.sv-nav ul::-webkit-scrollbar { display: none; }
.sv-nav a {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 18px;
  font-size: .875rem; font-weight: 700; color: var(--steel); text-decoration: none; white-space: nowrap; transition: color .2s;
}
.sv-nav li:first-child a { padding-left: 0; }
.sv-nav a span { font-size: .6875rem; letter-spacing: .12em; color: var(--rule); transition: color .2s; }
.sv-nav a::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--oxblood);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--px-ease);
}
.sv-nav li:first-child a::after { left: 0; }
.sv-nav a:hover, .sv-nav a[aria-current="true"] { color: var(--black); }
.sv-nav a:hover span, .sv-nav a[aria-current="true"] span { color: var(--oxblood); }
.sv-nav a[aria-current="true"]::after { transform: scaleX(1); }
html { scroll-padding-top: calc(var(--header-h) + 76px); }

/* ---------- Chapters ---------- */
.sv-chapter { padding-block: var(--section-y); background: #fff; }
.sv-chapter + .sv-chapter { border-top: 1px solid var(--rule); }
.sv-chapter--dark { background: var(--black); color: #fff; border-top: 0 !important; }
.sv-chapter--mist { background: var(--px-soft); }

/* Intro: number + name + statement on the left, a tall photo on the right */
.sv-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 96px); align-items: center; margin-bottom: clamp(40px, 6vw, 72px); }
.sv-intro--text { grid-template-columns: minmax(0, 1fr); }
.sv-intro__num { margin: 0; font-size: clamp(3.5rem, 2rem + 6vw, 7rem); font-weight: 800; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px var(--oxblood); letter-spacing: -.03em; }
.sv-chapter--dark .sv-intro__num { -webkit-text-stroke-color: rgba(255,255,255,.55); }
.sv-intro__name { margin-top: 18px; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; color: var(--black); }
.sv-chapter--dark .sv-intro__name { color: #fff; }
.sv-intro__quote { margin: 22px 0 0; max-width: 24ch; font-size: clamp(1.2rem, 1rem + .9vw, 1.7rem); font-weight: 700; line-height: 1.25; color: var(--oxblood); }
.sv-chapter--dark .sv-intro__quote { color: #fff; opacity: .9; }
.sv-intro__lede { margin: 18px 0 0; max-width: 56ch; font-size: 1.0625rem; }
.sv-chapter--dark .sv-intro__lede { color: rgba(255,255,255,.78); }
.sv-intro__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin: 28px 0 0; }
.sv-chapter--dark .pd-link { color: #fff; }
.sv-intro__pdf { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: inherit; text-decoration: none; opacity: .8; }
.sv-intro__pdf:hover { opacity: 1; text-decoration: underline; }
.sv-intro__pdf svg { width: 18px; height: 18px; }
.sv-intro__media { aspect-ratio: 4 / 5; max-height: 560px; overflow: hidden; border-radius: var(--px-radius); background: var(--mist); }
.sv-intro__media img { width: 100%; height: 100%; object-fit: cover; }

.sv-sub { margin: clamp(40px, 5vw, 64px) 0 20px; font-size: .8125rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--steel); }
.sv-intro + .sv-sub { margin-top: 0; }
.sv-label { margin: 0 0 18px; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--oxblood); }
.on-dark .sv-label { color: rgba(255,255,255,.7); }

/* ---------- Photo tiles ---------- */
.sv-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px); }
.sv-tiles--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sv-tile { position: relative; isolation: isolate; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--px-radius); background: var(--charcoal); color: #fff; }
.sv-tile__media { position: absolute; inset: 0; z-index: -1; }
.sv-tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--px-ease); }
.sv-tile__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.85) 100%); }
.sv-tile__num { position: absolute; top: 14px; left: 16px; font-size: .75rem; font-weight: 700; letter-spacing: .14em; color: rgba(255,255,255,.85); }
.sv-tile__chip {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.94); color: var(--oxblood); font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-decoration: none;
  transition: background .2s, color .2s;
}
.sv-tile__chip:hover { background: var(--oxblood); color: #fff; }
.sv-tile__body { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(14px, 1.6vw, 22px); }
.sv-tile__name { font-size: clamp(1rem, .9rem + .4vw, 1.2rem); font-weight: 800; line-height: 1.2; }
.sv-tile__name a { color: inherit; text-decoration: none; }
.sv-tile__name a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole tile is the link */
.sv-tile__name a:focus-visible { outline: none; }
.sv-tile:has(.sv-tile__name a:focus-visible) { outline: 3px solid var(--oxblood); outline-offset: 3px; }
.on-dark .sv-tile:has(.sv-tile__name a:focus-visible) { outline-color: #fff; }
.sv-tile__note { margin: 8px 0 0; font-size: .8125rem; line-height: 1.45; color: rgba(255,255,255,.82); }
@media (hover: hover) {
  .sv-tile__note { display: grid; max-height: 0; opacity: 0; margin-top: 0; overflow: hidden; transition: max-height .5s var(--px-ease), opacity .4s, margin .5s var(--px-ease); }
  .sv-tile:hover .sv-tile__note, .sv-tile:focus-within .sv-tile__note { max-height: 6em; opacity: 1; margin-top: 8px; }
  .sv-tile:hover .sv-tile__media img { transform: scale(1.06); }
}

/* ---------- Fabrication hub ---------- */
.sv-hub { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 80px); align-items: end; padding: clamp(28px, 4vw, 48px) 0; margin-bottom: clamp(40px, 5vw, 64px); border-top: 1px solid var(--rule-dark); border-bottom: 1px solid var(--rule-dark); }
.sv-hub__total p:first-of-type { margin: 0; font-size: clamp(3rem, 1.6rem + 6vw, 6.5rem); font-weight: 800; line-height: .95; letter-spacing: -.03em; white-space: nowrap; }
.sv-hub__note { margin: 16px 0 0; max-width: 40ch; color: rgba(255,255,255,.75); }
.sv-hub__bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.sv-hub__bars li { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: baseline; }
.sv-hub__bars strong { font-size: 1rem; }
.sv-hub__bars li > span:last-child { font-size: .875rem; font-weight: 700; color: rgba(255,255,255,.75); }
.sv-hub__bar {
  --on: var(--oxblood); --off: rgba(0,0,0,.08);
  grid-column: 1 / -1; order: 3; display: block; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--off) 0 calc(var(--i) * 25%), var(--on) calc(var(--i) * 25%) calc(var(--i) * 25% + 25%), var(--off) calc(var(--i) * 25% + 25%));
}
.on-dark .sv-hub__bar { --on: #fff; --off: rgba(255,255,255,.14); }

/* ---------- Track record numbers ---------- */
.sv-record { margin-top: clamp(48px, 6vw, 88px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--rule); }
.sv-record dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.sv-record dl > div { padding: 0 20px; border-left: 1px solid var(--rule); display: flex; flex-direction: column-reverse; gap: 8px; }
.sv-record dl > div:first-child { padding-left: 0; border-left: 0; }
.sv-record dt { font-size: .875rem; font-weight: 600; color: var(--steel); }
.sv-record dd { margin: 0; font-size: clamp(2.2rem, 1.2rem + 3.4vw, 4.2rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--black); font-variant-numeric: tabular-nums; }
.sv-record dd::after { content: "+"; color: var(--oxblood); }

/* ---------- Delivery process ---------- */
.sv-process { margin-top: clamp(48px, 6vw, 88px); }
.sv-process ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); counter-reset: none; }
.sv-process li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 16px 0 0; }
.sv-process li::before { content: ""; position: absolute; top: 19px; left: 40px; right: 0; height: 2px; background: var(--rule); }
.sv-process li:last-child::before { display: none; }
.sv-process__n {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border: 2px solid var(--oxblood); border-radius: 50%; background: #fff; font-weight: 800; color: var(--oxblood);
}
.sv-process strong { font-size: 1rem; color: var(--black); }
.sv-process li > span:last-child { font-size: .875rem; color: var(--steel); line-height: 1.45; }

/* ---------- Engineering services ---------- */
.sv-eng { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--px-radius); overflow: hidden; }
.sv-eng li { position: relative; padding: clamp(22px, 2.4vw, 32px); background: #fff; transition: background .3s; }
.sv-eng li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--oxblood); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--px-ease); }
.sv-eng li:hover::before { transform: scaleY(1); }
.sv-eng__n { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .14em; color: var(--oxblood); }
.sv-eng h3 { margin-top: 10px; font-size: 1.15rem; font-weight: 800; color: var(--black); }
.sv-eng p { margin: 8px 0 0; font-size: .9375rem; color: var(--charcoal); }

/* ---------- Credentials band ---------- */
.sv-creds { background: var(--charcoal); color: #fff; padding-block: clamp(40px, 5vw, 64px); }
.sv-creds__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.sv-creds__list li { display: flex; flex-direction: column; gap: 4px; padding: 4px 16px; border-left: 1px solid var(--rule-dark); }
.sv-creds__list li:first-child { padding-left: 0; border-left: 0; }
.sv-creds__list strong { font-size: .9375rem; }
.sv-creds__list span { font-size: .75rem; color: rgba(255,255,255,.65); }
.sv-creds__link { margin-top: 24px; color: #fff; }

/* ---------- Scroll reveal (JS adds .sv-motion only when motion is welcome) ---------- */
.sv-motion .sv-intro__text, .sv-motion .sv-intro__media, .sv-motion .sv-tile, .sv-motion .sv-record, .sv-motion .sv-process li, .sv-motion .sv-eng li {
  opacity: 0; transform: translateY(24px); transition: opacity .8s var(--px-ease), transform .8s var(--px-ease);
}
.sv-motion [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--px-ease), transform .8s var(--px-ease); transition-delay: calc(var(--d, 0) * .07s); }
.sv-motion [data-reveal].is-in { opacity: 1; transform: none; }
.sv-motion .sv-intro__media { transform: translateY(24px) scale(.97); transition-delay: .12s; }
.sv-motion .is-in .sv-intro__text, .sv-motion .is-in .sv-intro__media, .sv-motion .sv-tile.is-in, .sv-motion .sv-record.is-in,
.sv-motion .sv-process li.is-in, .sv-motion .sv-eng li.is-in { opacity: 1; transform: none; }
.sv-motion .sv-tile:nth-child(4n+2), .sv-motion .sv-process li:nth-child(2), .sv-motion .sv-eng li:nth-child(3n+2) { transition-delay: .06s; }
.sv-motion .sv-tile:nth-child(4n+3), .sv-motion .sv-process li:nth-child(3), .sv-motion .sv-eng li:nth-child(3n) { transition-delay: .12s; }
.sv-motion .sv-tile:nth-child(4n), .sv-motion .sv-process li:nth-child(4) { transition-delay: .18s; }
.sv-motion .sv-process li:nth-child(5) { transition-delay: .24s; }
.sv-motion .sv-process li:nth-child(6) { transition-delay: .3s; }
.sv-motion .sv-hub__bar { background-size: 0 100%; background-repeat: no-repeat; transition: background-size 1.2s var(--px-ease); }
.sv-motion .sv-hub.is-in .sv-hub__bar { background-size: 100% 100%; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .sv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-tile { aspect-ratio: 4 / 3; }
  .sv-tiles--5 {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter);
  }
  .sv-tiles--5::-webkit-scrollbar { display: none; }
  .sv-tiles--5 > li { flex: 0 0 38%; aspect-ratio: 3 / 4; scroll-snap-align: start; }
  .sv-tile__note { display: block !important; max-height: none !important; opacity: 1 !important; margin-top: 8px !important; }
  .sv-hub { grid-template-columns: 1fr; align-items: start; }
  .sv-record dl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .sv-record dl > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .sv-process ol { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 32px; }
  .sv-process li:nth-child(3)::before { display: none; }
  .sv-eng { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-creds__list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 20px; }
  .sv-creds__list li:nth-child(5) { padding-left: 0; border-left: 0; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .sv-nav a { min-height: 52px; padding: 0 12px; font-size: .8125rem; }
  .sv-nav a::after { left: 12px; right: 12px; }
  html { scroll-padding-top: calc(var(--header-h) + 64px); }

  .sv-intro { grid-template-columns: 1fr; gap: 28px; }
  .sv-intro__media { order: -1; aspect-ratio: 16 / 10; }
  .sv-intro__num { font-size: 3.5rem; }
  .sv-motion .sv-intro__media { transition-delay: 0s; }

  .sv-tiles { gap: 10px; }
  .sv-tile { aspect-ratio: 3 / 4; }
  .sv-tile__name { font-size: .95rem; }
  .sv-tile__note { display: none !important; }
  .sv-tiles--5 > li { flex-basis: 64%; }
  .sv-tiles--5 .sv-tile__note { display: block !important; }

  .sv-record dl > div { padding: 0 14px; }
  .sv-record dl > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .sv-record dl > div:nth-child(even) { border-left: 1px solid var(--rule); }

  .sv-process ol { grid-template-columns: 1fr; row-gap: 0; }
  .sv-process li { display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; padding: 0 0 24px; }
  .sv-process__n { grid-row: span 2; margin-bottom: 0; }
  .sv-process li::before, .sv-process li:nth-child(3)::before { display: block; top: 40px; bottom: 0; left: 19px; right: auto; width: 2px; height: auto; }
  .sv-process li:last-child::before { display: none; }

  .sv-eng { grid-template-columns: 1fr; }
  .sv-creds__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-creds__list li, .sv-creds__list li:nth-child(5) { padding: 4px 14px; border-left: 1px solid var(--rule-dark); }
  .sv-creds__list li:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-tile__media img, .sv-tile__note, .sv-nav a::after, .sv-eng li::before { transition: none; }
}
