/* =========================================================================
   VECTOR ENGINEERING — SECTION COMPONENTS
   Reusable, page-spanning building blocks (hero, stats, grids, timeline,
   carousel, testimonials, CTA banner, gallery/lightbox).
   ========================================================================= */

/* ---------------------------------------------------------------------
   HERO (Home) — gradient bg + kinetic type + 3D canvas
   --------------------------------------------------------------------- */
.hero{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 110px;
  overflow: hidden;
  background: var(--c-ink);
  isolation: isolate;
}
.hero::before{
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-brand);
  opacity: 0.92;
  z-index: -2;
}
.hero::after{
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(80,168,224,0.35), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(0,8,112,0.5), transparent 60%);
  z-index: -1;
}
.hero-grid{
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  z-index: -1;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 75%);
}
.hero-inner{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--sp-8);
  width: 100%;
}
.hero-eyebrow{
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
}
.hero-eyebrow svg{ width: 14px; height: 14px; color: var(--c-sky); }
.hero h1{
  color: #fff;
  font-size: var(--fs-h1);
  margin-bottom: var(--sp-6);
}
.hero h1 .line{ display: block; overflow: hidden; }
.hero h1 .line span{ display: inline-block; will-change: transform; }
.hero h1 em{
  font-style: normal;
  background: linear-gradient(135deg, #fff 0%, var(--c-sky) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead{
  color: rgba(255,255,255,0.82);
  font-size: var(--fs-lead);
  max-width: 50ch;
  margin-bottom: var(--sp-7);
}
.hero-ctas{ display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-9); }
.hero-ctas .btn--ghost{ color: #fff; border-color: rgba(255,255,255,0.3); }
.hero-ctas .btn--ghost:hover{ border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }

.hero-trustbar{ display: flex; gap: var(--sp-8); flex-wrap: wrap; }
.hero-trustbar .stat-mini b{
  display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: #fff;
}
.hero-trustbar .stat-mini span{ font-size: 0.78rem; color: rgba(255,255,255,0.65); letter-spacing: 0.03em; }

.hero-canvas-wrap{
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  justify-self: center;
}
#hero-canvas{ width: 100%; height: 100%; display: block; opacity: 0; }
.hero-canvas-fallback{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity 500ms ease-out;
}
.hero-canvas-fallback img{ width: 78%; filter: drop-shadow(0 30px 60px rgba(0,0,0,0.4)); animation: float-y 6s var(--ease-in-out) infinite; }
/* three-hero.js adds .is-ready to the wrap once WebGL has actually rendered
   a frame — until then (slow CDN, blocked script, no WebGL, no JS) the
   static logo mark fallback stays visible, so failure is invisible to users. */
.hero-canvas-wrap.is-ready .hero-canvas-fallback{ opacity: 0; }
.hero-canvas-wrap.is-ready #hero-canvas{ opacity: 1; }

.hero-scroll-cue{
  position: absolute;
  bottom: var(--sp-6); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-scroll-cue .stick{
  width: 1.5px; height: 30px;
  background: linear-gradient(rgba(255,255,255,0.7), transparent);
  animation: scroll-cue 2s var(--ease-in-out) infinite;
}
@keyframes scroll-cue{ 0%{ transform: scaleY(0); transform-origin: top; } 50%{ transform: scaleY(1); transform-origin: top; } 51%{ transform-origin: bottom; } 100%{ transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 980px){
  .hero-inner{ grid-template-columns: 1fr; text-align: center; }
  .hero-lead{ margin-inline: auto; }
  .hero-ctas{ justify-content: center; }
  .hero-trustbar{ justify-content: center; }
  .hero-canvas-wrap{ max-width: 360px; margin-top: var(--sp-6); }
}

/* ---------------------------------------------------------------------
   PAGE HEADER (interior pages — About / Services / Projects / Contact)
   --------------------------------------------------------------------- */
.page-header{
  position: relative;
  padding: calc(var(--sp-12) + 30px) 0 var(--sp-9);
  background: var(--gradient-brand);
  overflow: hidden;
  isolation: isolate;
}
.page-header::after{
  content:'';
  position: absolute; inset: 0;
  background-image: radial-gradient(ellipse 70% 70% at 85% 20%, rgba(80,168,224,0.4), transparent 60%);
  z-index: -1;
}
.page-header .breadcrumbs{
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 0.82rem; color: rgba(255,255,255,0.65);
  margin-bottom: var(--sp-5);
  font-weight: 600;
}
.page-header .breadcrumbs a:hover{ color: #fff; }
.page-header .breadcrumbs svg{ width: 11px; height: 11px; }
.page-header h1{ color: #fff; max-width: 18ch; }
.page-header .lead{ color: rgba(255,255,255,0.82); margin-top: var(--sp-4); }

/* ---------------------------------------------------------------------
   STAT COUNTERS
   --------------------------------------------------------------------- */
.stat-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
}
.stat-card{
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
}
.stat-card .num{
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 800;
  color: var(--heading);
}
.stat-card .num .suffix{ font-size: 0.5em; color: var(--accent); }
.stat-card .label{ margin-top: var(--sp-2); font-size: 0.88rem; color: var(--text-muted); font-weight: 600; }

@media (max-width: 900px){ .stat-grid{ grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------------
   SERVICES GRID
   --------------------------------------------------------------------- */
.services-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
.service-card{
  padding: var(--sp-7) var(--sp-6);
  position: relative;
  overflow: hidden;
}
.service-card:hover{ transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.service-card .icon-wrap{
  width: 58px; height: 58px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand);
  margin-bottom: var(--sp-5);
  transition: transform var(--dur-base) var(--ease-out);
}
.service-card:hover .icon-wrap{ transform: scale(1.08) rotate(-4deg); }
.service-card .icon-wrap svg{ width: 28px; height: 28px; color: #fff; }
.service-card h3{ font-size: 1.2rem; margin-bottom: var(--sp-3); }
.service-card p{ color: var(--text-muted); font-size: 0.93rem; margin-bottom: var(--sp-5); }
.service-card .card-link{
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  color: var(--accent);
}
.service-card .card-link svg{ width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-out); }
.service-card:hover .card-link svg{ transform: translateX(4px); }

@media (max-width: 980px){ .services-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .services-grid{ grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------
   PROCESS TIMELINE (scroll-scrubbed — genuine chronological sequence)
   --------------------------------------------------------------------- */
.timeline{ position: relative; max-width: 880px; margin-inline: auto; }
.timeline-track{
  position: absolute;
  left: 27px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-track-fill{
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  background: var(--gradient-brand);
  transform-origin: top;
}
.timeline-step{
  position: relative;
  padding-left: 80px;
  padding-bottom: var(--sp-9);
}
.timeline-step:last-child{ padding-bottom: 0; }
.timeline-num{
  position: absolute; left: 0; top: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--text-muted);
  transition: border-color var(--dur-base), color var(--dur-base), background var(--dur-base);
  z-index: 1;
}
.timeline-step.is-active .timeline-num{
  border-color: transparent;
  background: var(--gradient-brand);
  color: #fff;
}
.timeline-step h3{ font-size: 1.15rem; margin-bottom: var(--sp-2); }
.timeline-step p{ color: var(--text-muted); font-size: 0.93rem; max-width: 56ch; }

@media (max-width: 600px){
  .timeline-track{ left: 21px; }
  .timeline-step{ padding-left: 62px; }
  .timeline-num{ width: 44px; height: 44px; font-size: 0.95rem; }
}

/* ---------------------------------------------------------------------
   CAROUSEL (featured projects)
   --------------------------------------------------------------------- */
.carousel{ position: relative; }
.carousel-track{
  display: flex;
  gap: var(--sp-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: var(--sp-4);
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar{ display: none; }
.carousel-track:focus-visible{
  outline: none;
  box-shadow: inset 0 0 0 2.5px var(--c-sky);
  border-radius: var(--radius-md);
}
.carousel-slide{
  flex: 0 0 min(380px, 84vw);
  scroll-snap-align: start;
  overflow: hidden;
}
.carousel-media{
  aspect-ratio: 4/3;
  background: var(--gradient-brand);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.carousel-media img, .gallery-item img, .feature-visual img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}
.carousel-slide:hover .carousel-media img,
.gallery-item:hover img{ transform: scale(1.06); }
.carousel-media svg{ width: 64px; height: 64px; color: rgba(255,255,255,0.85); }
.carousel-media .tag{
  position: absolute; top: var(--sp-3); left: var(--sp-3);
  background: rgba(22,24,29,0.55);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.35rem 0.8rem; border-radius: var(--radius-full);
}
.carousel-body{ padding: var(--sp-5); }
.carousel-body h3{ font-size: 1.05rem; margin-bottom: var(--sp-2); }
.carousel-body p{ font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0; }
.carousel-meta{ display: flex; gap: var(--sp-4); margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.carousel-meta div{ font-size: 0.78rem; color: var(--text-muted); }
.carousel-meta b{ display: block; color: var(--heading); font-family: var(--font-display); font-size: 0.95rem; }

.carousel-nav{ display: flex; gap: var(--sp-3); justify-content: flex-end; margin-bottom: var(--sp-6); }
.carousel-nav button{
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-card);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.carousel-nav button:hover{ background: var(--gradient-brand); color: #fff; border-color: transparent; }
.carousel-nav svg{ width: 18px; height: 18px; }
.carousel-nav button:disabled{ opacity: 0.35; pointer-events: none; }

/* ---------------------------------------------------------------------
   TESTIMONIALS
   --------------------------------------------------------------------- */
.testimonial-grid{ display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-6); }
.testimonial-card{ padding: var(--sp-7) var(--sp-6); display: flex; flex-direction: column; }
.testimonial-stars{ display: flex; gap: 3px; margin-bottom: var(--sp-5); }
.testimonial-stars svg{ width: 16px; height: 16px; color: var(--c-sky); }
.testimonial-quote{ font-size: 0.95rem; color: var(--text); margin-bottom: var(--sp-6); flex-grow: 1; }
.testimonial-person{ display: flex; align-items: center; gap: var(--sp-3); }
.testimonial-avatar{
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  flex-shrink: 0;
}
.testimonial-person b{ display: block; font-size: 0.9rem; font-family: var(--font-display); }
.testimonial-person span{ font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 900px){ .testimonial-grid{ grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------
   GRADIENT CTA BANNER
   --------------------------------------------------------------------- */
.cta-banner{
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  padding: var(--sp-9) var(--sp-8);
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}
.cta-banner::before{
  content:'';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 45%);
  z-index: -1;
}
.cta-banner h2{ color: #fff; max-width: 22ch; margin-inline: auto; }
.cta-banner p{ color: rgba(255,255,255,0.85); max-width: 50ch; margin: var(--sp-4) auto var(--sp-7); }
.cta-banner .hero-ctas{ justify-content: center; margin-bottom: 0; }
.cta-banner .btn--ghost{ color: #fff; border-color: rgba(255,255,255,0.35); }
.cta-banner .btn--ghost:hover{ border-color: #fff; background: rgba(255,255,255,0.1); }
.cta-banner .btn--primary{ background: #fff; color: var(--c-indigo); box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------------------
   GALLERY + LIGHTBOX (Projects page)
   --------------------------------------------------------------------- */
.filter-bar{ display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-8); }
.filter-chip{
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface-card);
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.filter-chip:hover{ border-color: var(--accent); }
.filter-chip[aria-pressed="true"]{ background: var(--gradient-brand); color: #fff; border-color: transparent; }

.gallery-grid{ display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-5); }
.gallery-item{
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  text-align: left;
}
.gallery-item svg{ width: 46px; height: 46px; color: rgba(255,255,255,0.5); }
.gallery-item-info{
  position: absolute; inset: auto 0 0 0;
  padding: var(--sp-5);
  background: linear-gradient(to top, rgba(0,8,30,0.88), transparent);
  color: #fff;
  transform: translateY(8px);
  opacity: 0.92;
}
.gallery-item-info span{ font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.gallery-item-info h3{ font-size: 1.02rem; color: #fff; margin-top: 4px; }
.gallery-item[hidden]{ display: none; }
.gallery-item button.expand{
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: none; z-index: 2;
}

.lightbox{
  position: fixed; inset: 0; z-index: 9400;
  background: rgba(10,11,16,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.lightbox.is-open{ opacity: 1; visibility: visible; }
.lightbox-panel{
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 720px; width: 100%;
  position: relative;
  overflow: hidden;
  transform: scale(0.94); transition: transform var(--dur-base) var(--ease-out);
}
.lightbox.is-open .lightbox-panel{ transform: scale(1); }
.lightbox-media{ aspect-ratio: 16/9; background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; }
.lightbox-media svg{ width: 70px; height: 70px; color: rgba(255,255,255,0.6); }
.lightbox-body{ padding: var(--sp-6); }
.lightbox-close{
  position: absolute; top: var(--sp-5); right: var(--sp-5);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.lightbox-close svg{ width: 18px; height: 18px; }

@media (max-width: 900px){ .gallery-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .gallery-grid{ grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------
   LOGO / TRUST MARQUEE
   --------------------------------------------------------------------- */
.marquee{ overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track{ display: flex; gap: var(--sp-10); width: max-content; animation: marquee 28s linear infinite; }
.marquee-item{ display: flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-weight: 700; color: var(--text-muted); font-size: 0.95rem; white-space: nowrap; opacity: 0.7; }
.marquee-item svg{ width: 20px; height: 20px; }

/* ---------------------------------------------------------------------
   GENERIC TWO-COL FEATURE (About story, service detail copy blocks)
   --------------------------------------------------------------------- */
.feature-split{ display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-9); align-items: center; }
.feature-split.is-reverse{ direction: rtl; }
.feature-split.is-reverse > *{ direction: ltr; }
.feature-visual{
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.feature-visual svg{ width: 30%; height: 30%; color: rgba(255,255,255,0.85); }
.feature-visual .chev-pattern{ position: absolute; inset: 0; opacity: 0.18; }
.feature-list{ margin-top: var(--sp-6); display: grid; gap: var(--sp-4); }
.feature-list li{ display: flex; gap: 0.8rem; align-items: flex-start; font-size: 0.93rem; }
.feature-list svg{ width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

@media (max-width: 900px){
  .feature-split{ grid-template-columns: 1fr; }
  .feature-split.is-reverse{ direction: ltr; }
}

/* image-placeholder treatment used wherever real client photography
   will eventually replace an illustrated panel */
.media-placeholder{
  position: relative;
}
.media-placeholder .ph-caption{
  position: absolute; bottom: var(--sp-3); right: var(--sp-3);
  background: rgba(10,11,16,0.55);
  color: rgba(255,255,255,0.8);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}
