/**
 * KM Technolabs — Page-specific styles
 */

/* ========== HOME HERO ========== */
.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 48px) 0 100px;
  overflow: hidden;
  color: white;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.home-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 18, 48, 0.92) 0%, rgba(47, 51, 88, 0.78) 48%, rgba(26, 61, 54, 0.55) 100%),
    linear-gradient(180deg, rgba(15, 18, 48, 0.35) 0%, transparent 35%, rgba(15, 18, 48, 0.55) 100%);
}

.home-hero .container {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin-left: max(20px, calc((100% - var(--container)) / 2));
  margin-right: auto;
  width: min(100% - 40px, 780px);
}

.home-hero .brand-hero {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: white;
  margin-bottom: var(--space-4);
}

.home-hero .brand-hero span {
  color: var(--primary-light);
}

.home-hero .eyebrow { color: var(--primary-light); }
.home-hero .eyebrow::before { background: var(--primary-light); }

.home-hero h1 {
  color: white;
  margin-bottom: var(--space-5);
  max-width: 14ch;
}

.home-hero h1 .line {
  display: block;
}

.home-hero h1 .accent {
  color: var(--primary-light);
}

.home-hero .lead {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: var(--space-6);
  max-width: 34em;
}

/* Brochure polygon accents */
.hero-shapes .shape {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.hero-shapes .s1 {
  width: min(38vw, 420px);
  height: min(42vw, 380px);
  background: var(--primary);
  opacity: 0.42;
  top: 0;
  right: 0;
  clip-path: polygon(35% 0, 100% 0, 100% 100%, 0 72%);
  mix-blend-mode: multiply;
}

.hero-shapes .s2 {
  width: min(28vw, 280px);
  height: min(22vw, 200px);
  background: var(--primary);
  opacity: 0.55;
  bottom: 12%;
  left: 0;
  clip-path: polygon(0 25%, 100% 0, 85% 100%, 0 100%);
}

.hero-shapes .s3 {
  width: 110px;
  height: 110px;
  background: rgba(255, 255, 255, 0.1);
  top: 28%;
  right: 32%;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.hero-shapes .s4 {
  width: 160px;
  height: 90px;
  background: var(--secondary);
  opacity: 0.55;
  bottom: 0;
  right: 18%;
  border-radius: var(--radius-lg) 0 0 0;
}

@media (max-width: 960px) {
  .home-hero {
    align-items: center;
    padding-bottom: 80px;
  }

  .home-hero .container {
    margin-inline: auto;
    text-align: left;
  }

  .home-hero h1 { max-width: none; }
}

@media (max-width: 600px) {
  .home-hero { padding-bottom: 72px; min-height: 92vh; }
  .hero-shapes .s3,
  .hero-shapes .s4 { display: none; }
}

/* ========== STATS STRIP ========== */
.stats-strip {
  margin-top: -48px;
  position: relative;
  z-index: 5;
  padding-bottom: var(--space-7);
}

.stats-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  border: 1px solid var(--border);
}

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

@media (max-width: 420px) {
  .stats-panel { grid-template-columns: 1fr; }
}

/* ========== TRUSTED BY ========== */
.logo-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.logo-track {
  display: flex;
  gap: var(--space-8);
  width: max-content;
  animation: marquee 32s linear infinite;
}

.logo-track span {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.55;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 48px;
}

.client-logo img {
  height: 40px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.client-logo:hover img {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-2px);
}

.trusted-section .logo-track {
  gap: clamp(var(--space-6), 6vw, var(--space-9));
  align-items: center;
}

.trusted-section .logo-marquee:hover .logo-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .trusted-section .logo-track { animation: none; flex-wrap: wrap; justify-content: center; }
}

/* ========== PROCESS ========== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.process-step {
  position: relative;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 100%;
}

.process-step .step-num {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--primary-soft);
  line-height: 1;
  margin-bottom: var(--space-4);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.process-step h3 { margin-bottom: var(--space-3); }
.process-step p { font-size: var(--text-sm); }

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

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

/* ========== INDUSTRIES ========== */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.industry-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: 0.25s ease;
}

.industry-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.industry-item .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--secondary-soft);
  color: var(--secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.industry-item .icon svg { width: 22px; height: 22px; }
.industry-item h3 { font-size: var(--text-base); margin: 0; }

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

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

/* ========== PRODUCTS ========== */
.product-showcase {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: stretch;
}

.product-main {
  background: var(--secondary);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.product-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, transparent 30%, rgba(15, 18, 48, 0.75)),
    url("../images/hero/handshake.jpg") center/cover;
  opacity: 0.55;
}

.product-main > * { position: relative; z-index: 1; }
.product-main h3 { color: white; margin-bottom: var(--space-3); }
.product-main p { color: rgba(255,255,255,0.8); margin-bottom: var(--space-5); }

.product-side {
  display: grid;
  gap: var(--space-4);
}

.product-side .card-service { min-height: auto; }

@media (max-width: 860px) {
  .product-showcase { grid-template-columns: 1fr; }
}

/* ========== SERVICES PAGE ========== */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: center;
  padding-block: var(--space-8);
}

.service-detail:nth-child(even) .service-detail-media { order: 2; }
.service-detail:nth-child(even) .service-detail-content { order: 1; }

.service-detail-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--secondary-soft);
}

.service-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-detail-media .poly-accent {
  position: absolute;
  width: 35%;
  height: 40%;
  background: var(--primary);
  opacity: 0.7;
  bottom: 0;
  left: 0;
  clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

.service-detail-content .feature-list {
  margin: var(--space-5) 0;
  display: grid;
  gap: var(--space-3);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
}

.feature-list li svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

@media (max-width: 860px) {
  .service-detail {
    grid-template-columns: 1fr;
    padding-block: var(--space-6);
  }
  .service-detail:nth-child(even) .service-detail-media,
  .service-detail:nth-child(even) .service-detail-content { order: initial; }
}

/* ========== ABOUT ========== */
.mission-vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.mv-card {
  padding: var(--space-7);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.mv-card.mission {
  background: var(--primary-soft);
}

.mv-card.vision {
  background: var(--secondary-soft);
}

.mv-card h3 {
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.values-asymmetric {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.values-asymmetric .col-left,
.values-asymmetric .col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.office-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 200px 200px;
  gap: var(--space-3);
}

.office-gallery .g1 {
  grid-row: 1 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.office-gallery .g2,
.office-gallery .g3,
.office-gallery .g4,
.office-gallery .g5 {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.office-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.office-gallery > div:hover img {
  transform: scale(1.05);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.team-card {
  text-align: center;
}

.team-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto var(--space-4);
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  color: white;
  font-size: var(--text-3xl);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.team-card h3 { font-size: var(--text-base); margin-bottom: 4px; }
.team-card p { font-size: var(--text-sm); }

@media (max-width: 900px) {
  .mission-vision,
  .values-asymmetric { grid-template-columns: 1fr; }
  .office-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .office-gallery .g1 { grid-row: auto; aspect-ratio: 16/10; grid-column: 1 / -1; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .team-grid { grid-template-columns: 1fr; }
  .office-gallery { grid-template-columns: 1fr; }
}

/* ========== CONTACT ========== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-7);
  align-items: start;
}

.contact-info-cards {
  display: grid;
  gap: var(--space-4);
}

.contact-info-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--background-alt);
  border-radius: var(--radius-md);
}

.contact-info-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-info-card .icon svg { width: 22px; height: 22px; }
.contact-info-card h3 { font-size: var(--text-base); margin-bottom: 4px; }
.contact-info-card p,
.contact-info-card a { font-size: var(--text-sm); color: var(--text-light); }
.contact-info-card a:hover { color: var(--primary); }

.contact-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.map-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 400px;
  margin-top: var(--space-7);
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.15);
}

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

/* ========== PORTFOLIO ========== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.portfolio-grid .card-portfolio.is-hidden {
  display: none;
}

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

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