/* ============================================================================
 * COSMOS · Marketing site — shared styles
 * Built on the COSMOS design tokens (cobalt #1D4ED8 + slate, Inter / JetBrains Mono).
 * Dark navy = cobalt-950/900 for cinematic sections; light = white / slate-50.
 * ==========================================================================*/

:root{
  --navy-950:#020617;        /* cobalt-950 */
  --navy-900:#0B1220;        /* tuned deep navy */
  --navy-850:#0F172A;        /* cobalt-900 / slate-900 */
  --navy-800:#172033;
  --cobalt:#1D4ED8;
  --cobalt-400:#60A5FA;
  --cobalt-300:#93C5FD;
  --maxw:1200px;
  --nav-h:68px;
  --ease-out:cubic-bezier(.2,.7,.3,1);
  --ease-spring:cubic-bezier(.34,1.4,.5,1);
}

html{ scroll-behavior:smooth; }
body{ background:var(--color-page); color:var(--color-fg); font-family:var(--font-sans); -webkit-font-smoothing:antialiased; }
body.intro-lock{ overflow:hidden; }
::selection{ background:var(--cobalt); color:#fff; }
::-webkit-scrollbar{ width:11px; height:11px; }
::-webkit-scrollbar-thumb{ background:var(--color-line); border-radius:99px; border:3px solid var(--color-page); }
a{ color:inherit; text-decoration:none; }
img,svg{ display:block; }

.container{ width:100%; max-width:var(--maxw); margin-inline:auto; padding-inline:24px; }
.eyebrow{ font-family:var(--font-mono); font-size:12px; font-weight:600; letter-spacing:.18em; text-transform:uppercase; color:var(--cobalt); }
.eyebrow.on-dark{ color:var(--cobalt-300); }

/* ── display type ── */
.display{ font-weight:700; letter-spacing:-.025em; line-height:1.04; text-wrap:balance; }
.h-hero{ font-size:clamp(40px,6.4vw,76px); }
.h-1{ font-size:clamp(34px,4.6vw,54px); }
.h-2{ font-size:clamp(26px,3vw,38px); }
.lede{ font-size:clamp(17px,1.5vw,20px); line-height:1.55; color:var(--color-fg-muted); text-wrap:pretty; }
.lede.on-dark{ color:#9FB0CC; }

/* ════════════════ NAV ════════════════ */
.nav{ position:sticky; top:0; z-index:50; height:var(--nav-h);
  background:color-mix(in srgb, var(--color-surface) 78%, transparent);
  backdrop-filter:saturate(1.4) blur(14px); -webkit-backdrop-filter:saturate(1.4) blur(14px);
  border-bottom:1px solid transparent; transition:border-color .3s ease, background .3s ease; }
.nav.scrolled{ border-bottom-color:var(--color-line-subtle); }
.nav-inner{ height:100%; display:flex; align-items:center; gap:32px; }
.nav-brand{ display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px; letter-spacing:-.01em; }
.nav-brand .mark{ width:30px; height:30px; border-radius:9px; flex:none; }
.nav-links{ display:flex; align-items:center; gap:4px; margin-left:8px; }
.nav-links a{ padding:8px 13px; border-radius:9px; font-size:14px; font-weight:500; color:var(--color-fg-muted); transition:background .15s, color .15s; }
.nav-links a:hover{ background:var(--color-subtle); color:var(--color-fg); }
.nav-links a.active{ color:var(--color-fg); }

/* products mega-dropdown */
.nav-item{ position:relative; display:flex; align-items:center; }
.nav-item > a{ display:inline-flex; align-items:center; gap:5px; }
.nav-item .cv{ width:13px; height:13px; opacity:.7; transition:transform .2s ease; }
.nav-item:hover .cv{ transform:rotate(180deg); }
.nav-dd{ position:absolute; top:100%; left:0; transform:translateY(8px);
  padding-top:12px; opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .18s ease, transform .22s var(--ease-out), visibility .18s; z-index:60; }
.nav-item:hover .nav-dd, .nav-item:focus-within .nav-dd{ opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0); }
.nav-dd-inner{ display:grid; grid-template-columns:1fr 1fr; gap:8px; width:640px;
  padding:8px; background:var(--color-surface); border:1px solid var(--color-line);
  border-radius:18px; box-shadow:var(--shadow-xl); }
.dd-sec{ padding:15px 14px 13px; border-radius:13px; }
.dd-sec.alt{ background:var(--color-subtle); }
.dd-head{ display:flex; align-items:center; gap:9px; white-space:nowrap; font-size:14.5px; font-weight:700; color:var(--color-fg); margin:2px 0 13px; padding-left:4px; }
.dd-ver{ font-family:var(--font-mono); font-size:11px; font-weight:700; color:var(--color-brand-fg); background:var(--color-brand-subtle); padding:2px 7px; border-radius:99px; }
.dd-soon{ font-family:var(--font-sans); font-size:10px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; white-space:nowrap; color:var(--color-fg-faint); background:var(--color-muted); padding:3px 8px; border-radius:99px; margin-left:auto; }
.dd-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:1px; }
.dd-list a, .dd-list > li > span{ display:flex; align-items:center; gap:11px; padding:8px 9px; border-radius:10px; text-decoration:none; }
.dd-list a{ transition:background .14s ease; }
.dd-list a:hover{ background:var(--color-subtle); }
.dd-list .di{ width:34px; height:34px; flex:none; border-radius:9px; display:flex; align-items:center; justify-content:center; background:var(--color-brand-subtle); color:var(--cobalt); }
.dd-list .di svg{ width:17px; height:17px; }
.dd-list b{ display:block; font-size:13.5px; font-weight:600; white-space:nowrap; color:var(--color-fg); letter-spacing:-.01em; }
.dd-list em{ display:block; font-size:11.5px; font-style:normal; color:var(--color-fg-subtle); margin-top:1px; }
.dd-list.muted > li > span{ cursor:default; }
.dd-list.muted .di{ background:var(--color-muted); color:var(--color-fg-faint); }
.dd-list.muted b, .dd-list.muted em{ color:var(--color-fg-faint); }
/* CPLOS wordmark — CPL is 3/4 the size of OS */
.cplos{ font-weight:700; letter-spacing:.01em; }
.cplos .cpl{ font-size:0.74em; }
.nav-cta{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.nav-burger{ display:none; margin-left:auto; width:42px; height:42px; border:1px solid var(--color-line); border-radius:10px; background:var(--color-surface); align-items:center; justify-content:center; cursor:pointer; }
.nav-burger svg{ width:20px; height:20px; stroke:var(--color-fg); }

/* mobile dropdown menu */
.mobile-menu{ display:none; flex-direction:column; gap:2px; padding:12px 24px 20px;
  background:var(--color-surface); border-bottom:1px solid var(--color-line-subtle); box-shadow:var(--shadow-lg); }
.mobile-menu.open{ display:flex; }
.mobile-menu a{ padding:12px 8px; border-radius:9px; font-size:15px; font-weight:500; color:var(--color-fg-muted); }
.mobile-menu a:hover{ background:var(--color-subtle); color:var(--color-fg); }
.mobile-menu a.btn{ color:#fff; justify-content:center; }

/* ── buttons ── */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; height:42px; padding:0 18px;
  border-radius:11px; font-size:14px; font-weight:600; cursor:pointer; border:1px solid transparent;
  transition:transform .12s var(--ease-out), background .15s, border-color .15s, box-shadow .2s, color .15s; white-space:nowrap; }
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--cobalt); color:#fff; box-shadow:0 8px 20px -8px rgba(29,78,216,.6); }
.btn-primary:hover{ background:var(--color-brand-hover); box-shadow:0 12px 26px -8px rgba(29,78,216,.7); }
.btn-ghost{ background:var(--color-surface); color:var(--color-fg); border-color:var(--color-line); }
.btn-ghost:hover{ background:var(--color-subtle); border-color:var(--color-line-strong); }
.btn-dark{ background:rgba(255,255,255,.07); color:#fff; border-color:rgba(255,255,255,.16); }
.btn-dark:hover{ background:rgba(255,255,255,.13); }
.btn-lg{ height:50px; padding:0 24px; font-size:15px; border-radius:13px; }
.btn-link{ display:inline-flex; align-items:center; gap:7px; font-weight:600; color:var(--cobalt); font-size:14px; }
.btn-link svg{ width:16px; height:16px; transition:transform .2s var(--ease-out); }
.btn-link:hover svg{ transform:translateX(3px); }

/* ════════════════ SECTIONS ════════════════ */
.section{ padding:clamp(64px,9vw,120px) 0; }
.section-sm{ padding:clamp(48px,6vw,80px) 0; }
.dark-section{ background:var(--navy-900); color:#E8EEF9; position:relative; overflow:hidden; }
.dark-section .lede{ color:#9FB0CC; }
.section-head{ max-width:720px; }
.section-head .eyebrow{ margin-bottom:14px; }
.section-head .h-1, .section-head .h-2{ margin:0 0 16px; }
.center{ text-align:center; margin-inline:auto; }

/* starfield + galaxy glow backdrops */
.starfield{ position:absolute; inset:0; pointer-events:none; }
.glow{ position:absolute; border-radius:50%; filter:blur(80px); opacity:.5; pointer-events:none; }
.glow-cobalt{ background:radial-gradient(circle, rgba(29,78,216,.55), transparent 70%); }
.glow-sky{ background:radial-gradient(circle, rgba(56,189,248,.4), transparent 70%); }

/* ── cards ── */
.card{ background:var(--color-surface); border:1px solid var(--color-line-subtle); border-radius:16px; padding:26px;
  transition:transform .25s var(--ease-out), box-shadow .25s, border-color .25s; }
.card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-lg); border-color:var(--color-line); }
.card-icon{ width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--color-brand-subtle); color:var(--cobalt); margin-bottom:18px; }
.card-icon svg{ width:23px; height:23px; }
.card h3{ font-size:18px; font-weight:650; margin:0 0 8px; letter-spacing:-.01em; }
.card p{ font-size:14.5px; line-height:1.6; color:var(--color-fg-muted); margin:0; }

.card-dark{ background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.09); }
.card-dark:hover{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.16); box-shadow:none; }
.card-dark h3{ color:#fff; }
.card-dark p{ color:#9FB0CC; }
.card-dark .card-icon{ background:rgba(96,165,250,.14); color:var(--cobalt-300); }

.grid{ display:grid; gap:22px; }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-2{ grid-template-columns:repeat(2,1fr); }
.grid-4{ grid-template-columns:repeat(4,1fr); }

.pill{ display:inline-flex; align-items:center; gap:7px; height:30px; padding:0 13px; border-radius:99px; white-space:nowrap;
  font-size:12.5px; font-weight:600; background:var(--color-brand-subtle); color:var(--color-brand-fg); border:1px solid var(--color-brand-tinted); }
.pill .dot{ width:7px; height:7px; border-radius:99px; background:var(--cobalt); }
.pill.on-dark{ background:rgba(96,165,250,.12); color:var(--cobalt-300); border-color:rgba(96,165,250,.25); }

/* ── footer ── */
.footer{ background:var(--navy-950); color:#9FB0CC; padding:72px 0 36px; }
.footer-top{ display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:40px; padding-bottom:48px; border-bottom:1px solid rgba(255,255,255,.08); }
.footer-brand .nav-brand{ color:#fff; margin-bottom:14px; }
.footer-brand p{ font-size:14px; line-height:1.6; max-width:280px; margin:0; }
.footer h4{ color:#fff; font-size:13px; font-weight:600; letter-spacing:.04em; margin:0 0 16px; }
.footer ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px; }
.footer ul a{ font-size:14px; color:#9FB0CC; transition:color .15s; }
.footer ul a:hover{ color:#fff; }
.footer-bottom{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:28px; font-size:13px; }
.footer-bottom .social{ display:flex; gap:14px; }
.footer-bottom .social a{ color:#64748B; transition:color .15s; }
.footer-bottom .social a:hover{ color:#fff; }

/* ════════════════ SCROLL REVEAL ════════════════ */
/* hidden state only applies once JS confirms it can animate (html.js) —
   so a JS failure leaves all content visible rather than blank. */
.reveal{ transition:opacity .7s var(--ease-out), transform .7s var(--ease-out); }
html.js .reveal{ opacity:0; transform:translateY(22px); }
html.js .reveal.in{ opacity:1; transform:none; }
/* safety lock: JS adds .shown via setTimeout after the transition window.
   Timers fire even if the animation timeline is throttled, so this guarantees
   the content paints to its visible state regardless of transition state. */
html.js .reveal.shown{ opacity:1 !important; transform:none !important; transition:none !important; }
.reveal-d1{ transition-delay:.08s; } .reveal-d2{ transition-delay:.16s; } .reveal-d3{ transition-delay:.24s; }
.reveal-d4{ transition-delay:.32s; } .reveal-d5{ transition-delay:.4s; } .reveal-d6{ transition-delay:.48s; }

/* ════════════════ RESPONSIVE ════════════════ */
@media (max-width:960px){
  .grid-3,.grid-4{ grid-template-columns:repeat(2,1fr); }
  .footer-top{ grid-template-columns:1fr 1fr; }
}
@media (max-width:720px){
  .nav-links{ display:none; }
  .nav-burger{ display:flex; }
  .nav-cta .btn-ghost{ display:none; }
  .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; }
  .footer-top{ grid-template-columns:1fr 1fr; gap:28px; }
}

/* ── nav logo: scroll-scrubbed melt (long lockup → five-dot mark) ──
   The melt geometry + fit (width, viewBox, transforms) is driven entirely
   by the nav scroll handler in site.js. This just holds the clip box. */
.cosmos-brand--melt{ position:relative; z-index:5; }
/* Tall box (set in JS) so the mark + stroke tips are never clipped; the clip
   only trims the receding wordmark on the right (width tracks content live). */
.cosmos-brand--melt .cb-clip{ display:block; overflow:hidden; }
.cosmos-brand--melt .melt-logo{ display:block; }
.cosmos-brand--melt .nmk,
.cosmos-brand--melt .blg{ will-change:transform; }

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