/* Strand template, rebuilt from the Figma file (Design page).
   Tokens are the file's own variables, named as in Figma. */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #edeff7;
  --bg-tertiary: #e3e7f2;
  --surface-primary: #ffffff;
  --surface-secondary: #edeff7;
  --surface-subtle: #f5f7fc;
  --border-primary: #d3d6e0;
  --border-secondary: #bcbfcc;
  --text-primary: #001441;
  --text-secondary: #6e7180;
  --text-tertiary: #9da2b3;
  --text-disabled: #bcbfcc;
  --btn-primary-bg: #001441;
  --btn-primary-fg: #ffffff;
  --btn-ghost-fg: #001441;
  --btn-light-bg: #edeff7;
  --green: #10b981;
  --blue: #22a7ff;
  --yellow: #f9ab00;
  --red: #e5484d;
  --red-20: #e5484d33;

  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-display: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --container: 1400px;
}
/* Cetacean Blue scope: the header and the hero. */
.dark {
  --bg-primary: #001441;
  --bg-secondary: #0a2560;
  --bg-tertiary: #16305f;
  --surface-primary: #0a2560;
  --surface-secondary: #16305f;
  --surface-subtle: #031a4f;
  --border-primary: #16305f;
  --border-secondary: #2a4a85;
  --text-primary: #ffffff;
  --text-secondary: #9da2b3;
  --text-tertiary: #6e7180;
  --text-disabled: #4a5068;
  --btn-primary-bg: #ffffff;
  --btn-primary-fg: #001441;
  --btn-ghost-fg: #ffffff;
  --btn-light-bg: #16305f;
  background: var(--bg-primary);
  color: var(--text-primary);
}
/* Monochrome icons are inked navy for the light page; inside .dark they flip to white. */
.dark img[src$=".svg"]:not([src*="logo-coinsec"]) { filter: brightness(0) invert(1); }
/* The particle scenes draw white light; on the light page they are inverted to ink. */
.three-canvas, .three > img { filter: invert(1); }
.dark .three-canvas, .dark .three > img { filter: none; }

/* ---- section backgrounds ----
   Rhythm: navy opener (header + hero), light sections with the brand's white-to-sky
   washes placed behind focal elements, a navy testimonial mid-page, and a navy close
   (CTA + footer) so the page is bookended in Cetacean Blue. */
:root { --sky: #d6efff; --sky-soft: #ecf7ff; }
main.frame > section { background: #ffffff; }
/* On inner pages the first section carries a soft sky wash down from the navy header. */
main.frame > section:first-of-type { background: linear-gradient(180deg, var(--sky-soft) 0%, #ffffff 100%); }

/* Full-bleed sections paint edge to edge, over the frame's hairlines. */
main.frame > section.bleed { position: relative; z-index: 2; background: transparent; }
main.frame > section.bleed::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1; background: var(--bleed-bg, var(--bg-primary)); }

/* Navy close: the CTA burst keeps its white light, with a Bayside glow behind it. */
.site-footer.dark .cta-band { background: radial-gradient(ellipse 45% 70% at 50% 50%, rgba(34, 167, 255, .22) 0%, rgba(34, 167, 255, 0) 70%); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #ffffff; overflow-x: clip; } /* full-bleed sections are 100vw wide; clip, not hidden, so sticky keeps working */
body {
  margin: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
b, strong { font-weight: 500; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---- type styles (Figma text styles) ---- */
.display-h1 { font-family: var(--font-display); font-weight: 500; font-size: 72px; line-height: 76px; letter-spacing: -.03em; }
.display-h2 { font-family: var(--font-display); font-weight: 500; font-size: 60px; line-height: 64px; letter-spacing: -.03em; }
.display-h3 { font-family: var(--font-display); font-weight: 500; font-size: 48px; line-height: 52px; letter-spacing: -.03em; }
.h2-xl { font-weight: 500; font-size: 32px; line-height: 34px; letter-spacing: -.32px; }
.h3-md { font-weight: 500; font-size: 18px; line-height: 24px; }
.h3-sm { font-weight: 500; font-size: 16px; line-height: 20px; }
.body-20 { font-size: 20px; line-height: 28px; }
.body-16 { font-size: 16px; line-height: 24px; }
.body-14 { font-size: 14px; line-height: 20px; }
.body-12 { font-size: 12px; line-height: 16px; }
.label-14 { font-weight: 500; font-size: 14px; line-height: 20px; }
.label-12 { font-weight: 500; font-size: 12px; line-height: 16px; }
.label-11 { font-weight: 500; font-size: 11px; line-height: 15px; }
.mono-12 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; line-height: 16px; }
.mono-11 { font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 15px; }
.t-primary { color: var(--text-primary); }
.t-secondary { color: var(--text-secondary); }
.t-tertiary { color: var(--text-tertiary); }

/* ---- layout frame: a 1400px column with hairline side borders ---- */
.frame {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}
/* Live: hairlines drawn over the edges (no width); 64px side margins from 1200-1400px; none below 1200. */
.frame::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-left: 1px solid var(--border-primary); border-right: 1px solid var(--border-primary); z-index: 1; }
@media (max-width: 1528px) and (min-width: 1200px) { .frame { max-width: calc(100% - 128px); } }
@media (max-width: 1199px) { .frame::before { display: none; } }
/* Live: a chromatic-aberration blur strip fixed along the bottom of the window (not on phones). */
.rule-b { border-bottom: 1px solid var(--border-primary); }
.rule-t { border-top: 1px solid var(--border-primary); }

/* ---- buttons ("Synapse - Buttons") ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 40px; padding: 0 12px; border-radius: 8px;
  font-weight: 500; font-size: 14px; line-height: 20px; white-space: nowrap;
  transition: background-color .2s, opacity .2s;
}
.btn > span { padding: 0 4px; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: #0a2560; }
.btn-secondary { background: var(--bg-secondary); color: var(--btn-ghost-fg); border: 1px solid var(--border-primary); }
.btn-secondary:hover { background: var(--bg-tertiary); }
.btn-ghost { height: 36px; padding: 0 10px; color: var(--btn-ghost-fg); }
.btn-ghost:hover { background: var(--bg-secondary); }
.btn-sm { height: 36px; padding: 0 10px; }
.btn-md { height: 32px; padding: 0 8px; gap: 2px; }
.pill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 6px; border-radius: 999px; background: var(--btn-light-bg);
}
.pill-icon img { width: 14px; height: 14px; }
.more { display: inline-flex; align-items: center; gap: 12px; color: var(--text-secondary); font-weight: 500; font-size: 14px; line-height: 20px; }
.more:hover { color: var(--text-primary); }
.more:hover .pill-icon { background: var(--border-secondary); }

/* ---- header ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); }
/* The header is 80px at the top of the page and 56px once scrolled (site.js sets .at-top on body) */
:root { --header-h: 56px; }
.at-top { --header-h: 80px; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) - 1px); padding: 0 40px; transition: height .25s ease; }
.site-header .left { display: flex; align-items: center; gap: 64px; }
/* The logo sits larger while the page is at the top (the hero) and settles to its regular size once scrolled (site.js). */
.site-header .left > a > img { width: auto; height: 24px; transition: height .25s ease; }
.at-top .site-header .left > a > img { height: 32px; }
@media (prefers-reduced-motion: reduce) { .site-header .left > a > img { transition: none; } }
.site-header nav { display: flex; gap: 2px; }
.site-header nav .btn-ghost img { width: 16px; height: 16px; }
.menu-toggle { display: none; }

/* Header dropdowns (live site: Features / Resources) */
.site-header nav { position: relative; }
.nav-item { position: static; }
.nav-item:hover > .btn-ghost, .nav-item:focus-within > .btn-ghost, .nav-item.open > .btn-ghost { background: var(--bg-tertiary); }
.nav-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 60;
  display: flex; background: var(--surface-subtle); border: 1px solid var(--border-primary); border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .05);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s ease .12s, transform .18s ease .12s, visibility 0s .3s;
}
/* Invisible bridge so the pointer can cross the 6px gap into the panel. */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-item:hover > .nav-menu, .nav-item:focus-within > .nav-menu, .nav-item.open > .nav-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .18s ease; }
.nav-menu b { display: block; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-primary); }
.nav-menu small { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.nav-menu a { border-radius: 8px; transition: background-color .15s; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--bg-secondary); outline: none; }
.menu-features { padding: 4px; }
.menu-features a { width: 175px; display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.menu-features a span { display: flex; flex-direction: column; gap: 4px; }
.menu-products a { width: auto; min-width: 200px; }
.menu-products small { white-space: nowrap; }
.menu-resources .col { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.menu-resources .col:first-child { width: 299px; }
.menu-resources .links { width: 150px; gap: 0; border-left: 1px solid var(--border-primary); }
.menu-label { padding: 6px 8px; font: 500 12px/16px var(--font-mono); text-transform: uppercase; color: var(--text-tertiary); }
.menu-resources a.res { display: flex; align-items: center; gap: 12px; padding: 8px; }
.menu-resources a.res i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-primary); border: 1px solid var(--border-primary); }
.menu-resources a.res span { display: flex; flex-direction: column; gap: 4px; }
.menu-more .col.links { width: 170px; }
.menu-more .col.links:first-child { border-left: 0; }
.menu-resources .links a { padding: 8px; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-primary); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border-primary); }
.cta-band { position: relative; height: 677px; overflow: hidden; display: grid; place-items: center; }
.cta-band .burst { position: absolute; top: 0; bottom: 0; left: 50%; width: min(1400px, 100%); transform: translateX(-50%); opacity: .85; }
.cta-band .inner { pointer-events: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: 40px; text-align: center; }
.cta-band .inner h2, .cta-band .inner p { color: #ffffff; text-shadow: 0 1px 12px rgba(0, 20, 65, .7); }
.footer-main { max-width: var(--container); margin: 0 auto; padding: 8px 0 0; }
/* Same side margins as the frame, so the footer text stays inside its hairlines. */
@media (max-width: 1528px) and (min-width: 1200px) { .footer-main { max-width: calc(100% - 128px); } }
.footer-cols { display: flex; justify-content: space-between; gap: 40px; padding: 32px 40px 24px; }
.footer-cols > div { flex: 0 0 auto; display: flex; flex-direction: column; gap: 16px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-cols a { display: inline-flex; align-items: center; gap: 8px; }
.footer-cols a { color: var(--text-secondary); }
.footer-cols a:hover { color: var(--text-primary); }
.footer-cols a img { width: 16px; height: 16px; }
.footer-bar { display: flex; align-items: center; gap: 32px; padding: 20px 40px 28px; border-top: 1px solid var(--border-primary); }
.footer-bar .legal { margin: 0; font-weight: 500; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.footer-bar .links { display: flex; gap: 12px; }
.footer-bar .links span { color: var(--text-disabled); }
.footer-bar .links a:hover { color: var(--text-secondary); }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid var(--border-primary); border-radius: 20px; }
.status-pill .ok { display: inline-flex; align-items: center; gap: 8px; }
.status-pill .sep { width: 1px; align-self: stretch; background: var(--border-primary); }
.dot-live { width: 8.5px; height: 8.5px; border-radius: 10px; background: var(--green); border: 1px solid var(--bg-primary); box-shadow: 0 0 0 1px rgba(16, 236, 144, .25); }
.dot-blue { background: var(--blue); box-shadow: none; }
.dot-yellow { background: var(--yellow); box-shadow: none; }
.subscribe { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 3px 3px 3px 12px; background: var(--surface-primary); border: 1px solid var(--border-primary); border-radius: 12px; }
.subscribe input { width: 160px; background: none; border: 0; outline: none; color: var(--text-primary); font: 400 12px/16px var(--font-sans); }
.subscribe input::placeholder { color: var(--text-tertiary); }
.footer-logo a { display: inline-block; }
.footer-logo img { display: block; }
/* Pages whose Figma footer has no CTA band: <body class="no-cta">. */
.no-cta .cta-band { display: none; }
.no-cta .site-footer > .rule-t { border-top: 0; }

/* ---- shared widgets ---- */
.prompt-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.prompt-box .box { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--surface-subtle); border: 1px solid var(--border-primary); border-radius: 16px; }
.prompt-box .ph { padding: 12px; color: var(--text-tertiary); font-size: 14px; line-height: 20px; }
.prompt-box .tools { display: flex; justify-content: space-between; height: 40px; }
.prompt-box .tools span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; }
.prompt-box .tools span:hover { background: var(--bg-secondary); }
.prompt-box .tools img { width: 18px; height: 18px; }
.prompt-box .chips { display: flex; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px; background: var(--surface-subtle); border: 1px solid var(--border-primary); border-radius: 8px; color: var(--text-secondary); font-weight: 500; font-size: 12px; line-height: 16px; }
.chip img { width: 14px; height: 14px; }
.card { background: var(--surface-subtle); border: 1px solid var(--border-primary); border-radius: 16px; }

.not-desktop { display: none; }
.marquee { overflow: hidden; }
.marquee .track { display: flex; justify-content: space-between; width: 100%; }
.marquee .track [aria-hidden] { display: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
  .only-desktop { display: none; }
  .not-desktop { display: inline; }
  .site-header .bar { padding: 0 30px 0 40px; }
  .site-header nav { display: none; }
  .site-header .right { display: flex; gap: 10px; }
  .menu-toggle { display: block; position: relative; width: 36px; height: 36px; }
  .menu-toggle span, .menu-toggle::before { content: ""; position: absolute; left: 10px; width: 16px; height: 2px; background: var(--text-secondary); transition: transform .2s, opacity .2s; }
  .menu-toggle::before { top: 11px; }
  .menu-toggle span:first-child { top: 17px; }
  .menu-toggle span:last-child { top: 23px; }
  .menu-open .menu-toggle::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-toggle span:first-child { opacity: 0; }
  .menu-open .menu-toggle span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .marquee .track { width: max-content; gap: 64px; animation: marquee 30s linear infinite; }
  .marquee .track [aria-hidden] { display: block; }
  .display-h2 { font-size: 36px; line-height: 40px; }
  .footer-bar { flex-wrap: wrap; row-gap: 16px; }
}

/* ---------- Phone (Figma: Footer, Phone variant) ---------- */
@media (max-width: 809px) {
  .display-h2 { font-size: 36px; line-height: 40px; }
  .site-header .bar { padding: 0 20px; }
  .site-header .right .btn { display: none; }
  .footer-main { padding: 0; }
  .footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 32px 20px 24px; }
  .footer-bar { flex-direction: column; align-items: center; gap: 16px; padding: 20px 20px 28px; text-align: center; }
  .status-pill { justify-content: space-between; }
  .status-pill .sep { display: none; }
  .subscribe { margin: 8px 0 0; width: 100%; justify-content: space-between; }
  .subscribe input { flex: 1; width: auto; }
  }
@media (prefers-reduced-motion: reduce) { .marquee .track { animation: none; } }

/* ---- Three.js animations (three/boot.js) ----
   The <img> inside is the fallback, shown until the canvas is ready and for
   reduced-motion visitors or devices without WebGL. */
.three { position: relative; overflow: hidden; }
.three > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; }
.three > img.contain { object-fit: contain; }
.three-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity .8s ease; }
.three-live > .three-canvas { opacity: 1; }
.three-live > img { opacity: 0; }
/* Quiet starts: no fallback while loading, only if the animation cannot run */
.three[data-three-quiet] > img { opacity: 0; transition: none; }
.three[data-three-quiet].three-fallback > img { opacity: 1; }

.cta-band .inner .btn { pointer-events: auto; }

/* ---- Tablet / phone menu (live: "Tablet / Mobile Menu") ---- */
.mmenu { display: none; }
@media (max-width: 1199px) {
  .mmenu { display: flex; flex-direction: column; gap: 28px; position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 49;
    padding: 20px 32px 40px; background: var(--bg-primary); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility 0s .2s; }
  .menu-open .mmenu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
  .menu-open { overflow: hidden; }
  .mm-sec { display: block; border-bottom: 1px solid var(--border-primary); }
  .mm-sec summary, .mm-plain { display: flex; align-items: center; justify-content: space-between; padding: 12px; list-style: none; cursor: pointer; }
  .mm-sec summary::-webkit-details-marker { display: none; }
  .mm-sec h3 { margin: 0; font-weight: 500; font-size: 18px; line-height: 20px; color: var(--btn-ghost-fg); }
  .mm-sec summary img { width: 16px; height: 16px; transition: transform .2s; }
  .mm-sec[open] summary img { transform: rotate(180deg); }
  .mm-body { display: flex; flex-direction: column; padding-bottom: 8px; }
  .mm-body.res { padding: 4px 4px 8px; }
  .mm-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; }
  .mm-body.res .mm-item { padding: 8px; }
  .mm-item:hover { background: var(--bg-secondary); }
  .mm-item span { display: flex; flex-direction: column; gap: 4px; }
  .mm-item b { font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-primary); }
  .mm-item small { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
  .mm-item i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-primary); }
  .mm-link { padding: 8px; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-primary); }
  .mm-cta { display: none; }
}
@media (max-width: 809px) {
  .mmenu { padding: 8px 8px 40px; }
  .mm-sec h3 { font-size: 16px; }
  .mm-cta { display: flex; margin: 0 12px; }
}

/* Chromatic divider (chroma.js): R, G and B strokes grow out from the centre
   over 0.42s (ease-out), 25ms apart, fading to the hairline colour over 0.36s.
   Screen-blended, the three end colours (set per line by chroma.js) resolve to --border-primary. */
.chroma-line { position: absolute; left: 0; right: 0; height: 1px; display: flex; z-index: 2; pointer-events: none; }
.chroma-half { position: relative; flex: 1 1 0; overflow: hidden; }
.chroma-half i { position: absolute; inset: 0; transform: scaleX(0); transition: transform .42s cubic-bezier(.5, 1, .89, 1), background-color .36s linear; }
.chroma-half.l i { transform-origin: 100% 50%; }
.chroma-half.r i { transform-origin: 0 50%; }
.chroma-half .b { background: #0000ff; }
.chroma-half .g { background: #00ff00; mix-blend-mode: screen; }
.chroma-half .r { background: #ff0000; mix-blend-mode: screen; }
.chroma-line.on i { transform: none; }
.chroma-line.on .b { background: var(--cb, #000024); }
.chroma-line.on .g { background: var(--cg, #002500); }
.chroma-line.on .r { background: var(--cr, #290000); }
.chroma-half.l .g, .chroma-half.r .g { transition-delay: 25ms; }
.chroma-half.l .b, .chroma-half.r .r { transition-delay: 50ms; }
