/* =========================================================
   ENGYL — Predictive Liquid Quality for Data Center Cooling
   Design system + components
   ========================================================= */

:root {
  /* Brand palette (from Glossy Droplet C) */
  --teal:      #29D4D9;   /* cooling */
  --teal-2:    #18A9C4;
  --cyan:      #1B8FD1;
  --amber:     #FF7A3C;   /* heat / energy */
  --red:       #EE4B4B;
  --chrome:    #CBD5E1;   /* industrial precision */

  /* Surfaces */
  --bg:        #05080F;   /* near-black navy — the data center */
  --bg-2:      #0A1120;
  --bg-3:      #0E1A2E;
  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border:    rgba(120, 170, 210, 0.16);
  --border-2:  rgba(120, 170, 210, 0.28);

  /* Ink */
  --ink:       #EAF2FB;
  --muted:     #9DB0C8;
  --muted-2:   #6F8198;

  /* Gradients */
  --grad-cool: linear-gradient(135deg, var(--teal) 0%, var(--cyan) 100%);
  --grad-heat: linear-gradient(135deg, var(--amber) 0%, var(--red) 100%);
  --grad-brand: linear-gradient(100deg, var(--teal) 0%, var(--cyan) 45%, var(--amber) 100%);

  /* Type */
  --font-head: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1180px;
  --nav-h: 74px;
  --radius: 16px;
  --radius-lg: 24px;

  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --glow-teal: 0 0 60px -10px rgba(41, 212, 217, 0.45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-head);
  font-size: .78rem; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--teal);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: var(--grad-cool);
}
.eyebrow.center-line { justify-content: center; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
h2.title { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: 1rem; }
.lead { color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.18rem); max-width: 60ch; }
.center .lead { margin-inline: auto; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: .85rem 1.6rem; border-radius: 100px; border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad-cool); color: #02131a;
  box-shadow: 0 10px 30px -8px rgba(41, 212, 217, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -8px rgba(41, 212, 217, 0.65); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); backdrop-filter: blur(6px); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--teal); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand img { height: 30px; width: auto; filter: drop-shadow(0 2px 10px rgba(41,212,217,.25)); }
.brand .name { font-family: var(--font-head); font-weight: 700; letter-spacing: .14em; font-size: 1.18rem; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: .95rem; color: var(--muted); transition: color .2s ease; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px;
  background: var(--grad-cool); border-radius: 2px;
}
.nav-cta { display: flex; align-items: center; gap: 1rem; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); width: 30px; height: 30px; }

/* ---------- Animated background ---------- */
.bg-mesh {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.bg-mesh .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.orb.teal  { width: 46vw; height: 46vw; background: radial-gradient(circle, var(--teal) 0%, transparent 65%); top: -12%; left: -10%; animation: drift1 18s ease-in-out infinite; }
.orb.cyan  { width: 40vw; height: 40vw; background: radial-gradient(circle, var(--cyan) 0%, transparent 65%); bottom: -18%; right: -8%; animation: drift2 22s ease-in-out infinite; }
.orb.amber { width: 30vw; height: 30vw; background: radial-gradient(circle, var(--amber) 0%, transparent 65%); top: 30%; right: 22%; opacity: .28; animation: drift3 26s ease-in-out infinite; }
@keyframes drift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(8%,6%)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-7%,-5%)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-6%,8%) scale(1.1)} }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding-top: var(--nav-h); overflow: hidden;
}
.hero-video, .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-poster { z-index: 0; }   /* gradient fallback sits BEHIND the video */
.hero-video  { z-index: 1; }   /* video plays on top of the fallback */
.hero-poster {
  background:
    radial-gradient(900px 600px at 78% 18%, rgba(255,122,60,.12), transparent 60%),
    radial-gradient(900px 700px at 18% 80%, rgba(41,212,217,.14), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--bg) 70%);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 2;   /* tint above video, below content */
  background:
    linear-gradient(180deg, rgba(5,8,15,.55) 0%, rgba(5,8,15,.35) 40%, rgba(5,8,15,.92) 100%),
    radial-gradient(1200px 700px at 50% 0%, transparent, rgba(5,8,15,.4));
}
.hero .wrap { position: relative; z-index: 3; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: 1.4rem; }
.hero p.sub { color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.3rem); max-width: 46ch; margin-bottom: 2.2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.badge-patent {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--surface); border: 1px solid var(--border-2);
  padding: .45rem .95rem; border-radius: 100px; font-size: .82rem; color: var(--muted);
  margin-bottom: 1.6rem; backdrop-filter: blur(6px);
}
.badge-patent .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* Hero droplet visual */
.hero-visual { display: flex; justify-content: center; position: relative; }
.droplet-stage { position: relative; width: min(360px, 70vw); aspect-ratio: 1; }
.droplet-stage img { position: relative; z-index: 2; width: 62%; margin: 0 auto; filter: drop-shadow(0 24px 50px rgba(0,0,0,.6)); animation: float 6s ease-in-out infinite; }
.droplet-stage .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--border-2); animation: spin 30s linear infinite;
}
.droplet-stage .ring::before {
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px;
  border-radius: 50%; background: var(--teal); box-shadow: 0 0 16px var(--teal); transform: translateX(-50%);
}
.droplet-stage .ring.r2 { inset: 14%; animation-duration: 22s; animation-direction: reverse; opacity: .6; }
.droplet-stage .glow {
  position: absolute; inset: 18%; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, rgba(41,212,217,.35), transparent 70%);
  filter: blur(30px); animation: pulse 5s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:.5; transform:scale(1)} 50%{opacity:.9; transform:scale(1.08)} }

/* ---------- Marquee / trust strip ---------- */
.strip { border-block: 1px solid var(--border); background: rgba(255,255,255,.02); }
.strip .wrap { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; justify-content: center; padding: 1.4rem 0; }
.strip span { color: var(--muted-2); font-family: var(--font-head); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; }
.strip .pill { color: var(--muted); border: 1px solid var(--border); padding: .4rem .9rem; border-radius: 100px; font-size: .82rem; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.9rem; position: relative; overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--surface-2); }
.card .ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  margin-bottom: 1.2rem; background: rgba(41,212,217,.12); border: 1px solid var(--border-2);
}
.card .ic svg { width: 26px; height: 26px; stroke: var(--teal); }
.card.heat .ic { background: rgba(255,122,60,.12); }
.card.heat .ic svg { stroke: var(--amber); }
.card h3 { font-size: 1.22rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; }
.card .num {
  font-family: var(--font-head); font-size: .85rem; font-weight: 700; color: var(--teal);
  border: 1px solid var(--border-2); border-radius: 8px; padding: .2rem .55rem; margin-bottom: 1.1rem; display: inline-block;
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.stat { text-align: center; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat .big { font-family: var(--font-head); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .92rem; margin-top: .3rem; }

/* ---------- Process / flow ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; position: relative; }
.flow .step { position: relative; }
.flow .step .ic { width: 56px; height: 56px; }
.flow .step::after {
  content: ""; position: absolute; top: 28px; right: -.5rem; width: 1rem; height: 2px;
  background: var(--grad-cool); opacity: .5;
}
.flow .step:last-child::after { display: none; }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split .visual {
  border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden;
  position: relative; aspect-ratio: 4/3; background: var(--bg-3);
}
.split .visual video, .split .visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.split .visual .fallback {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(500px 300px at 30% 30%, rgba(41,212,217,.2), transparent 60%),
    radial-gradient(400px 300px at 80% 80%, rgba(255,122,60,.16), transparent 60%),
    linear-gradient(140deg, var(--bg-2), var(--bg-3));
  display: grid; place-items: center;
}
/* Framed product / device image */
.device-shot {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-2); background: var(--bg-3);
  box-shadow: var(--shadow), 0 0 70px -30px rgba(41,212,217,.5);
}
.device-shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,8,15,0) 55%, rgba(5,8,15,.55) 100%);
}
.device-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-shot figcaption {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-size: .8rem; letter-spacing: .04em; color: var(--ink);
  background: rgba(5,8,15,.55); border: 1px solid var(--border); backdrop-filter: blur(8px);
  padding: .45rem .8rem; border-radius: 100px;
}
.device-shot figcaption::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 10px var(--teal);
  animation: pulse 2.4s ease-in-out infinite;
}
.hero-visual .device-shot { max-width: 380px; margin-inline: auto; aspect-ratio: 3/4; }
.split .device-shot { aspect-ratio: 4/5; }

.checklist li { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; color: var(--muted); }
.checklist li svg { width: 22px; height: 22px; stroke: var(--teal); flex-shrink: 0; margin-top: 2px; }
.checklist li b { color: var(--ink); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg); padding: clamp(2.5rem, 5vw, 4rem); text-align: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(41,212,217,.12), rgba(27,143,209,.08));
  border: 1px solid var(--border-2);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(600px 300px at 80% 20%, rgba(255,122,60,.18), transparent 60%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.cta-band .lead { margin: 0 auto 2rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer .brand img { height: 40px; }
.footer p.tag { color: var(--muted); margin-top: 1rem; max-width: 36ch; font-size: .95rem; }
.footer h4 { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 1.1rem; }
.footer a { color: var(--muted); font-size: .95rem; display: block; margin-bottom: .7rem; transition: color .2s; }
.footer a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted-2); font-size: .85rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ---------- Page hero (sub pages) ---------- */
.page-hero { position: relative; padding: calc(var(--nav-h) + 4rem) 0 3rem; overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 3; max-width: 760px; }
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); margin-bottom: 1.2rem; }

/* ---------- Inventor card ---------- */
.inventor { display: grid; grid-template-columns: auto 1fr; gap: 2.4rem; align-items: start; }
.inventor .avatar {
  width: 120px; height: 120px; border-radius: 24px; display: grid; place-items: center;
  background: var(--grad-cool); font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; color: #02131a;
  box-shadow: var(--glow-teal);
}
.inventor .avatar-photo {
  width: 210px; height: 255px; border-radius: 20px; object-fit: cover; object-position: top center;
  border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 60px -25px rgba(41,212,217,.55);
}
.inventor .role { color: var(--teal); font-family: var(--font-head); letter-spacing: .05em; margin-bottom: 1.1rem; }
.inventor .bio { color: var(--muted); max-width: 64ch; margin-bottom: 1rem; }
.inventor .bio b { color: var(--ink); font-weight: 600; }
.inventor .prev { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.4rem 0 1.1rem; }
.inventor .prev-label { font-family: var(--font-head); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-right: .2rem; }
.inventor .prev .pill { border: 1px solid var(--border); padding: .35rem .8rem; border-radius: 100px; font-size: .82rem; color: var(--muted); }
.inventor .tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.inventor .tags .tag { background: rgba(41,212,217,.09); border: 1px solid var(--border-2); padding: .35rem .8rem; border-radius: 100px; font-size: .82rem; color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow .step::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .inventor { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .nav-cta .btn-ghost { display: none; }

  /* Mobile menu open */
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(5,8,15,.97); backdrop-filter: blur(16px); padding: 1.5rem; gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
