/* ─────────────────────────────────────────────────────────────
   neurohydro — shared styles (Data Terminal)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:        #e9e8e3;
  --paper:     #ffffff;
  --ink:       #11161c;
  --rule:      #cfccc1;
  --rule-lite: #e3e0d4;
  --muted:     #6a6a64;
  --accent:    #1860d4;
  --navy:      #0a2540;
  --hot:       #d0392a;
  --green:     #0a8a4a;

  --maxw: 1280px;
  --gap: 16px;
  --pad: 24px;
}

* { box-sizing: border-box; }

/* Overflow safety: media never exceeds its column; flex/grid kids can shrink */
img, svg, canvas, video { max-width: 100%; }
.panel { min-width: 0; }
.hero-grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .split-2-1 > *, .markets-row > * { min-width: 0; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', 'Sen', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-accent { color: var(--accent); font-weight: 700; }

/* ─── Ticker ──────────────────────────────────────────────── */
.ticker {
  background: var(--ink);
  color: #dcd9cf;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #000;
  position: relative;
}
.ticker .live,
.ticker .now {
  flex-shrink: 0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  position: relative;
}
.ticker .live {
  color: var(--accent);
  font-weight: 700;
  border-right: 1px solid #2a2f37;
  background: var(--ink);
}
.ticker .now {
  margin-left: auto;
  color: #a09d92;
  border-left: 1px solid #2a2f37;
  background: var(--ink);
}
/* Scrolling track sits between LIVE and NOW */
.ticker-track {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  /* Subtle fade at edges so items don't pop in/out hard */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}
.ticker-strip {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  padding: 8px 18px;
  will-change: transform;
  animation: marquee 96s linear infinite;
}
.ticker:hover .ticker-strip { animation-play-state: paused; }
.ticker .tick { display: inline-flex; gap: 8px; align-items: baseline; flex-shrink: 0; }
.ticker .tick-node { color: #a09d92; }
.ticker .tick-price { color: #fff; }
.ticker .tick-chg.up   { color: #3ad28d; }
.ticker .tick-chg.down { color: var(--hot); }
.ticker .tick-sep {
  color: #3a3f47;
  font-size: 8px;
  letter-spacing: 0;
}

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-strip { animation: none; }
}

@keyframes blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.3; }
}
.ticker .live > span:first-child { animation: blink 1.6s infinite; }

/* ─── Nav ─────────────────────────────────────────────────── */
.nav {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav img { height: 44px; display: block; }
.nav-links {
  display: flex;
  gap: 4px;
  align-items: flex-end; /* anchor the "lift" to a stable baseline */
}
.nav-links a {
  font-family: 'Poppins', 'Quicksand', system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  color: #4a4e57; /* dark grey at rest */
  padding: 8px 14px;
  border-radius: 2px;
  background: transparent;
  transform-origin: 50% 100%; /* lift up from bottom, like Mac dock */
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), color .15s ease;
  display: inline-block;
}

/* Hover + active: gradient text, no rectangle */
.nav-links a:hover,
.nav-links a.active {
  color: transparent;
  background-image: linear-gradient(180deg, #002060 0%, #2368a0 55%, #4fb5e2 100%);
  /* Confine the gradient to just the text height so all 3 stops are visible.
     Without this, the dark navy fills most of the (taller) padded element
     and the light-blue stop never reaches the glyphs. */
  background-size: 100% 1em;
  background-position: 50% 60%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  background-color: transparent;
  font-weight: 800;
  letter-spacing: -0.005em;
}

/* Dock-style lift on hover */
.nav-links a:hover {
  transform: translateY(-1.5px) scale(1.07);
}
.nav-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.coming-soon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-right .build { color: var(--muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 2px;
  border: none;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary {
  background: #2a2f37;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.15);
  transition: background .25s ease, box-shadow .25s ease, transform .08s ease;
}
.btn-primary:hover {
  /* Exact vertical gradient sampled from the "neuro" wordmark */
  background: linear-gradient(180deg, #002060 0%, #2368a0 55%, #4fb5e2 100%);
  text-shadow: 0 1px 0 rgba(0, 12, 36, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 1px 0 rgba(0, 12, 36, 0.15);
  opacity: 1;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); padding: 8px 15px; }

/* ─── Panel (the bento card) ──────────────────────────────── */
.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
}
.panel-pad { padding: 24px; }
.panel-pad-lg { padding: 32px; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.panel-head .live-dot::before {
  content: '●'; color: var(--accent); margin-right: 4px;
  animation: blink 1.6s infinite;
}

/* ─── Grids ───────────────────────────────────────────────── */
.shell { padding: var(--pad); display: grid; gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); }
.split-2-1 { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap); }

/* ─── Type ────────────────────────────────────────────────── */
.h1 { font-size: 64px; line-height: 0.98; letter-spacing: -0.03em; font-weight: 700; margin: 0; }
.h2 { font-size: 40px; line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; margin: 0; }
.h3 { font-size: 26px; line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; margin: 0; }
.h4 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.h1, .h2, .h3, .h4 { overflow-wrap: break-word; hyphens: auto; }
.lede { overflow-wrap: break-word; }
html, body { overflow-x: hidden; max-width: 100%; }
.ticker { overflow: hidden; }
.footer img { max-width: 100%; }
.lede { font-size: 17px; line-height: 1.55; color: var(--muted); margin: 0; }
.body { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }

/* ─── Stats ───────────────────────────────────────────────── */
.stat { padding: 0 24px; }
.stat + .stat { border-left: 1px solid var(--rule-lite); }
.stat-n { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat-l { margin-top: 8px; }

/* ─── Forms ───────────────────────────────────────────────── */
.field { display: block; }
.field > span {
  display: block;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--rule);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  outline: none;
  border-radius: 2px;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  background: var(--paper);
}
.field textarea { resize: vertical; min-height: 88px; }
.radio-grid {
  display: grid; gap: 8px;
}
.radio-grid label {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; cursor: pointer;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 2px;
}
.radio-grid input { accent-color: var(--accent); }

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--paper);
  padding: 32px 24px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.footer img { height: 28px; display: block; margin-bottom: 12px; }
.footer h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 700;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.footer li a:hover { color: var(--accent); }
.footer-tagline { font-size: 12px; color: var(--muted); line-height: 1.5; }
.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 20px;
  margin-top: 12px;
  border-top: 1px solid var(--rule-lite);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Mobile menu (hidden on desktop) ─────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 60;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.mobile-menu.open { display: flex; }
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.mobile-menu-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  text-transform: lowercase;
}
.mobile-menu-links a.active {
  color: transparent;
  background-image: linear-gradient(180deg, #002060 0%, #2368a0 55%, #4fb5e2 100%);
  -webkit-background-clip: text;
          background-clip: text;
}
.mobile-menu .btn { font-size: 16px; padding: 14px 26px; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-grid, .grid-2, .grid-3, .grid-4, .split-2-1 { grid-template-columns: 1fr; }
  .h1 { font-size: 44px; }
  .h2 { font-size: 30px; }
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-burger { display: flex; }
  .ticker { font-size: 10px; gap: 18px; padding: 8px 16px; }
  .ticker .now { display: none; }
  .footer { grid-template-columns: 1fr 1fr; }
  .stat + .stat { border-left: none; border-top: 1px solid var(--rule-lite); padding-top: 16px; margin-top: 16px; }
  .stat { padding: 0; }
}
@media (max-width: 560px) {
  :root { --pad: 12px; --gap: 12px; }
  .h1 { font-size: 34px; }
  .h2 { font-size: 26px; }
  .nav-right .build { display: none; }
  .footer { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
  .demo-form { grid-template-columns: 1fr !important; }
  .radio-grid { grid-template-columns: 1fr !important; }
  /* Let panel inner rows wrap instead of forcing the page wider */
  .panel > div { flex-wrap: wrap; min-width: 0; }
  .footer li { overflow-wrap: anywhere; }
}
