/* Hi-Tech Engineering Co. — site styles
   Layout: one long page of full-width bands; purple hero and facilities bands
   bracket white and tinted content bands, all on a 1160px centred track. */
:root {
  --purple: #3C2A9A;       /* brand purple (logo) */
  --purple-deep: #2A1D72;  /* hover / dark band */
  --teal: #03969F;         /* brand teal (logo), fills and accents */
  --teal-text: #037880;    /* teal darkened for text on white (AA) */
  --ink: #1D1934;          /* body text, purple-tinted near black */
  --muted: #555170;        /* secondary text */
  --line: #E1DEEE;         /* hairlines */
  --tint: #F5F4FA;         /* alternate band */
  --white: #FFFFFF;

  --font-display: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Roboto", "Segoe UI", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --step-4: clamp(2rem, 1.3rem + 2.8vw, 3.25rem);

  --radius: 6px;
  --header-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 60;
  height: env(safe-area-inset-top, 0px); background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.005em; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step--1);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-text);
  margin-bottom: 12px;
}
.eyebrow-light { color: #7FE0E6; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-light { background: var(--white); color: var(--purple); }
.btn-light:hover { background: #E7FAFB; }
.btn-outline-light { border: 2px solid rgba(255,255,255,.7); color: var(--white); }
.btn-outline-light:hover { border-color: var(--white); background: rgba(255,255,255,.08); }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; border-radius: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--font-display); }
.brand-text strong { font-size: 1.2rem; font-weight: 800; color: var(--purple); letter-spacing: 0.02em; }
.brand-text span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-text); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: var(--radius);
}
.site-nav a:hover { color: var(--purple); background: var(--tint); }
.site-nav a { position: relative; }
.site-nav a.active:not(.nav-cta) { color: var(--purple); background: #ECEAF7; }
.site-nav a.active:not(.nav-cta)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 3px; border-radius: 2px; background: var(--teal);
}
.site-nav a.nav-cta.active { box-shadow: 0 0 0 3px #9FDDE1; }
.site-nav a.nav-cta { background: var(--purple); color: var(--white); margin-left: 8px; padding: 10px 18px; }
.site-nav a.nav-cta:hover { background: var(--purple-deep); }
.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--white); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: var(--purple); position: relative; content: "";
  }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; top: 6px; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px max(20px, env(safe-area-inset-right, 0px)) 16px max(20px, env(safe-area-inset-left, 0px));
    box-shadow: 0 12px 24px rgba(29, 25, 52, .08);
  }
  .site-nav:not(.open) { display: none; }
  .site-nav a { padding: 14px 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a.nav-cta { margin: 12px 0 0; border-radius: var(--radius); text-align: center; border-bottom: 0; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--purple); color: var(--white); }
.hero::after { /* teal bar echoing the logo's Hi-TECH band */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--teal);
}
.hero-rays {
  position: absolute; right: -140px; top: 50%; width: 640px; aspect-ratio: 1; max-width: none;
  transform: translateY(-50%); opacity: .09;
  background: url("../assets/rays.svg") center / contain no-repeat;
  pointer-events: none;
}
.hero-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 56px; align-items: center; padding-block: 88px 96px;
}
.hero h1 { color: var(--white); }
.hero .lead { margin-top: 20px; font-size: var(--step-1); line-height: 1.6; max-width: 58ch; color: #E4E0F7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts {
  margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); overflow: hidden;
}
.hero-facts div { background: var(--purple); padding: 22px 20px; }
.hero-facts dt { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: #7FE0E6; line-height: 1.1; }
.hero-facts dd { margin: 8px 0 0; font-size: var(--step--1); line-height: 1.45; color: #D9D4F2; }

/* Sections */
.section { padding-block: 88px; }
.section-tint { background: var(--tint); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-sub { margin-top: 14px; color: var(--muted); font-size: var(--step-1); }
.subhead { font-size: var(--step-0); color: var(--muted); font-weight: 700; margin: 44px 0 16px; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.about-intro p:not(.eyebrow) { margin-top: 18px; color: var(--muted); font-size: var(--step-1); max-width: 60ch; }
.about-intro h2 + p { margin-top: 22px; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.pillar { border-top: 3px solid var(--teal); padding-top: 16px; }
.pillar h3 { color: var(--purple); }
.pillar p { margin-top: 8px; color: var(--muted); }

/* Services */
.division { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 40px; }
.division + .division { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--line); }
.division-tag {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: var(--step--1);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--white); padding: 6px 12px; border-radius: 3px;
}
.tag-purple { background: var(--purple); }
.tag-teal { background: var(--teal-text); }
.division-label p { margin-top: 14px; color: var(--muted); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.service-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .service-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.service {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.service .icon {
  width: 36px; height: 36px; padding: 6px; border-radius: var(--radius); background: #E6F5F6;
  fill: none; stroke: var(--teal-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.service h3 { margin-top: 16px; }
.service p { margin-top: 8px; color: var(--muted); }

/* Materials */
.materials { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.materials li {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px;
}
.mat-code {
  font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1;
  color: var(--purple); letter-spacing: 0.02em; padding-bottom: 12px; margin-bottom: 6px;
  border-bottom: 3px solid var(--teal);
}
.mat-name { font-weight: 700; }
.mat-use { color: var(--muted); font-size: var(--step--1); line-height: 1.5; }

/* Facilities */
.section-dark { background: var(--purple-deep); color: #E4E0F7; }
.section-dark h2 { color: var(--white); }
.facilities-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.facilities-grid > div > p:not(.eyebrow) { margin-top: 18px; font-size: var(--step-1); max-width: 48ch; }
.facilities-logo { width: 140px; margin-top: 36px; border: 4px solid var(--white); background: var(--white); border-radius: 4px; }
.table-scroll { overflow-x: auto; min-width: 0; }
.machinery { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.machinery th {
  text-align: left; font-family: var(--font-display); font-size: var(--step--1); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: #7FE0E6;
  padding: 0 12px 12px 0; border-bottom: 2px solid var(--teal);
}
.machinery td { padding: 13px 12px 13px 0; border-bottom: 1px solid rgba(255,255,255,.14); vertical-align: top; }
.machinery td:first-child { color: var(--white); }
.machinery td:last-child { color: #CFC9EE; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Clients */
.key-clients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.key-clients li {
  display: flex; align-items: center; min-height: 104px; padding: 20px 24px;
  border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); color: var(--purple); line-height: 1.25;
}
.client-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px;
}
.client-list li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project { background: var(--white); border-radius: var(--radius); padding: 26px 24px; border: 1px solid var(--line); }
.project-type {
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--teal-text);
}
.project h3 { margin-top: 10px; color: var(--purple); }
.project p:last-child { margin-top: 10px; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.contact-card h3 { color: var(--purple); }
.contact-primary { background: var(--purple); border-color: var(--purple); color: #E4E0F7; }
.contact-primary h3 { color: var(--white); }
.contact-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.contact-line .label { font-size: var(--step--1); color: #B9B1E6; }
.contact-line a { color: var(--white); font-weight: 500; font-size: var(--step-1); text-decoration: none; overflow-wrap: anywhere; }
.contact-line a:hover { text-decoration: underline; }
.contact-people { margin-top: 8px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.2); font-size: var(--step--1); line-height: 1.7; }
address { font-style: normal; color: var(--muted); line-height: 1.7; }
.map-link { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--teal-text); }

/* Footer */
.site-footer { background: var(--ink); color: #B9B5CC; padding-block: 48px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-brand img { width: 72px; flex-shrink: 0; background: var(--white); padding: 3px; border-radius: 3px; }
.footer-brand p { max-width: 36ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; }
.footer-nav a { color: var(--white); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; }
.footer-nav a:hover { color: #7FE0E6; }
.copyright { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); font-size: var(--step--1); }

/* Responsive */
@media (max-width: 1080px) {
  .materials { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .hero-inner, .about-grid, .facilities-grid, .division { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { gap: 40px; padding-block: 64px 72px; }
  .about-grid, .facilities-grid { gap: 40px; }
  .division { gap: 24px; }
  .project-grid, .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-primary { grid-column: 1 / -1; }
  .key-clients { grid-template-columns: minmax(0, 1fr); }
  .key-clients li { min-height: 0; }
  .client-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { padding-block: 64px; }
  .facilities-logo { display: none; }
}
@media (max-width: 640px) {
  .hero-rays { width: 460px; right: -200px; top: 30%; }
  .pillars, .project-grid, .contact-grid, .client-list { grid-template-columns: minmax(0, 1fr); }
  .materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-facts dt { font-size: 1.3rem; }
  .hero-facts div { padding: 18px 16px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { justify-content: flex-start; }
  .brand-text strong { font-size: 1.05rem; }
}

/* Scroll reveal (classes added by main.js) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
