/* ===== SignalForge shared design tokens + chrome =====
   Loaded by sub-pages (about, book, method, etc).
   index.html keeps its inline CSS for the homepage waveform/engine animations.
*/

:root{
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --rule: #1c1c1c;
  --rule-2: #262626;
  --fg: #eaeaea;
  --fg-dim: #bdbdbd;
  --fg-mute: #8f8f8f;
  --accent: oklch(0.78 0.16 60);
  --accent-ink: #0a0a0a;
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,*::before,*::after{ box-sizing: border-box; }
html,body{ margin: 0; padding: 0; }
html{ background: var(--bg); }
body{
  font-family: var(--display);
  background: var(--bg);
  color: var(--fg);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","cv11";
}
::selection{ background: var(--accent); color: var(--accent-ink); }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; }

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ====== Nav ====== */
.nav{
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,10,0.78);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled{ border-bottom-color: var(--rule); }
.nav-inner{
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand{
  display: inline-flex; align-items: baseline;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 16px;
  white-space: nowrap;
}
.brand .sf-white{ color: var(--fg); }
.brand .sf-amber{ color: var(--accent); }
.brand .sf-desc{ color: var(--fg-mute); font-weight: 600; }
.brand-o{
  display: inline-block;
  width: 0.79em;
  height: 0.79em;
  margin: 0 0.04em;
  vertical-align: -0.08em;
  flex: 0 0 auto;
}
.brand-o .o-outline{
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.6;
}
.brand-o .o-inner{
  fill: var(--accent);
}
.nav-links{
  display: flex; gap: 28px; align-items: center;
  font-size: 13px; color: var(--fg);
  font-family: var(--mono);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.nav-links a:not(.nav-cta){ color: #c9c9c9; }
.nav-links a:not(.nav-cta):hover{ color: var(--accent); }
.nav-links a.active{ color: var(--accent); }
.nav-cta{
  font-family: var(--display);
  font-size: 13px;
  text-transform: none;
  color: var(--bg);
  background: var(--accent);
  padding: 8px 14px;
  border-radius: 0;
  letter-spacing: 0;
}
.nav-cta:hover{ background: #fff; color: var(--bg); }
@media (max-width: 760px){
  .nav-links a:not(.nav-cta){ display: none; }
}

/* ====== Insights nav dropdown (desktop only) ====== */
.nav-insights{ position: relative; }
.nav-insights-trigger::after{
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  vertical-align: 0.18em;
  opacity: 0.6;
  transition: transform .15s ease, opacity .15s ease;
}
.nav-insights:hover .nav-insights-trigger::after,
.nav-insights:focus-within .nav-insights-trigger::after{
  transform: rotate(180deg);
  opacity: 1;
}
.nav-insights-menu{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 360px;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 8px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.nav-insights:hover .nav-insights-menu,
.nav-insights:focus-within .nav-insights-menu{
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
.nav-insights-menu a,
.nav-insights-menu .np-soon{
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 14px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  text-decoration: none;
  color: var(--fg);
}
.nav-insights-menu a{ transition: background .12s ease, color .12s ease; }
.nav-insights-menu a:hover{
  background: var(--bg-2);
  color: var(--accent);
}
.nav-insights-menu .np-num{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  min-width: 28px;
  flex: 0 0 28px;
}
.nav-insights-menu a:hover .np-num{ color: var(--accent); }
.nav-insights-menu .np-name{ flex: 1 1 auto; }
.nav-insights-menu .np-soon{ color: var(--fg-mute); cursor: default; }
.nav-insights-menu .np-status{
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border: 1px dashed var(--rule-2);
  padding: 3px 8px;
  flex: 0 0 auto;
}
@media (max-width: 760px){
  .nav-insights{ display: none; }
}

/* ====== Type ====== */
.eyebrow{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow .dot{
  width: 6px; height: 6px; background: var(--accent);
  display: inline-block;
}
.h-display{
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  font-size: clamp(40px, 6vw, 84px);
  margin: 0;
  text-wrap: balance;
}
.h-display .accent{ color: var(--accent); }
.h-section{
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.05;
  font-size: clamp(32px, 4.6vw, 60px);
  text-wrap: balance;
  margin: 0;
}
.h-section .accent{ color: var(--accent); }
.body-lg{
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 62ch;
  text-wrap: pretty;
}
.body-md{
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--fg-dim);
  max-width: 62ch;
  text-wrap: pretty;
}
.rule{ height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ====== Sections ====== */
section{ padding: clamp(72px, 10vw, 140px) 0; position: relative; }
section.tight{ padding: clamp(48px, 6vw, 96px) 0; }
.section-head{
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
  margin-bottom: clamp(48px, 7vw, 96px);
}
.section-head .label{ padding-top: 8px; }
.section-head .label .num{
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
}
.section-head .label .name{
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}
@media (max-width: 760px){
  .section-head{ grid-template-columns: 1fr; gap: 16px; }
}

/* ====== Buttons ====== */
.btn{
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 22px;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
  transition: all .15s ease;
  cursor: pointer;
}
.btn-primary{
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover{ background: #fff; border-color: #fff; }
.btn-outline{
  background: transparent;
  color: var(--fg);
  border-color: var(--rule-2);
}
.btn-outline:hover{ border-color: var(--accent); color: var(--accent); }
.btn .arr{ transition: transform .2s ease; }
.btn:hover .arr{ transform: translateX(3px); }

/* ====== Page hero (sub-page top block) ====== */
.page-hero{
  padding: clamp(56px, 8vw, 120px) 0 clamp(40px, 5vw, 80px);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.page-hero .eyebrow{ margin-bottom: 28px; }
.page-hero h1{
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.04;
  font-size: clamp(40px, 5.6vw, 80px);
  margin: 0;
  text-wrap: balance;
  max-width: 22ch;
}
.page-hero h1 .accent{ color: var(--accent); }
.page-hero .lede{
  margin-top: 28px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--fg-dim);
  max-width: 56ch;
  text-wrap: pretty;
}
.page-hero .ctas{
  margin-top: clamp(36px, 4vw, 56px);
  display: flex; gap: 14px; flex-wrap: wrap;
}

/* ====== Reveal scroll-in ====== */
.reveal{ opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* ====== Footer ====== */
footer{
  border-top: 1px solid var(--rule);
  padding: 40px 0 56px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
}
.footer-inner{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 24px;
  align-items: start;
}
footer .left{ color: var(--fg-dim); line-height: 1.5; }
footer .center{
  text-align: center;
  font-family: var(--display);
  font-size: 14px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
footer .center .accent{ color: var(--accent); }
footer .right{ text-align: right; line-height: 2; }
footer .right a{ color: var(--fg-dim); }
footer .right a:hover{ color: var(--accent); }
@media (max-width: 760px){
  .footer-inner{ grid-template-columns: 1fr; text-align: left; }
  footer .center, footer .right{ text-align: left; }
}

/* ====== Utilities ====== */
.dashed-rule{ border-top: 1px dashed var(--rule-2); margin: clamp(40px, 5vw, 64px) 0; }
.solid-rule{ border-top: 1px solid var(--rule); margin: clamp(40px, 5vw, 64px) 0; }
.text-accent{ color: var(--accent); }
.text-mute{ color: var(--fg-mute); }
.text-dim{ color: var(--fg-dim); }
