/* ==========================================================================
   Services page. Relies on tokens and components in styles.css.
   ========================================================================== */

/* Section-head paragraphs in styles.css would otherwise enlarge the eyebrow */
.section-head p.eyebrow { margin-top: 0; max-width: none; font-size: var(--fs-xs); color: var(--amber-600); }
.section--dark .section-head p.eyebrow { color: var(--amber-400); }
.cta-band p.eyebrow { margin-top: 0; max-width: none; font-size: var(--fs-xs); color: var(--amber-400); }

/* ---------- 1. Hero ---------- */
.svc-hero { padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.svc-hero .page-hero__media img {
  opacity: 0.3;
  transform: scale(1.08);
  animation: svc-zoom 14s var(--ease) forwards;
}
@keyframes svc-zoom { to { transform: scale(1); } }

.svc-hero__glow {
  position: absolute;
  z-index: -1;
  right: 8%;
  top: 30%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 137, 43, 0.22) 0%, rgba(232, 137, 43, 0) 65%);
  pointer-events: none;
  animation: svc-glow 6s ease-in-out infinite alternate;
}
@keyframes svc-glow { from { opacity: 0.55; transform: scale(0.9); } to { opacity: 1; transform: scale(1.05); } }

.svc-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
.svc-hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.4rem); line-height: 1.05; }
.svc-hero__accent { display: block; color: var(--amber-400); }

/* Headline words rise in one after another */
.svc-hero h1 .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  animation: svc-rise 0.75s var(--ease) forwards;
  animation-delay: calc(0.15s + var(--i) * 0.07s);
}
@keyframes svc-rise { to { opacity: 1; transform: none; } }

.svc-hero .breadcrumb,
.svc-hero .eyebrow,
.svc-hero__lead,
.svc-hero__actions,
.svc-chips li {
  opacity: 0;
  animation: svc-up 0.8s var(--ease) forwards;
}
.svc-hero .breadcrumb { animation-delay: 0s; }
.svc-hero .eyebrow { animation-delay: 0.08s; }
.svc-hero__lead { animation-delay: 0.85s; }
.svc-hero__actions { animation-delay: 1s; }
@keyframes svc-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.svc-hero__actions { margin-top: 2.25rem; }

/* Animated erection drawing */
.svc-hero__frame {
  position: relative;
  padding: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(20, 34, 54, 0.75), rgba(7, 15, 27, 0.55));
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: svc-up 0.9s var(--ease) 0.2s forwards;
}
.svc-hero__frame::before,
.svc-hero__frame::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--amber-400);
}
.svc-hero__frame::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--radius-lg); }
.svc-hero__frame::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: var(--radius-lg); }
.svc-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-300);
}
.svc-hero__tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-400);
  box-shadow: 0 0 0 0 rgba(242, 157, 69, 0.6);
  animation: svc-ping 1.8s ease-out infinite;
}
@keyframes svc-ping { to { box-shadow: 0 0 0 9px rgba(242, 157, 69, 0); } }

.erect { display: block; width: 100%; height: auto; margin-top: 0.5rem; overflow: visible; }
.erect .d {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: svc-draw 1.1s var(--ease) forwards;
  animation-delay: var(--t, 0s);
}
.d--ground { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.2; }
.d--frame { stroke: #ffffff; stroke-width: 3.2; }
.d--mid { stroke: rgba(255, 255, 255, 0.5); stroke-width: 2.2; }
.d--back { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.8; }
.d--tie { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.4; }
.d--purlin { stroke: var(--amber-400); stroke-width: 1.4; animation-duration: 0.6s; }
.d--crane { stroke: rgba(242, 157, 69, 0.85); stroke-width: 1.6; animation-duration: 1.4s; }
.d--lattice { stroke: rgba(242, 157, 69, 0.45); stroke-width: 1; animation-duration: 1.6s; }
.d--dim { stroke: rgba(166, 178, 193, 0.7); stroke-width: 1; }
.erect .pad { fill: rgba(166, 178, 193, 0.35); }
.erect .pad--back { fill: rgba(166, 178, 193, 0.18); }
.erect .cw { fill: rgba(242, 157, 69, 0.55); }
.erect .lbl {
  fill: var(--steel-300);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
}
.erect .fade { opacity: 0; animation: svc-fade 0.8s var(--ease) forwards; animation-delay: var(--t, 0s); }
.sheet__fill { fill: rgba(242, 157, 69, 0.2); stroke: var(--amber-400); stroke-width: 1.2; stroke-linejoin: round; }
.sheet__rib { stroke: rgba(242, 157, 69, 0.55); stroke-width: 0.8; }

/* Hook swings gently with its load, after the crane is drawn */
.hook {
  transform-box: view-box;
  transform-origin: 420px 56px;
  opacity: 0;
  animation: svc-fade 0.8s var(--ease) 1.2s forwards, svc-sway 4.5s ease-in-out 1.2s infinite;
}
.hook .cable,
.hook .sling,
.hook .hook__j { stroke: rgba(242, 157, 69, 0.8); stroke-width: 1.2; }
.hook .trolley { fill: var(--amber-500); }
.hook .load { fill: var(--steel-300); }
@keyframes svc-sway {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}

/* Weld spark flickers at the frame apex */
.spark { opacity: 0; transform-box: fill-box; transform-origin: center; animation: svc-spark 2.6s ease-out infinite; animation-delay: var(--t, 0s); }
.spark circle { fill: #ffd29a; }
.spark path { stroke: #ffd29a; stroke-width: 1.2; stroke-linecap: round; }
@keyframes svc-spark {
  0% { opacity: 0; transform: scale(0.4); }
  8% { opacity: 1; transform: scale(1); }
  30% { opacity: 0; transform: scale(1.25); }
  100% { opacity: 0; }
}

@keyframes svc-draw { to { stroke-dashoffset: 0; } }
@keyframes svc-fade { to { opacity: 1; } }

/* Service jump chips */
.svc-chips { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--line-on-dark, rgba(255, 255, 255, 0.1)); }
.svc-chips ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.svc-chips li:nth-child(1) { animation-delay: 1.1s; }
.svc-chips li:nth-child(2) { animation-delay: 1.16s; }
.svc-chips li:nth-child(3) { animation-delay: 1.22s; }
.svc-chips li:nth-child(4) { animation-delay: 1.28s; }
.svc-chips li:nth-child(5) { animation-delay: 1.34s; }
.svc-chips li:nth-child(6) { animation-delay: 1.4s; }
.svc-chips li:nth-child(7) { animation-delay: 1.46s; }
.svc-chips li:nth-child(8) { animation-delay: 1.52s; }
.svc-chips a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-on-dark);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.svc-chips a span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--amber-400); }
.svc-chips a:hover { border-color: var(--amber-400); background: rgba(242, 157, 69, 0.1); color: var(--white); }

@media (max-width: 960px) {
  .svc-hero__inner { grid-template-columns: 1fr; }
  .svc-hero__art { max-width: 560px; }
  .svc-hero__glow { right: -30%; top: 45%; }
}
@media (max-width: 480px) {
  .svc-hero__actions .btn { width: 100%; }
  .svc-chips a { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
}

/* ---------- 2. Service list ---------- */
.svc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: start;
}
.svc-nav {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  gap: 1rem;
}
.svc-nav__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-600);
}
.svc-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--color-border); }
.svc-nav li a {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 0 0.55rem 1rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--dur) var(--ease);
}
.svc-nav li a::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber-500);
  transform: scaleY(0);
  transition: transform var(--dur) var(--ease);
}
.svc-nav li a span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--steel-400); padding-top: 0.15rem; }
.svc-nav li a:hover,
.svc-nav li a.is-active { color: var(--color-text); }
.svc-nav li a.is-active::before { transform: scaleY(1); }
.svc-nav li a.is-active span { color: var(--amber-600); }
.svc-nav__cta { justify-self: start; margin-top: 0.5rem; }

.svc-panels { display: grid; gap: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.svc {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.svc:hover { box-shadow: var(--shadow); border-color: var(--steel-200, #c9d1db); }
.svc__media { position: relative; margin: 0; min-height: 260px; overflow: hidden; background: var(--navy-900); }
.svc__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.9s var(--ease);
}
.svc:hover .svc__media img { transform: scale(1.09); }
.svc__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 15, 27, 0) 45%, rgba(7, 15, 27, 0.75) 100%);
}
.svc__num {
  position: absolute;
  z-index: 1;
  left: 1.1rem;
  bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.85);
}
.svc__body { display: grid; align-content: start; gap: 1rem; padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
.svc__head { display: flex; align-items: center; gap: 1rem; }
.svc__head .card__icon { margin: 0; }
.svc:hover .card__icon { background: var(--navy-900); color: var(--amber-400); border-color: var(--navy-900); }
.svc__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-600);
}
.svc h3 { font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.75rem); line-height: 1.2; }
.svc p { color: var(--color-text-muted); }
.svc p strong { color: var(--color-text); font-weight: 600; }
.svc__list {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px dashed var(--color-border);
}
.svc__list li { display: flex; gap: 0.65rem; align-items: flex-start; font-weight: 500; }
.svc__list svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 3px;
  margin-top: 0.1rem;
  border-radius: 50%;
  color: var(--amber-600);
  background: rgba(232, 137, 43, 0.12);
}

@media (max-width: 1100px) {
  .svc-layout { grid-template-columns: 1fr; }
  .svc-nav { display: none; }
}
@media (max-width: 760px) {
  .svc { grid-template-columns: 1fr; }
  .svc__media { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ---------- 3. Anatomy ---------- */
.anatomy__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: center;
}
.anatomy__figure {
  margin: 0;
  padding: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(7, 15, 27, 0.45);
}
.anatomy__figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-400);
}
.anat { display: block; width: 100%; height: auto; }
.anat__ground { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.2; }
.anat__hatch { stroke: rgba(255, 255, 255, 0.15); stroke-width: 1; }
.anat .part {
  stroke: rgba(238, 242, 246, 0.75);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: opacity var(--dur) var(--ease), stroke var(--dur) var(--ease);
  cursor: pointer;
}
.anat .part .solid { fill: rgba(238, 242, 246, 0.16); transition: fill var(--dur) var(--ease); }
.anat .part rect:not(.solid) { fill: rgba(166, 178, 193, 0.12); }
.anat .part .glass { stroke: #8fd3ff; stroke-width: 3; }
.anat .tag { cursor: pointer; }
.anat .tag circle { fill: var(--navy-950); stroke: var(--amber-400); stroke-width: 1.4; transition: fill var(--dur) var(--ease); }
.anat .tag text {
  fill: var(--amber-400);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-anchor: middle;
  transition: fill var(--dur) var(--ease);
}
.anat.is-focus .part { opacity: 0.22; }
.anat.is-focus .part.is-on { opacity: 1; stroke: var(--amber-400); }
.anat.is-focus .part.is-on .solid { fill: rgba(242, 157, 69, 0.35); }
.anat .tag.is-on circle { fill: var(--amber-400); }
.anat .tag.is-on text { fill: var(--navy-950); }

/* Parts draw in once the figure scrolls into view */
.js .anatomy__figure .part { opacity: 0; transform: translateY(8px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), stroke var(--dur) var(--ease); }
.js .anatomy__figure .tag { opacity: 0; transition: opacity 0.5s var(--ease); }
.js .anatomy__figure.is-visible .part,
.js .anatomy__figure.is-visible .tag { opacity: 1; transform: none; }
.js .anatomy__figure.is-visible .anat.is-focus .part { opacity: 0.22; }
.js .anatomy__figure.is-visible .anat.is-focus .part.is-on { opacity: 1; }
.anatomy__figure .part[data-part="1"], .anatomy__figure .tag[data-part="1"] { transition-delay: 0.1s; }
.anatomy__figure .part[data-part="2"], .anatomy__figure .tag[data-part="2"] { transition-delay: 0.25s; }
.anatomy__figure .part[data-part="3"], .anatomy__figure .tag[data-part="3"] { transition-delay: 0.4s; }
.anatomy__figure .part[data-part="4"], .anatomy__figure .tag[data-part="4"] { transition-delay: 0.55s; }
.anatomy__figure .part[data-part="5"], .anatomy__figure .tag[data-part="5"] { transition-delay: 0.7s; }
.anatomy__figure .part[data-part="6"], .anatomy__figure .tag[data-part="6"] { transition-delay: 0.85s; }
.anatomy__figure .part[data-part="7"], .anatomy__figure .tag[data-part="7"] { transition-delay: 1s; }
.anatomy__figure .part[data-part="8"], .anatomy__figure .tag[data-part="8"] { transition-delay: 1.15s; }
.anat.is-focus .part,
.anat.is-focus .tag { transition-delay: 0s !important; }

.part-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.part-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.part-item:focus-visible { outline: 2px solid var(--amber-400); outline-offset: -2px; }
.part-item__n { font-family: var(--font-mono); font-size: 0.8rem; color: var(--amber-400); padding-top: 0.15rem; }
.part-item__txt { display: grid; gap: 0.15rem; }
.part-item strong { font-weight: 600; color: var(--white); }
.part-item a { font-size: 0.85rem; color: var(--color-on-dark-muted); transition: color var(--dur) var(--ease); }
.part-item a:hover { color: var(--amber-400); }
.part-item.is-on { background: rgba(242, 157, 69, 0.1); }

@media (max-width: 960px) {
  .anatomy__inner { grid-template-columns: 1fr; }
  .part-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
}
@media (max-width: 560px) {
  .part-list { grid-template-columns: 1fr; }
}

/* ---------- 4. Why choose us ---------- */
.why__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.why__grid .card { position: relative; display: grid; align-content: start; gap: 0.85rem; }
.why__grid .card__icon { margin-bottom: 0.4rem; }
.why__num {
  position: absolute;
  top: 1.25rem;
  right: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel-400);
}
@media (max-width: 1100px) { .why__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .why__grid { grid-template-columns: 1fr; } }

/* ---------- Reduced motion: show the finished drawing ---------- */
@media (prefers-reduced-motion: reduce) {
  .svc-hero h1 .w,
  .svc-hero .breadcrumb,
  .svc-hero .eyebrow,
  .svc-hero__lead,
  .svc-hero__actions,
  .svc-chips li,
  .svc-hero__frame,
  .erect .fade,
  .hook { opacity: 1; transform: none; animation: none; }
  .erect .d { stroke-dashoffset: 0; animation: none; }
  .spark, .svc-hero__glow { animation: none; }
  .svc-hero .page-hero__media img { animation: none; transform: none; }
  .js .anatomy__figure .part,
  .js .anatomy__figure .tag { opacity: 1; transform: none; }
}
