/* Tratek Asia - static site styles
   Palette: deep industrial blue + slate gray + a warm accent for CTAs.
   Swap the variables below to rebrand. */

:root {
  --color-primary: #0b3d63;
  --color-primary-dark: #082a45;
  --color-accent: #e08a2c;
  --color-glow: #22d3ee;
  --color-glow-soft: rgba(34, 211, 238, 0.35);
  --color-text: #1f2933;
  --color-text-muted: #52606d;
  --color-bg: #ffffff;
  --color-bg-alt: #f4f6f8;
  --color-border: #d9e2ec;
  --radius: 6px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3 { color: var(--color-primary-dark); line-height: 1.25; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 48px 0; }

/* Header / nav */
.site-header {
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header--scrolled {
  background: rgba(8, 42, 69, 0.94);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
@supports (backdrop-filter: blur(6px)) {
  .site-header--scrolled { backdrop-filter: blur(8px); }
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.site-header__brand img {
  height: 32px;
  background: #fff;
  padding: 6px 10px;
  border-radius: var(--radius);
}
.site-header__nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-header__nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-glow);
  box-shadow: 0 0 6px var(--color-glow-soft);
  transition: width 0.25s ease;
}
.site-header__nav a:hover::after,
.site-header__nav a[aria-current="page"]::after { width: 100%; }

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  overflow: hidden;
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 96px 20px;
  max-width: 720px;
}
.hero__content h1 { color: #fff; font-size: 2.5rem; margin-bottom: 12px; }
.hero__subheading { font-size: 1.15rem; color: #e6edf2; margin-bottom: 28px; }

.accent-gradient {
  background: linear-gradient(90deg, #ffffff, var(--color-glow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero--photo {
  background:
    linear-gradient(135deg, rgba(15, 40, 70, 0.88), rgba(15, 40, 70, 0.78)),
    url("../img/hero-building.jpg") center/cover no-repeat;
}

/* Blueprint / circuit grid texture behind hero & page-header content */
.hero::before,
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  z-index: 0;
  pointer-events: none;
}

/* Animated scanning sweep across the hero (disabled for reduced-motion users) */
@media (prefers-reduced-motion: no-preference) {
  .hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: -45%;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
    z-index: 1;
    pointer-events: none;
    animation: scan-sweep 7s linear infinite;
  }
}
@keyframes scan-sweep {
  0% { left: -45%; }
  60% { left: 115%; }
  100% { left: 115%; }
}

/* Network canvas (particle / connection-line animation) */
.network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Trust strip (client / portfolio callout) */
.trust-strip {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
  text-align: center;
}
.trust-strip p { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }
.trust-strip strong { color: var(--color-primary-dark); }

.page-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  padding: 56px 0;
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 { color: #fff; margin: 0; }
.page-header p { color: #e6edf2; margin: 8px 0 0; max-width: 640px; }

/* Buttons / links */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: #c9761f; }
.link-arrow { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(11, 61, 99, 0.16);
  border-color: var(--color-glow-soft);
}
.card__icon {
  position: relative;
  height: 40px;
  width: 40px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 0.25s ease;
}
.card:hover .card__icon { transform: scale(1.08); }

/* "Live" status indicator on the equipment cards (Home) - suggests a monitored BMS point */
.equipment-grid .card__icon::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-glow);
  box-shadow: 0 0 0 2px var(--color-bg-alt);
}
@media (prefers-reduced-motion: no-preference) {
  .equipment-grid .card__icon::after { animation: pulse-dot 2.2s ease-in-out infinite; }
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 7px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 0 rgba(34, 211, 238, 0); }
}
.card__image { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; background: var(--color-border); }
.card__meta { color: var(--color-text-muted); font-size: 0.9rem; margin-top: -8px; }
.card__placeholder-note { color: var(--color-text-muted); font-size: 0.8rem; font-style: italic; }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin-top: 12px; }
.tag {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.content-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 16px 0; background: var(--color-border); }

/* Service detail blocks (Preventive Maintenance / Retrofit / Bespoke Energy) */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 28px;
  align-items: center;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 24px;
}
.service-detail__image { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius); }
.service-detail h3 { margin-top: 0; }
.service-detail ul { margin: 12px 0 0; padding-left: 20px; color: var(--color-text-muted); }
.service-detail ul li { margin-bottom: 6px; }
@media (max-width: 640px) {
  .service-detail { grid-template-columns: 1fr; }
  .service-detail__image { order: -1; height: 180px; }
}

.brand-showcase { width: 100%; border-radius: var(--radius); border: 1px solid var(--color-border); margin: 24px 0; }

/* Stats / milestones row */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 24px 0 40px;
}
.stat {
  border-left: 3px solid var(--color-accent);
  padding: 4px 0 4px 16px;
}
.stat__year { font-weight: 700; color: var(--color-primary-dark); font-size: 1.1rem; }
.stat__desc { color: var(--color-text-muted); margin: 4px 0 0; }

/* People / team cards */
.person-card { text-align: center; }
.person-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 auto 12px;
  overflow: hidden;
}
.person-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card__role { color: var(--color-accent); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 4px; }
.person-card__name { margin: 0 0 8px; }
.person-card ul { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; font-size: 0.9rem; color: var(--color-text-muted); }
.person-card ul li { margin-bottom: 4px; }
.person-card ul li strong { color: var(--color-text); }

/* Two-column layout (About) */
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Contact */
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact-list { list-style: none; padding: 0; margin: 16px 0; }
.contact-list li { margin-bottom: 8px; }
.contact-map { width: 100%; height: 260px; border: 0; border-radius: var(--radius); margin-top: 16px; }

.contact-form .form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.contact-form label { font-weight: 600; font-size: 0.9rem; }
.contact-form input,
.contact-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}
.form-row--honeypot { position: absolute; left: -9999px; top: -9999px; }
.form-note { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 12px; }

/* Footer */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .contact-section, .two-col { grid-template-columns: 1fr; }
  .hero__content h1, .page-header h1 { font-size: 2rem; }
}

/* Scroll-reveal (applied automatically by js/site.js; no-op if JS is disabled) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* Animated counters (js/site.js counts up when scrolled into view; static number is the no-JS fallback) */
.counter { font-variant-numeric: tabular-nums; }

/* Per-equipment animated icons - append this whole block to the end of
   css/style.css (paste it in via cPanel File Manager's code editor). It only
   adds new rules, so it won't affect anything already in your stylesheet. */

.equipment-grid .card__icon {
  position: relative;
  width: 72px;
  height: 72px;
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 14px;
}
.equipment-grid .card__icon svg { width: 100%; height: 100%; overflow: visible; }

/* "Live" status dot stays as before, just repositioned for the larger icon */
.equipment-grid .card__icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-glow);
  box-shadow: 0 0 0 2px var(--color-bg-alt);
}

/* Realistic per-equipment motion - spinning impellers/fans, flowing
   refrigerant and airflow, rising cooling-tower mist. Fully disabled for
   visitors with prefers-reduced-motion set - icons still render correctly,
   just without movement. */
@media (prefers-reduced-motion: no-preference) {
  .equipment-grid .card__icon::after { animation: eq-pulse-dot 2.2s ease-in-out infinite; }
  .eq-spin { animation: eq-spin 3s linear infinite; }
  .eq-spin-slow { animation: eq-spin 7s linear infinite; }
  .eq-pulse { animation: eq-pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .eq-rise { animation: eq-rise 2.4s ease-in-out infinite; }
  .eq-rise:nth-of-type(2) { animation-delay: .6s; }
  .eq-rise:nth-of-type(3) { animation-delay: 1.2s; }
  .eq-chevron { animation: eq-chevron 1.5s ease-in-out infinite; }
  .eq-chevron:nth-of-type(2) { animation-delay: .3s; }
}
@keyframes eq-pulse-dot {
  0% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 7px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 2px var(--color-bg-alt), 0 0 0 0 rgba(34, 211, 238, 0); }
}
@keyframes eq-spin { to { transform: rotate(360deg); } }
@keyframes eq-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes eq-rise {
  0% { transform: translateY(4px); opacity: 0; }
  35% { opacity: 0.9; }
  100% { transform: translateY(-12px); opacity: 0; }
}
@keyframes eq-chevron {
  0% { opacity: 0; transform: translateX(-4px); }
  45% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(5px); }
}

/* Per-service animated icons - reuses eq-spin / eq-spin-slow / eq-pulse /
   eq-pulse-dot already defined above for the equipment icons, so this only
   adds the pieces the equipment block doesn't already have. */

.services-grid .card__icon {
  position: relative;
  width: 72px;
  height: 72px;
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 14px;
}
.services-grid .card__icon svg { width: 100%; height: 100%; overflow: visible; }

.services-grid .card__icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-glow);
  box-shadow: 0 0 0 2px var(--color-bg-alt);
}

@media (prefers-reduced-motion: no-preference) {
  .services-grid .card__icon::after { animation: eq-pulse-dot 2.2s ease-in-out infinite; }
  .eq-oscillate { animation: eq-oscillate 2.4s ease-in-out infinite; }
  .eq-needle { animation: eq-needle 3s ease-in-out infinite; }
  .eq-scan { animation: eq-scan 2.2s ease-in-out infinite; }
  .eq-blip { animation: eq-blip 1.8s ease-in-out infinite; }
  .eq-blip:nth-of-type(2) { animation-delay: .3s; }
  .eq-blip:nth-of-type(3) { animation-delay: .6s; }
  .eq-blip:nth-of-type(4) { animation-delay: .9s; }
}
@keyframes eq-oscillate {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(14deg); }
}
@keyframes eq-needle {
  0%, 100% { transform: rotate(-28deg); }
  50% { transform: rotate(30deg); }
}
@keyframes eq-scan {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(23px); opacity: 0; }
}
@keyframes eq-blip {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Trust badges (homepage trust-strip)
   ========================================================================== */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.badge-logo {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--color-primary-dark);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 18px;
}

/* ==========================================================================
   Live BMS feed widget (homepage)
   ========================================================================== */
.live-feed {
  background: var(--color-primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.live-feed__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.live-feed__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.live-feed__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-glow);
  display: inline-block;
  box-shadow: 0 0 0 2px var(--color-primary-dark);
}
@media (prefers-reduced-motion: no-preference) {
  .live-feed__dot { animation: eq-pulse-dot 2.2s ease-in-out infinite; }
}
.live-feed__note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}
.live-feed__rows { display: flex; flex-direction: column; gap: 2px; }
.live-feed__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 4px;
  font-size: 0.92rem;
}
.live-feed__row:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.live-feed__label { font-weight: 600; }
.live-feed__state {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}
.live-feed__state--run { background: rgba(34, 211, 238, 0.16); color: var(--color-glow); }
.live-feed__state--ok { background: rgba(52, 199, 89, 0.18); color: #34c759; }
.live-feed__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.85);
}
@media (max-width: 640px) {
  .live-feed__row { grid-template-columns: 1fr; text-align: left; gap: 2px; }
  .live-feed__value { text-align: left; }
}

/* ==========================================================================
   "How We Work" process steps (services page)
   ========================================================================== */
.process-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 32px;
  flex-wrap: wrap;
}
.process-step {
  flex: 1 1 160px;
  min-width: 140px;
  text-align: center;
  padding: 0 8px;
  position: relative;
}
.process-step__num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 12px;
  position: relative;
  z-index: 2;
}
.process-step h3 { font-size: 1rem; margin: 0 0 6px; }
.process-step p { font-size: 0.85rem; color: var(--color-text-muted); margin: 0; }
.process-connector {
  position: absolute;
  top: 22px;
  left: calc(50% + 30px);
  right: calc(-50% + 30px);
  height: 2px;
  background: var(--color-border);
  z-index: 1;
  overflow: hidden;
}
.process-connector__dot {
  position: absolute;
  top: -2px;
  left: -10%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-glow);
}
@media (prefers-reduced-motion: no-preference) {
  .process-connector__dot { animation: process-flow 2.4s linear infinite; }
}
@keyframes process-flow {
  0% { left: -10%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}
@media (max-width: 820px) {
  .process-steps { flex-direction: column; align-items: stretch; }
  .process-connector { display: none; }
  .process-step {
    text-align: left;
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }
  .process-step__num { margin: 0; flex-shrink: 0; }
}
