/* ==========================================================================
   IEI — Intelligent Electronic Instruments
   Design tokens
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-dark: #0A0E14;
  --bg-darker: #070B10;
  --bg-light: #FAFBFD;
  --bg-tint: #F1F4F9;
  --ink: #0B1220;
  --ink-soft: #45505F;
  --ink-mute: #6B7686;
  --inverse: #F2F6FA;
  --inverse-soft: #A7B4C6;
  --inverse-mute: #93A1B5;
  --accent: #00D4FF;
  --accent-2: #0071E3;
  --accent-dark-text: #5EC8F0;
  --grad: linear-gradient(120deg, #00D4FF 0%, #0071E3 100%);
  --line-dark: rgba(255, 255, 255, 0.07);
  --line-light: rgba(11, 18, 32, 0.08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --radius: 22px;
  --nav-h: 68px;
}

/* Base ------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3, p, ul { margin: 0; }

::selection { background: rgba(0, 170, 255, 0.28); }

:focus-visible { outline: 2px solid #00A6E8; outline-offset: 3px; border-radius: 4px; }

section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.container {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}
.container.narrow { max-width: 800px; }

.skip-link {
  position: absolute; top: -48px; left: 16px; z-index: 200;
  background: #fff; color: var(--ink);
  padding: 10px 18px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* Type patterns ----------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(46px, 8.5vw, 96px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--inverse);
}

h2 {
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 0.45em;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 500;
  line-height: 1.5;
  color: #1D2735;
  margin-top: 14px;
}

.body-copy {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-top: 20px;
}

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  border-radius: 999px;
  padding: 16px 30px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn-small { padding: 10px 20px; font-size: 14px; }

.btn-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 26px rgba(0, 140, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0, 150, 255, 0.45); }

.btn-ghost {
  color: var(--inverse);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.45); }

.text-link {
  display: inline-block;
  font-weight: 600;
  font-size: 16px;
  color: var(--accent-2);
  text-decoration: none;
}
.text-link span { display: inline-block; transition: transform 0.25s ease; }
.text-link:hover { text-decoration: underline; }
.text-link:hover span { transform: translateX(5px); }

/* Navigation ---------------------------------------------------------------- */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(10, 14, 20, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom-color: var(--line-dark);
}

.nav-inner {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 40px;
  width: auto;
  filter: brightness(1.55) drop-shadow(0 0 12px rgba(130, 190, 255, 0.28));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
}
.nav-links a:not(.btn) {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--inverse-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:not(.btn):hover { color: #fff; }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 10px;
  width: 24px; height: 2px;
  background: var(--inverse);
  border-radius: 2px;
  transition: transform 0.3s ease, top 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 18px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px clamp(20px, 5vw, 48px) 26px;
    background: rgba(9, 13, 19, 0.96);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--line-dark);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 4px; font-size: 16px; }
  .nav-links .btn { margin-top: 12px; text-align: center; }
  .site-nav:has(.nav-links.open) { background: rgba(9, 13, 19, 0.96); }
}

/* Hero ----------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  background:
    radial-gradient(1100px 700px at 72% 18%, rgba(0, 113, 227, 0.30), transparent 62%),
    radial-gradient(900px 650px at 18% 85%, rgba(0, 212, 255, 0.13), transparent 60%),
    var(--bg-dark);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, black 25%, transparent 78%);
  pointer-events: none;
}

.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-inline: clamp(20px, 5vw, 48px);
  max-width: 980px;
}
.hero .eyebrow { color: var(--accent-dark-text); }
.hero-sub {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.55;
  color: var(--inverse-soft);
  max-width: 640px;
  margin: 26px auto 0;
}
.hero-cta {
  margin-top: 42px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent-dark-text);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  55% { transform: translateY(14px); opacity: 0.2; }
}

/* Stats band -------------------------------------------------------------- */

.stats {
  background: var(--bg-dark);
  border-top: 1px solid var(--line-dark);
  padding: 56px 0 62px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 24px;
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  color: #E8F4FF;
  white-space: nowrap;
}
.stat-num small {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--accent-dark-text);
}
.stat-label {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--inverse-mute);
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Sections ------------------------------------------------------------------- */

.section { padding: clamp(84px, 12vw, 150px) 0; }
.section-light { background: var(--bg-light); }
.section-tint { background: var(--bg-tint); }

/* Technology cards */

.card-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.card {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 26px 28px 32px; }
.card h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 10px; }
.card p { font-size: 15.5px; line-height: 1.68; color: var(--ink-soft); }

@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px rgba(11, 18, 32, 0.10); }
}
@media (max-width: 880px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* Vision band ---------------------------------------------------------------- */

.vision {
  background:
    linear-gradient(rgba(7, 11, 17, 0.60), rgba(7, 11, 17, 0.66)),
    url('../assets/img/vision.jpg') center / cover no-repeat;
  padding: clamp(110px, 16vw, 190px) 0;
  text-align: center;
}
.vision .eyebrow { color: var(--accent-dark-text); }
.vision h2 { color: #fff; max-width: 820px; margin-inline: auto; }
.vision p {
  color: #B9C6D8;
  font-size: clamp(16px, 2vw, 19px);
  max-width: 560px;
  margin: 10px auto 0;
}
@media (min-width: 1024px) {
  .vision { background-attachment: fixed, fixed; }
}

/* Products ---------------------------------------------------------------------- */

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
  margin-top: clamp(64px, 9vw, 110px);
}
.product-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 90, 200, 0.16);
}
.product.flip .product-media { order: 2; }
.product-copy h3 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}
.product-copy > p { font-size: 17px; line-height: 1.7; color: var(--ink-soft); }

.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 30px;
}
.chips li {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #005BB8;
  background: rgba(0, 113, 227, 0.07);
  border: 1px solid rgba(0, 113, 227, 0.22);
  white-space: nowrap;
}

@media (max-width: 920px) {
  .product { grid-template-columns: 1fr; gap: 34px; }
  .product.flip .product-media { order: 0; }
}

/* Applications --------------------------------------------------------------- */

.app-grid {
  list-style: none;
  padding: 0;
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.app-grid li {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 16px;
  padding: 19px 22px;
}
.app-grid svg { width: 27px; height: 27px; color: var(--accent-2); flex-shrink: 0; }
.app-grid span { font-size: 15px; font-weight: 500; color: #2A3546; }

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

/* Contact ----------------------------------------------------------------------- */

.contact {
  background:
    radial-gradient(900px 550px at 78% 8%, rgba(0, 113, 227, 0.22), transparent 60%),
    radial-gradient(700px 500px at 12% 95%, rgba(0, 212, 255, 0.10), transparent 60%),
    var(--bg-dark);
  text-align: center;
}
.contact .eyebrow { color: var(--accent-dark-text); }
.contact h2 { color: var(--inverse); }
.contact-sub { color: var(--inverse-soft); font-size: clamp(16px, 2vw, 19px); max-width: 540px; margin: 8px auto 0; }

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 52px;
}
.contact-card {
  display: block;
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  padding: 30px 32px;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 200, 240, 0.5);
  background: rgba(255, 255, 255, 0.07);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--inverse-mute);
  margin-bottom: 10px;
}
.contact-value {
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.8vw, 18px);
  color: #E8F4FF;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .contact-cards { grid-template-columns: 1fr; }
}

/* Footer -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-darker);
  padding: 58px 0 44px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
}
.footer-brand img {
  height: 32px; width: auto;
  filter: brightness(1.55) drop-shadow(0 0 10px rgba(130, 190, 255, 0.22));
  margin-bottom: 14px;
}
.footer-brand p { font-size: 14.5px; color: var(--inverse-mute); max-width: 320px; }
.footer-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-nav a {
  font-size: 14px;
  color: var(--inverse-soft);
  text-decoration: none;
}
.footer-nav a:hover { color: #fff; }
.footer-legal {
  grid-column: 1 / -1;
  font-size: 13px;
  color: #5C6878;
  border-top: 1px solid var(--line-dark);
  padding-top: 24px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* Scroll reveal ------------------------------------------------------------------ */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
  transition-delay: var(--d, 0s);
}

/* Reduced motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { display: none; }
  .vision { background-attachment: scroll, scroll; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
