/* ============================================================
   Reactional Awareness — shared stylesheet
   Design tokens are at the top; change them to restyle everything.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #0B0E13;   /* page background — deep ink */
  --panel:     #121820;   /* raised cards / panels */
  --panel-2:   #0F141B;   /* subtle alt panel */
  --line:      rgba(255,255,255,0.09);
  --line-soft: rgba(255,255,255,0.05);

  /* Text */
  --text:      #E8ECEF;
  --muted:     #8B96A2;
  --dim:       #626E7A;

  /* Brand + semantic */
  --accent:    #F2B441;   /* signal gold */
  --accent-ink:#0B0E13;
  --up:        #35C46B;
  --down:      #F0554E;

  /* Type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans:    "Inter", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --radius: 12px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.25rem); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.mono { font-family: var(--mono); }
.up   { color: var(--up); }
.down { color: var(--down); }

/* ---------- Ticker tape ---------- */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  gap: 2.75rem;
  padding: 0.55rem 0;
  animation: ticker 48s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.ticker__item b { color: var(--text); font-weight: 500; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner { display: flex; align-items: center; gap: 1.5rem; height: 66px; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand__pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(242,180,65,.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(242,180,65,.5);} 70%{box-shadow:0 0 0 9px rgba(242,180,65,0);} 100%{box-shadow:0 0 0 0 rgba(242,180,65,0);} }
.brand__ra { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.75rem; margin-left: auto; }
.nav a { color: var(--muted); font-size: 0.94rem; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.market-clock { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.market-clock .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.market-clock.is-open .status-dot { background: var(--up); box-shadow: 0 0 8px var(--up); }
.market-clock.is-closed .status-dot { background: var(--down); }

.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; font-size: 0.92rem; padding: 0.6rem 1.1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { transform: translateY(-1px); background: #ffc85a; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: .4rem .6rem; font-size: 1rem; cursor: pointer; }

/* ---------- Section scaffolding ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.kicker { font-family: var(--mono); font-size: 0.76rem; color: var(--accent); margin: 0 0 .6rem; }
h1,h2,h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.h-lg { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 600; }
.h-md { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 56ch; }
.link-more { color: var(--accent); font-family: var(--mono); font-size: 0.8rem; }
.link-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem); }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 600; margin-bottom: 1.3rem; }
.hero h1 .em { color: var(--accent); }
.hero__cta { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* Chart panel */
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; }
.chart-card__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .25rem; }
.chart-card__name { font-family: var(--display); font-weight: 500; }
.chart-card__val { font-family: var(--mono); font-size: 1.35rem; }
.chart-card__sub { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-bottom: .75rem; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip { position: absolute; transform: translate(-50%, -120%); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; font-family: var(--mono); font-size: .72rem; pointer-events: none; opacity: 0; transition: opacity .1s; white-space: nowrap; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--panel); padding: 1.5rem 1.25rem; }
.stat__num { font-family: var(--display); font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 600; }
.stat__num .suffix { color: var(--accent); }
.stat__label { color: var(--muted); font-size: 0.86rem; margin-top: .3rem; }

/* ---------- Article cards ---------- */
.grid-feature { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; }
.stack { display: grid; gap: 1.25rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem;
  transition: border-color .18s, transform .18s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); }
.card--lead { justify-content: flex-end; min-height: 340px; background:
   linear-gradient(180deg, transparent 30%, rgba(0,0,0,.35)), var(--panel); }
.card__meta { display: flex; align-items: center; gap: .6rem; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 0.72rem; padding: .18rem .5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.tag--sector { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.card h3 { font-size: 1.28rem; font-weight: 500; }
.card--lead h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.card p { color: var(--muted); margin: 0; font-size: 0.96rem; }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.senti { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.senti--up { background: var(--up); } .senti--down { background: var(--down); } .senti--neutral { background: var(--dim); }

/* ---------- Insights database page ---------- */
.toolbar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.5rem; }
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: .6rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; }
.search input { background: none; border: none; color: var(--text); font-size: 0.98rem; width: 100%; outline: none; font-family: var(--sans); }
.search input::placeholder { color: var(--dim); }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 0.78rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: .15s; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.results-meta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-bottom: 1.25rem; }
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; font-family: var(--mono); }

/* ---------- Article reader ---------- */
.reader { max-width: 720px; margin-inline: auto; }
.reader__meta { display: flex; gap: .8rem; align-items: center; font-family: var(--mono); font-size: .8rem; color: var(--muted); margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.reader h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600; margin-bottom: .5rem; }
.reader__body { font-size: 1.15rem; line-height: 1.75; }
.reader__body p { margin: 0 0 1.4rem; }
.reader__body p:first-of-type::first-letter { font-family: var(--display); font-size: 3.1rem; font-weight: 600; float: left; line-height: .82; padding: .1rem .5rem 0 0; color: var(--accent); }
.back-link { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-mono { max-width: 62ch; }
.about-mono p { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.2rem; }
.about-mono strong { color: var(--text); font-weight: 500; }
.founder-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.founder-card .avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #7a5a14); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--accent-ink); margin-bottom: 1rem; }
.chips-static { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.timeline { display: grid; gap: 1.5rem; margin-top: 1rem; }
.tl-item { display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft); }
.tl-item .yr { font-family: var(--mono); font-size: .82rem; color: var(--accent); }
.tl-item h4 { margin: 0 0 .3rem; font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
.tl-item p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- Newsletter ---------- */
.subscribe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.5rem); text-align: center; }
.subscribe .field { display: flex; gap: .6rem; max-width: 440px; margin: 1.5rem auto 0; }
.subscribe input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; color: var(--text); font-size: .98rem; outline: none; }
.subscribe input:focus { border-color: var(--accent); }
.subscribe .note { font-family: var(--mono); font-size: .74rem; color: var(--dim); margin-top: .9rem; min-height: 1.1rem; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 2.5rem; margin-top: 2rem; }
.site-foot__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .88rem; }
.site-foot .nav a { font-size: .88rem; }

/* ---------- Reveal (used sparingly) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .about-hero { grid-template-columns: 1fr; }
  .grid-feature { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 0; margin: 0; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem clamp(1.1rem, 4vw, 2.25rem); }
  .nav .btn { margin: .5rem clamp(1.1rem, 4vw, 2.25rem); justify-content: center; }
  .nav-toggle { display: block; margin-left: auto; }
  .market-clock { display: none; }
  .grid-cards { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track, .brand__pulse { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
