/*
 * Author: Manoj Mathangadeera
 * Website: https://codemmhub.github.io/
 * Project: USRI Web Development V2027
 * File Name: home.css
 * File Description: Styles that belong only to the Home page: hero, about and milestones, product tiles, journey, service rows, model cards, industries, featured work and coverage strip.
 */

/* ---------------------------------------------------------------------------
   HERO
   The one big moment of the page. A dark workshop photo with the headline over the calm,
   dark left side. On load the photo settles in and the text rises in order, once.
   --------------------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-items: center;
  min-height: clamp(32rem, 84svh, 50rem);
  padding-block: clamp(4rem, 2rem + 8vw, 8rem);
  background: var(--ink); color: var(--white);
}
/* The photo layer is taller than the hero, so the parallax drift never shows an edge. */
.hero-media { position: absolute; inset: -8% 0; z-index: -2; will-change: transform; }
.hero-media picture { display: block; height: 100%; }
.hero-media img, .hero-media .img-ph { width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; border-radius: 0; }
/* Tint for legible text. On phones the whole photo is dimmed evenly (worst pixel 4.9:1),
   because the text spans the full width. From tablet up only the left side is dark, and the
   welder stays bright. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(35, 31, 32, 0.62) 0%, rgba(35, 31, 32, 0.84) 100%);
}
@media (min-width: 800px) {
  /* Measured on hero-home.jpg: white text in the left 55% stays at 6.7:1 or better in its worst
     pixel (the ceiling lights are the brightest spots). A lighter tint dipped to 4.2:1.
     Re-measure if the hero photo is replaced. */
  .hero::before { background: linear-gradient(90deg, rgba(35, 31, 32, 0.92) 0%, rgba(35, 31, 32, 0.80) 50%, rgba(35, 31, 32, 0.10) 100%); }
  .hero-media img, .hero-media .img-ph { object-position: 70% 50%; }
}
/* The yellow tab that closes every page header, here at the base of the hero */
.hero::after { content: ""; position: absolute; left: 0; bottom: 0; width: clamp(4rem, 12vw, 9rem); height: 6px; background: var(--yellow); }

.hero-content { max-width: 46rem; }
.hero h1 { font-size: clamp(2.75rem, 1.7rem + 5.6vw, 5.5rem); max-width: 14ch; }
.hero .lead { margin-top: var(--s-5); max-width: 36rem; color: rgba(255, 255, 255, 0.92); }
.hero .btn-row { margin-top: var(--s-6); }

/* Entrance: photo settles, then heading, line and buttons rise one after another.
   Only for people who have not asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: hero-settle 1.8s var(--ease) both; }
  .hero-content > * { animation: hero-rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 130ms + 120ms); }
  @keyframes hero-settle { from { transform: scale(1.07); } to { transform: none; } }
  @keyframes hero-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}

/* ---------------------------------------------------------------------------
   ABOUT AND MILESTONES
   --------------------------------------------------------------------------- */
.about-grid { display: grid; gap: var(--s-7); align-items: start; }
.about-copy p { max-width: 62ch; }
.about-copy h2 { margin-bottom: var(--s-4); }

/* A vertical line through the years, with a square marker at each one */
.milestones { position: relative; display: grid; gap: var(--s-5); padding-left: var(--s-6); border-left: 3px solid var(--steel-line); }
.milestones li { position: relative; }
.milestones li::before {
  content: ""; position: absolute; left: calc(-1 * var(--s-6) - 9px); top: 0.55rem;
  width: 15px; height: 15px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 2px;
}
.ms-when { display: block; font-family: var(--font-head); font-weight: 800; font-size: 2.25rem; line-height: 1; color: var(--blue); }
.milestones p { margin-top: var(--s-2); max-width: 36ch; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.25fr 1fr; gap: var(--s-8); } }

/* ---------------------------------------------------------------------------
   PRODUCT TILES
   The name sits on the photo, on a dark fade. Aluminium, the pioneering product, is bigger.
   --------------------------------------------------------------------------- */
.product-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); }
.product-tile a { position: relative; display: block; height: 100%; overflow: hidden; border-radius: var(--radius); background: var(--ink); color: var(--white); text-decoration: none; }
.tile-media { aspect-ratio: 4 / 3; }
.tile-media picture, .tile-media img, .tile-media .img-ph { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform 0.6s var(--ease); }
.tile-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-6) var(--s-4) var(--s-4);
  background: linear-gradient(180deg, rgba(35, 31, 32, 0) 0%, rgba(35, 31, 32, 0.88) 55%);
}
.tile-body h3 { font-size: 1.25rem; }
.tile-body p { display: none; margin-top: var(--s-1); font-size: var(--fs-small); line-height: 1.4; opacity: 0.92; }
.product-tile a:hover .tile-media img, .product-tile a:focus-visible .tile-media img { transform: scale(1.05); }
.product-tile a:focus-visible { outline-offset: -3px; }
/* A yellow bar grows under the name on hover, showing the tile is a link */
.tile-body::after { content: ""; display: block; height: 3px; width: 2.5rem; margin-top: var(--s-3); background: var(--yellow); transition: width 0.3s var(--ease); }
.product-tile a:hover .tile-body::after, .product-tile a:focus-visible .tile-body::after { width: 5rem; }

@media (min-width: 600px) { .tile-body p { display: block; } .tile-body h3 { font-size: 1.5rem; } }
@media (min-width: 900px) {
  /* Fixed row height, so every tile fills its cell exactly whatever its width.
     Cells: the feature tile takes 4 (2 wide, 2 tall), six tiles take 6, and the last tile
     spans two columns for 2 more. That fills three rows of four with no gap. */
  .product-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(11.5rem, 17vw, 16rem); gap: var(--s-5); }
  .product-tile .tile-media { aspect-ratio: auto; height: 100%; }
  .product-tile--feature { grid-column: span 2; grid-row: span 2; }
  .product-tile:last-child { grid-column: span 2; }
  .product-tile--feature .tile-body h3 { font-size: 2.25rem; }
  .product-tile--feature .tile-body p { font-size: 1.0625rem; }
}

/* ---------------------------------------------------------------------------
   JOURNEY (chassis to road)
   Four stops on a line. Without JavaScript every stop shows as reached. animations.js draws
   the line with --p (0 to 1) and adds .is-lit to each stop as the line arrives at it.
   Vertical on phones, horizontal from 900px.
   --------------------------------------------------------------------------- */
.journey-wrap { --p: 1; position: relative; margin-bottom: var(--s-2); }
.journey { display: grid; gap: var(--s-6); position: relative; }
.journey-step { position: relative; padding-left: 5.5rem; min-height: 4.5rem; }
.journey-node {
  position: absolute; left: 0; top: 0; z-index: 1;
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: var(--blue); color: var(--white); border: 4px solid var(--white);
  box-shadow: 0 0 0 2px var(--blue);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.journey-node .icon { width: 2rem; height: 2rem; }
.journey-step h3 { font-size: 1.5rem; margin-bottom: var(--s-2); }
.journey-step p { max-width: 34ch; }

/* The track, and the blue fill that grows along it */
.journey-line { position: absolute; left: calc(2.25rem - 2px); top: 2.25rem; bottom: 2.25rem; width: 4px; background: var(--steel-line); border-radius: 2px; }
.journey-fill { display: block; width: 100%; height: 100%; background: var(--blue); border-radius: 2px; transform-origin: top; transform: scaleY(var(--p)); }

/* Stops the line has not reached yet look empty. Only once the animation is ready. */
.anim-ready .journey-step:not(.is-lit) .journey-node { background: var(--white); color: var(--slate); box-shadow: 0 0 0 2px var(--steel-line); }

@media (min-width: 900px) {
  .journey { grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
  .journey-step { padding-left: 0; padding-top: 6rem; text-align: center; min-height: 0; }
  .journey-node { left: 50%; margin-left: -2.25rem; }
  .journey-step p { margin-inline: auto; }
  /* Line runs through the centres of the first and last stop (a quarter cell in from each side) */
  .journey-line { left: 12.5%; right: 12.5%; top: calc(2.25rem - 2px); bottom: auto; width: auto; height: 4px; }
  .journey-fill { transform-origin: left; transform: scaleX(var(--p)); }
}

/* ---------------------------------------------------------------------------
   SERVICE ROWS
   --------------------------------------------------------------------------- */
.service-list { display: grid; border-top: 1px solid var(--steel-line); }
.service-row { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-4) 0; border-bottom: 1px solid var(--steel-line); text-decoration: none; }
.service-thumb { flex: none; width: 6.5rem; border-radius: var(--radius); overflow: hidden; }
.service-thumb picture, .service-thumb img, .service-thumb .img-ph { display: block; width: 100%; height: auto; }
.service-thumb img { transition: transform 0.5s var(--ease); }
.service-text h3 { font-size: 1.375rem; transition: color 0.2s; }
.service-text p { margin-top: var(--s-1); color: var(--slate); font-size: var(--fs-small); line-height: 1.45; }
.service-row:hover h3, .service-row:focus-visible h3 { color: var(--blue); }
.service-row:hover .service-thumb img { transform: scale(1.06); }
@media (min-width: 600px) { .service-thumb { width: 8.5rem; } }
@media (min-width: 900px) {
  .service-list { grid-template-columns: 1fr 1fr; column-gap: var(--s-8); }
}

/* ---------------------------------------------------------------------------
   INDUSTRIES
   --------------------------------------------------------------------------- */
.industry-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.industry-list a {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); height: 100%;
  padding: var(--s-4); text-decoration: none; font-weight: 600; line-height: 1.3;
  border: 1px solid var(--steel-line); border-radius: var(--radius); background: var(--white);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.industry-list .icon { width: 2.5rem; height: 2.5rem; color: var(--blue); }
.industry-list a:hover, .industry-list a:focus-visible { border-color: var(--blue); transform: translateY(-3px); }
@media (min-width: 600px) { .industry-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .industry-list { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------------------------
   FEATURED WORK (an uneven mosaic, the first photo is the widest)
   --------------------------------------------------------------------------- */
.work-grid { display: grid; gap: var(--s-4); }
.work-item figure { position: relative; margin: 0; height: 100%; overflow: hidden; border-radius: var(--radius); background: var(--ink); }
.work-item picture, .work-item img, .work-item .img-ph { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.work-item figure { aspect-ratio: 3 / 2; }
.work-item img { transition: transform 0.6s var(--ease); }
.work-item figure:hover img { transform: scale(1.04); }
.work-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s-6) var(--s-4) var(--s-4);
  color: var(--white); font-weight: 600; line-height: 1.3;
  background: linear-gradient(180deg, rgba(35, 31, 32, 0), rgba(35, 31, 32, 0.85));
}
@media (min-width: 900px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(13rem, 21vw, 19rem); }
  .work-item figure { aspect-ratio: auto; }
  .work-item--feature { grid-column: span 2; }
  .work-item:nth-child(4) { grid-column: span 2; }
}

/* ---------------------------------------------------------------------------
   CLIENTS, FAQ LAYOUT, COVERAGE STRIP, CLOSING BAND
   --------------------------------------------------------------------------- */
.clients { overflow: hidden; }
.clients .section-head { margin-bottom: var(--s-6); }

@media (min-width: 900px) {
  .faq-wrap { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s-8); align-items: start; }
  .faq-wrap .section-head { margin-bottom: 0; }
}

.coverage { background: var(--alice); padding-block: var(--s-5); }
.coverage-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); }
.coverage p { display: flex; align-items: center; gap: var(--s-3); font-weight: 500; }
.coverage .icon { width: 1.75rem; height: 1.75rem; color: var(--blue); }

/* The closing band uses --overlay from bg_var and, on desktop, drifts the photo slowly.
   inset extends the photo layer so the drift never exposes an edge. */
.cta-band[data-parallax-bg]::before { inset: -70px 0; background-position: center calc(50% + var(--bg-shift, 0px)); }
.cta-band { overflow: hidden; } /* clips the extended photo layer at the section edges */
.cta-band h2 { font-size: var(--fs-h2); }
