/* ==========================================================================
   CoolFlow Radiator & Cooling — shared stylesheet
   Palette: ice blue + steel gray + white. Display: Space Grotesk. Mono: JetBrains Mono.
   ========================================================================== */

:root{
  /* -- core palette -- */
  --white:        #ffffff;
  --ice-50:       #f4f9ff;
  --ice-100:      #e6f1ff;
  --ice-200:      #cfe6ff;
  --ice-300:      #a9d2ff;
  --blue-400:     #6aa8ff;
  --blue-500:     #3d82f6;
  --blue-600:     #2563eb;
  --blue-700:     #1d4ed8;

  --steel-900:    #0a0f1a;
  --steel-850:    #0d1424;
  --steel-800:    #121b2e;
  --steel-700:    #1a2438;
  --steel-600:    #263250;
  --steel-500:    #3c4b6c;
  --steel-400:    #5b6c8f;
  --steel-300:    #8797b8;
  --steel-200:    #b9c4dc;

  --text-dark:    #0a0f1a;
  --text-body:    #2c374d;
  --text-muted:   #5b6c8f;
  --text-light:   #eef4ff;
  --text-light-muted: #9db1d8;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --max-w: 1240px;

  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;

  --ease: cubic-bezier(.22,.9,.28,1);
}

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

html, body{
  overflow-x: clip;
  max-width: 100%;
}

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--white);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a{ color: inherit; text-decoration: none; }

h1, h2, h3, h4{
  font-family: var(--font-display);
  color: var(--text-dark);
  margin: 0 0 .5em;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1{ font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 600; }
h2{ font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 600; }
h3{ font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; }

p{ margin: 0 0 1em; }

.mono{
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin-bottom: 1.1em;
}
.eyebrow::before{
  content: '';
  width: 22px;
  height: 1px;
  background: var(--blue-600);
  display: inline-block;
}

.container{
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

section{ position: relative; }

.section-pad{ padding: clamp(64px, 10vw, 128px) 0; }

/* -------------------- buttons -------------------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .98rem;
  padding: .95em 1.7em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
  white-space: nowrap;
}
.btn-primary{
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: var(--white);
  box-shadow: 0 8px 24px -8px rgba(37,99,235,.55);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 14px 32px -10px rgba(37,99,235,.65); }

.btn-ghost{
  background: transparent;
  color: var(--text-dark);
  border-color: var(--steel-200);
}
.btn-ghost:hover{ border-color: var(--blue-500); color: var(--blue-600); transform: translateY(-2px); }

.btn-ghost-dark{
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255,255,255,.25);
}
.btn-ghost-dark:hover{ border-color: var(--blue-400); color: var(--blue-300); transform: translateY(-2px); }

.btn-lg{ padding: 1.1em 2.1em; font-size: 1.05rem; }

/* -------------------- nav -------------------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(10,15,26,.07);
}
.nav-wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 48px);
  max-width: var(--max-w);
  margin: 0 auto;
}
.brand{
  display: flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text-dark);
}
.brand .brand-mark{
  width: 30px; height: 30px;
  flex-shrink: 0;
}
.brand-sub{
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
  font-weight: 500;
}
.brand-text{ display:flex; flex-direction:column; line-height:1.1; }

.nav-links{
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  font-size: .93rem;
  font-weight: 500;
}
.nav-links a{
  position: relative;
  padding: 6px 0;
  color: var(--text-body);
  transition: color .25s var(--ease);
}
.nav-links a::after{
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0%; height: 2px;
  background: var(--blue-500);
  transition: width .3s var(--ease);
}
.nav-links a:hover{ color: var(--text-dark); }
.nav-links a:hover::after{ width: 100%; }
.nav-links a.active{ color: var(--blue-600); }
.nav-links a.active::after{ width: 100%; }

/* .nav-links a's descendant selector otherwise outranks .btn-primary's own color rule by
   specificity (0,1,1 vs 0,1,0) and leaves the pill CTA rendering low-contrast dark text on a
   blue background — restate white explicitly and drop the plain-link underline affordance. */
.nav-links a.btn-primary{ color: var(--white); }
.nav-links a.btn-primary::after{ display: none; }

.nav-cta{ display:flex; align-items:center; gap: 14px; }
.nav-phone{
  display:flex; align-items:center; gap:.5em;
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--text-dark);
}
.nav-toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span{
  width: 22px; height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2){ opacity: 0; }
.nav-toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.mobile-cta{ display: none; }

/* -------------------- footer -------------------- */
.site-footer{
  background: var(--steel-900);
  color: var(--text-light-muted);
  padding: 72px 0 28px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.footer-brand{
  display: flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 14px;
}
.footer-brand .brand-mark{ width: 26px; height: 26px; }
.footer-col h4{
  color: var(--text-light);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: 16px;
}
.footer-col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a{ color: var(--text-light-muted); transition: color .25s var(--ease); font-size: .92rem; }
.footer-col a:hover{ color: var(--blue-300); }
.footer-bottom{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  font-size: .8rem;
  font-family: var(--font-mono);
  color: var(--steel-400);
}
.footer-bottom a{ color: var(--steel-300); }
.footer-bottom a:hover{ color: var(--blue-300); }

/* -------------------- flow line motif (signature) -------------------- */
.flow-line-svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.flow-path{
  fill: none;
  stroke: url(#flowGradient);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(61,130,246,.5));
}
.flow-pulse{
  fill: var(--white);
  filter: drop-shadow(0 0 8px rgba(109,168,255,.9));
}

/* -------------------- scroll reveal (IntersectionObserver + CSS transition) --------------------
   Deliberately NOT GSAP-tweened: an IntersectionObserver toggles a class and a plain CSS
   transition does the animating, so reveals resolve to a visible end state even if the page's
   JS never runs, an observer callback fires late, or (as with the hero) a backgrounded tab
   throttles requestAnimationFrame. Content is never left permanently invisible. */
/* Default: fully visible. Only once an early inline script confirms JS is running does the
   .js class go on <html> and hide elements pending their IntersectionObserver reveal — so a
   no-JS visitor (or a script that errors before this point) always sees full content. */
.js [data-reveal]{
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce){
  .js [data-reveal]{ transition: none; opacity: 1; transform: none; }
}

/* -------------------- hero entrance (CSS-only, deliberately not GSAP) --------------------
   The hero is above-the-fold and must never depend on requestAnimationFrame actually ticking
   on load — browsers throttle rAF for backgrounded/unfocused tabs, which can leave a JS-driven
   opacity:0 "from" state stuck indefinitely. A CSS keyframe animation always resolves to its
   "to" state (or is simply skipped under reduced-motion), so content is guaranteed visible. */
@keyframes hero-fade-up{
  from{ opacity: 0; transform: translateY(16px); }
  to{ opacity: 1; transform: translateY(0); }
}
.hero-copy .eyebrow, .hero-copy h1, .hero-copy .lead, .hero-ctas, .hero-media{
  animation: hero-fade-up .8s var(--ease) both;
}
.hero-copy h1{ animation-delay: .08s; }
.hero-copy .lead{ animation-delay: .16s; }
.hero-ctas{ animation-delay: .24s; }
.hero-media{ animation-delay: .3s; }

@media (prefers-reduced-motion: reduce){
  .hero-copy .eyebrow, .hero-copy h1, .hero-copy .lead, .hero-ctas, .hero-media{ animation: none; }
}

.card-grid{
  display: grid;
  gap: 24px;
}

.tag-pill{
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .4em .9em;
  border-radius: 999px;
  border: 1px solid var(--steel-200);
  color: var(--text-muted);
}

hr.divider{
  border: none;
  border-top: 1px solid var(--steel-200);
  margin: 0;
}

/* -------------------- responsive nav -------------------- */
@media (max-width: 880px){
  .nav-links{
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 28px clamp(20px,6vw,40px);
    gap: 22px;
    font-size: 1.05rem;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav-links.open{ transform: translateX(0); }
  .nav-toggle{ display: flex; }
  .nav-phone{ display: none; }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
  .mobile-cta{ display: inline-flex; margin-top: 8px; }
}

@media (max-width: 480px){
  /* Header CTA pill collides with the wrapping two-line brand lockup at very narrow widths —
     drop it from the bar and rely on the equivalent .mobile-cta inside the open nav panel. */
  .nav-cta > a.btn-primary{ display: none; }
}

@media (max-width: 560px){
  .footer-grid{ grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom{ flex-direction: column; align-items: flex-start; }
}
