/* ==========================================================================
   Polytech Instruments — Design System
   Typography: Space Grotesk (display/structure) + IBM Plex Sans (body/UI)
   Palette: deep instrument-panel navy + calibration amber, warm paper ground
   ========================================================================== */

:root {
  --ink: #0d1b26;
  --navy-900: #0a1620;
  --navy-800: #0f2436;
  --navy-700: #16344c;
  --navy-600: #204a68;
  --steel-500: #4d7590;
  --steel-300: #a9c2d1;
  --paper: #f5f2ea;
  --paper-dim: #ece7da;
  --white: #fffdf8;
  --amber: #e2963a;
  --amber-dark: #c67a22;
  --line: rgba(13, 27, 38, 0.12);
  --line-strong: rgba(13, 27, 38, 0.22);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  --container: 1240px;
  --radius: 3px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 600;
}
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; top: -48px; left: 16px; z-index: 1000;
  background: var(--ink); color: var(--white); padding: 12px 18px;
  border-radius: var(--radius); transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Section rhythm ---------- */
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--navy { background: var(--navy-800); color: var(--paper); }
.section--paper-dim { background: var(--paper-dim); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-dark);
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--amber);
  display: inline-block;
}
.section--navy .eyebrow { color: var(--amber); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 48px;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 42px); max-width: 640px; }
.section-head .lede { max-width: 420px; color: var(--steel-500); font-size: 16px; }
.section--navy .section-head .lede { color: var(--steel-300); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 15px 28px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--navy-900); }
.btn-primary:hover { background: var(--amber-dark); transform: translateY(-2px); }
.btn-outline { border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); transform: translateY(-2px); }
.section--navy .btn-outline { border-color: rgba(245,242,234,0.35); color: var(--paper); }
.section--navy .btn-outline:hover { border-color: var(--paper); }
.btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ==========================================================================
   Header
   ========================================================================== */
.utility-bar {
  background: var(--ink);
  color: var(--steel-300);
  font-size: 13px;
}
.utility-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; padding-bottom: 8px;
}
.utility-bar__contact { display: flex; gap: 24px; }
.utility-bar__contact a { display: inline-flex; align-items: center; gap: 7px; }
.utility-bar__contact a:hover { color: var(--white); }
.utility-bar__social { display: flex; gap: 14px; }
.utility-bar__social a {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(245,242,234,0.25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: border-color .2s, background .2s;
}
.utility-bar__social a:hover { border-color: var(--amber); background: rgba(226,150,58,0.14); }

.site-header {
  position: sticky; top: 0; z-index: 500;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), padding .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(13,27,38,0.08); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
  transition: padding .3s var(--ease);
}
.site-header.is-scrolled .container { padding-top: 10px; padding-bottom: 10px; }
.brand img { height: 46px; width: auto; transition: height .3s var(--ease); }
.site-header.is-scrolled .brand img { height: 38px; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav__list { display: flex; gap: 30px; }
.main-nav__list a {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--navy-700);
  position: relative;
  padding: 6px 0;
}
.main-nav__list a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--amber);
  transition: width .25s var(--ease);
}
.main-nav__list a:hover::after,
.main-nav__list a.is-active::after { width: 100%; }
.main-nav__list a.is-active { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: none;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--ink);
  position: relative; transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { transform: rotate(45deg); top: 0; }
.nav-toggle.is-open span::after { transform: rotate(-45deg); top: 0; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: var(--navy-900);
  color: var(--paper);
  overflow: hidden;
  padding: 84px 0 0;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,22,32,0.2), var(--navy-900) 88%),
    repeating-linear-gradient(90deg, rgba(245,242,234,0.035) 0 1px, transparent 1px 96px);
  pointer-events: none;
}
.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero__copy { padding-bottom: 72px; }
.hero__eyebrow {
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 22px;
  display: block;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  max-width: 15ch;
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: normal;
  color: var(--amber);
}
.hero__desc {
  font-size: 17px;
  color: var(--steel-300);
  max-width: 46ch;
  margin-bottom: 36px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }
.hero__meta {
  display: flex; gap: 32px; flex-wrap: wrap;
  border-top: 1px solid rgba(245,242,234,0.14);
  padding-top: 24px;
}
.hero__meta-item strong {
  font-family: var(--font-display);
  font-size: 22px;
  display: block;
  color: var(--white);
}
.hero__meta-item span { font-size: 13px; color: var(--steel-300); }

.hero__gallery {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, minmax(120px, auto));
  gap: 18px;
  padding-bottom: 40px;
}
.hero__gallery figure {
  margin: 0;
  position: relative;
  background: var(--navy-700);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(245,242,234,0.1);
}
.hero__gallery figure.tall { grid-row: span 2; }
.hero__gallery img {
  width: 100%; height: 100%; object-fit: contain;
  background: var(--white);
  padding: 18px;
}
.hero__gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(10,22,32,0.92), transparent);
  color: var(--paper);
  font-size: 12.5px;
  font-family: var(--font-display);
  padding: 22px 14px 10px;
}

/* ==========================================================================
   Stats strip
   ========================================================================== */
.stats {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.stats .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stats__item {
  padding: 40px 28px;
  border-left: 1px solid var(--line);
}
.stats__item:first-child { border-left: none; padding-left: 0; }
.stats__item strong {
  font-family: var(--font-display);
  font-size: 40px;
  display: block;
  color: var(--navy-800);
}
.stats__item strong .unit { color: var(--amber-dark); font-size: 0.85em; }
.stats__item span { font-size: 14px; color: var(--steel-500); }

/* ==========================================================================
   About teaser
   ========================================================================== */
.about-split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
}
.about-split__visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-800);
  aspect-ratio: 4 / 5;
}
.about-split__visual img {
  width: 100%; height: 100%; object-fit: contain; padding: 32px;
}
.about-split__badge {
  position: absolute; bottom: 20px; left: 20px; right: 20px;
  background: rgba(10,22,32,0.85);
  color: var(--paper);
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border-left: 3px solid var(--amber);
}
.about-split__body p { margin-bottom: 18px; color: var(--navy-700); font-size: 16px; }
.about-split__body p:last-of-type { margin-bottom: 28px; }
.about-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0 8px;
}
.about-timeline__item {
  border-top: 2px solid var(--amber);
  padding-top: 12px;
}
.about-timeline__item h4 { font-size: 15px; margin-bottom: 6px; }
.about-timeline__item p { font-size: 13.5px; color: var(--steel-500); }

/* ==========================================================================
   Principals / brand grid
   ========================================================================== */
.principals-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.principals-grid a {
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 26px 18px;
  min-height: 100px;
  transition: background .2s var(--ease);
}
.principals-grid a:hover { background: var(--paper-dim); }
.principals-grid img { max-height: 40px; width: auto; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.principals-grid a:hover img { filter: grayscale(0); opacity: 1; }

/* ---------- Auto-scrolling brand marquee ---------- */
.brand-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.brand-marquee__track {
  display: flex;
  align-items: center;
  gap: 72px;
  width: max-content;
  animation: brand-marquee-scroll 32s linear infinite;
}
.brand-marquee:hover .brand-marquee__track { animation-play-state: paused; }
.brand-marquee__track img {
  height: 34px; width: auto;
  filter: grayscale(1);
  opacity: .8;
}
@keyframes brand-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-marquee__track { animation: none; }
}

/* ==========================================================================
   Featured products (editorial alternating rows)
   ========================================================================== */
.product-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.product-row:last-child { padding-bottom: 0; }
.product-row.reverse .product-row__media { order: 2; }
.product-row__media {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  padding: 36px;
}
.product-row__media img { max-height: 100%; object-fit: contain; }
.product-row__tag {
  font-family: var(--font-display);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-dark);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}
.product-row h3 { font-size: 26px; margin-bottom: 14px; }
.product-row p { color: var(--steel-500); font-size: 15.5px; margin-bottom: 22px; }
.product-row__link {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14.5px;
  display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 3px;
}

/* ==========================================================================
   Credibility (testimonials + memberships)
   ========================================================================== */
.credibility {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
}
.testimonial-card {
  background: var(--navy-800);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 44px;
  position: relative;
}
.testimonial-card .mark {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--amber);
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}
.testimonial-card blockquote {
  margin: 0 0 26px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--white);
}
.testimonial-card .cite strong { display: block; font-family: var(--font-display); }
.testimonial-card .cite span { font-size: 13.5px; color: var(--steel-300); }
.testimonial-nav { display: flex; gap: 10px; margin-top: 28px; }
.testimonial-nav button {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(245,242,234,0.3);
  background: transparent; color: var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.testimonial-nav button:hover { border-color: var(--amber); color: var(--amber); }

.credentials { display: flex; flex-direction: column; gap: 18px; }
.credential-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 3px solid var(--amber);
}
.credential-card p { font-size: 14.5px; color: var(--navy-700); margin-bottom: 10px; }
.credential-card span { font-size: 13px; color: var(--steel-500); font-family: var(--font-display); font-weight: 600; }

/* ==========================================================================
   News strip
   ========================================================================== */
.news-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.news-strip a { background: var(--white); padding: 28px 24px; display: block; }
.news-strip a:hover { background: var(--paper-dim); }
.news-strip .news-year {
  font-family: var(--font-display); color: var(--amber-dark); font-weight: 600;
  font-size: 13px; letter-spacing: .06em; display: block; margin-bottom: 10px;
}
.news-strip h4 { font-size: 16px; }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: var(--navy-900);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 56px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); max-width: 20ch; }
.cta-band__actions { display: flex; gap: 16px; flex-wrap: wrap; }
/* .cta-band is always dark regardless of its parent section's variant,
   so its outline buttons need the light-on-dark treatment unconditionally
   (not just inside .section--navy). */
.cta-band .btn-outline { border-color: rgba(245,242,234,0.35); color: var(--paper); }
.cta-band .btn-outline:hover { border-color: var(--paper); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--steel-300); padding: 72px 0 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(245,242,234,0.12);
}
.footer-brand img { height: 42px; margin-bottom: 18px; }
.footer-brand p { font-size: 14px; max-width: 34ch; color: var(--steel-300); }
.footer-col h5 {
  font-family: var(--font-display); color: var(--white); font-size: 14.5px;
  letter-spacing: .04em; margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 14px; }
.footer-col a:hover { color: var(--amber); }
.footer-contact li { display: flex; gap: 10px; font-size: 14px; margin-bottom: 14px; align-items: flex-start; }
.footer-contact li i { color: var(--amber); margin-top: 3px; }
.footer-bottom {
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13px;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(245,242,234,0.2);
  display: flex; align-items: center; justify-content: center;
}
.footer-social a:hover { border-color: var(--amber); color: var(--amber); }

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
/* Reveal is opt-in progressive enhancement: content is fully visible by
   default and only gets the fade-up treatment once JS confirms it can also
   guarantee the content will be shown (see main.js). This means a blocked
   or slow script (common on locked-down corporate networks), a Print/PDF
   render, or a fast programmatic scroll can never leave real content
   permanently invisible. */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
/* Must be at least as specific as the rule above (same "html.js-reveal"
   prefix) or the hidden state wins even after .is-visible is applied. */
html.js-reveal .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero__gallery { max-width: 560px; }
  .stats .container { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(3) { border-left: none; }
  .about-split { grid-template-columns: 1fr; }
  .about-split__visual { max-width: 420px; }
  .principals-grid { grid-template-columns: repeat(4, 1fr); }
  .credibility { grid-template-columns: 1fr; }
  .news-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .main-nav__list { display: none; }
  .nav-toggle { display: flex; }
  .site-header.nav-open .main-nav__list {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: 8px 32px 20px;
  }
  .site-header.nav-open .main-nav__list a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .product-row, .product-row.reverse { grid-template-columns: 1fr; }
  .product-row.reverse .product-row__media { order: 0; }
  .about-timeline { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .container { padding: 0 20px; }
  .stats .container { grid-template-columns: 1fr 1fr; }
  .principals-grid { grid-template-columns: repeat(3, 1fr); }
  .news-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .utility-bar__contact span.hide-mobile { display: none; }
}
