/* =========================================================
   Helix Fibrex Institute: v9 (dimensional helix + self-hosted fonts)
   cool monochrome · Inter (body) + JetBrains Mono (wordmark, data)
   ========================================================= */

/* Self-hosted fonts: no third-party font-service dependency */
@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/InterVariable.woff2') format('woff2-variations'),
       url('/assets/fonts/InterVariable.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  src: url('/assets/fonts/InterVariable-Italic.woff2') format('woff2-variations'),
       url('/assets/fonts/InterVariable-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
}

:root {
  /* Surfaces: cool near-black progression */
  --bg:        #0D1117;
  --bg-2:      #141A22;
  --bg-3:      #1C232D;
  --bg-deep:   #080B10;
  --bg-hover:  #242B36;

  /* Text: cool neutral gray (softer than pure white, no yellow) */
  --text:      #CBD4DF;
  --text-2:    #9BA4B2;
  --text-dim:  #6B7380;
  --text-faint: #4E5562;

  /* Rare subtle accent: muted steel blue */
  --accent:    #6B82A0;
  --accent-2:  #8498B5;

  /* Rules & dividers */
  --rule:         rgba(203, 212, 223, 0.07);
  --rule-strong:  rgba(203, 212, 223, 0.14);

  /* Layout */
  --max:    1200px;
  --narrow: 760px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--text-2); color: var(--bg); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 {
  margin: 0 0 .5em;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}
h1 { font-weight: 600; }
em { font-style: italic; color: var(--text); }
strong { font-weight: 600; color: var(--text); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--text); color: var(--bg); padding: .5rem 1rem; z-index: 100; }

/* =================== Nav =================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  background: rgba(13, 17, 23, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex; align-items: center;
  color: var(--text);
  line-height: 0;
}
.brand-lockup {
  width: auto;
  height: 92px;          /* stacked lockup: mark + FIBREX/INSTITUTE */
  display: block;
}
@media (max-width: 760px) {
  .brand-lockup { height: 72px; }
}
@media (max-width: 480px) {
  .brand-lockup { height: 62px; }
}
.nav-links {
  display: flex; gap: 30px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.nav-links a { transition: color .2s var(--ease); position: relative; padding-bottom: 4px; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--text); transition: right .35s var(--ease);
}
.nav-links a:hover::after { right: 0; }

@media (max-width: 760px) {
  .nav { padding: 14px 22px; }
  .nav-links { display: none; }
  .brand-wordmark { font-size: 14px; letter-spacing: 0.24em; }
}

/* =================== Hero =================== */
.hero {
  padding: 104px 40px 76px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
/* Subtle atmospheric: diffused light beams, monochromatic, very low opacity.
   Reads as "beams through fog" rather than glow. Slow drift over 70s. */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(108deg,
      transparent 43%,
      rgba(203, 212, 223, 0.022) 49%,
      rgba(203, 212, 223, 0.030) 50%,
      rgba(203, 212, 223, 0.022) 51%,
      transparent 58%),
    linear-gradient(84deg,
      transparent 22%,
      rgba(203, 212, 223, 0.015) 27%,
      rgba(203, 212, 223, 0.022) 28%,
      rgba(203, 212, 223, 0.015) 29%,
      transparent 36%),
    linear-gradient(118deg,
      transparent 68%,
      rgba(203, 212, 223, 0.014) 74%,
      rgba(203, 212, 223, 0.020) 75%,
      rgba(203, 212, 223, 0.014) 76%,
      transparent 82%);
  background-size: 140% 120%, 160% 120%, 130% 120%;
  background-position: 0% 50%, 50% 50%, 100% 50%;
  animation: beam-drift 70s ease-in-out infinite alternate;
  z-index: 1;
  mix-blend-mode: screen;
}
/* Particle canvas sits behind beams; content sits above both.
   Explicit z-index on canvas wins over the .hero > * rule. */
.hero-particles {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0 !important;
  display: block;
}
.hero > *:not(.hero-particles) { position: relative; z-index: 2; }
@keyframes beam-drift {
  0%   { background-position: -6% 48%, 54% 52%, 104% 49%; opacity: 0.75; }
  50%  { background-position:  0% 50%, 50% 50%, 100% 50%; opacity: 1; }
  100% { background-position:  6% 52%, 46% 48%,  96% 51%; opacity: 0.80; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
.hero-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.42fr 1fr;
  gap: 64px; align-items: center;
  min-height: 520px;
}
.hero-mark-fig { margin: 0; justify-self: end; align-self: center; }
.hero-mark-fig img { width: 100%; max-width: 240px; height: auto; opacity: 0.92; }

@media (max-width: 920px) {
  .hero { padding: 56px 22px 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero-mark-fig { justify-self: start; }
  .hero-mark-fig img { max-width: 180px; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 32px;
}
.eyebrow-rule {
  display: inline-block; width: 28px; height: 1px; background: var(--text-dim);
}
.eyebrow-num {
  display: inline-block; min-width: 22px;
  color: var(--text-2); letter-spacing: 0.08em;
}
.eyebrow-light { color: var(--text-dim); }

h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(36px, 4.8vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.022em;
  font-weight: 600;
  max-width: 22ch;
  margin: 0 0 28px;
  color: var(--text);
}
.h1-sub {
  display: block;
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: -0.012em;
  color: var(--text-2);
  margin-top: 12px;
  line-height: 1.2;
}

.lede {
  font-size: clamp(15px, 1.1vw, 17.5px);
  line-height: 1.68;
  max-width: 64ch;
  color: var(--text);
  margin: 0 0 32px;
  opacity: 0.88;
}
.lede em { color: var(--text); font-style: italic; opacity: 1; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 0; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 14px; letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: 2px;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.cta.primary {
  background: var(--text);
  color: var(--bg);
}
.cta.primary:hover { background: #fff; transform: translateY(-1px); }
.cta.ghost { color: var(--text); border: 1px solid var(--rule-strong); }
.cta.ghost:hover { border-color: var(--text); }
.cta::after { content: "→"; transition: transform .25s var(--ease); }
.cta:hover::after { transform: translateX(3px); }

/* =================== Stats =================== */
.stats {
  max-width: var(--max); margin: 88px auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 44px 36px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: none; }
.stats dt {
  font-family: 'Inter', sans-serif;
  font-size: clamp(44px, 5.4vw, 68px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  color: var(--text);
  display: inline-flex; align-items: baseline;
  font-feature-settings: "tnum" 1;
}
.stat-unit {
  font-size: 0.42em;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-2);
  margin-left: 5px;
  transform: translateY(-0.5em);
}
.stats dd {
  margin: 0;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-dim);
  max-width: 32ch;
  letter-spacing: 0.01em;
}
.stat-source {
  display: block;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  line-height: 1.45;
}

@media (max-width: 920px) {
  .stats { grid-template-columns: 1fr; margin: 48px 22px 0; }
  .stat { border-right: none; border-bottom: 1px solid var(--rule); padding: 28px 0; }
  .stat:last-child { border-bottom: none; }
}

/* =================== Sections =================== */
.section { padding: 108px 40px; position: relative; }
.section-rule { border-top: 1px solid var(--rule); background: var(--bg-2); }
.section-accent { border-top: 1px solid var(--rule); background: var(--bg); }

.wrap { max-width: var(--max); margin: 0 auto; position: relative; z-index: 1; }
.wrap.narrow { max-width: var(--narrow); }

.two-col {
  display: grid; grid-template-columns: 1fr 1.6fr;
  gap: 76px;
  margin-bottom: 56px;
  align-items: start;
}
.col-head { position: sticky; top: 120px; align-self: start; }
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; gap: 28px; margin-bottom: 36px; }
  .col-head { position: static; }
}

h2 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.022em;
  font-weight: 500;
  max-width: 22ch;
  margin: 0;
  color: var(--text);
}

.prose {
  font-size: 16px;
  line-height: 1.72;
  color: var(--text);
  opacity: 0.90;
  max-width: 64ch;
  margin: 0 0 1.2em;
}
.prose em { color: var(--text); opacity: 1; font-style: italic; }
.prose strong { color: var(--text); opacity: 1; }

.xref {
  color: var(--text);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color .2s var(--ease);
}
.xref:hover { border-bottom-color: var(--text); }

/* ============== Cards ============== */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding-top: 52px;
  border-top: 1px solid var(--rule);
}
.card {
  padding: 32px 0 0;
  border-top: 2px solid var(--text);
  margin-top: 0;
}
.card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 18px;
}
.card h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 20px; line-height: 1.22;
  letter-spacing: -0.012em; margin: 0 0 16px;
  max-width: 18ch;
  color: var(--text);
}
.card p {
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-dim); margin: 0;
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; gap: 0; border-top: none; padding-top: 0; }
  .card { padding: 28px 0 0; margin-top: 28px; border-top-width: 2px; }
}

/* ============== Steps ============== */
.steps {
  list-style: none; padding: 0;
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.step {
  padding: 40px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
  transition: background .25s var(--ease);
}
.step:hover { background: var(--bg-3); }

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.08em; color: var(--text-dim);
}
.step-horizon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  padding: 5px 12px;
  border: 1px solid var(--text);
  border-radius: 999px;
  margin-right: 4px;
}
.step-horizon.horizon-target {
  color: var(--text-2);
  border-color: var(--text-2);
  border-style: dashed;
}
.step-horizon.horizon-horizon {
  color: var(--text-dim);
  border-color: var(--text-faint);
  border-style: dashed;
}
.step h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 19px; letter-spacing: -0.012em;
  margin: 0; line-height: 1.22;
  color: var(--text);
  flex: 1 1 100%;
}
.step p {
  font-size: 14.5px; line-height: 1.68;
  color: var(--text-dim); margin: 0; max-width: 54ch;
}
.step em { color: var(--text); font-style: italic; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .step { padding: 28px 22px; }
}

/* ============== Timeline ============== */
.timeline {
  display: grid; gap: 44px;
  grid-template-columns: 1fr;
}
.t-item {
  padding: 0 0 0 24px;
  position: relative;
  border-left: 1px solid var(--rule-strong);
}
.t-item::before {
  content: ""; position: absolute; left: -4px; top: 8px;
  width: 7px; height: 7px; background: var(--text); border-radius: 50%;
}
.t-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 10px;
}
.t-item h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 20px; letter-spacing: -0.012em;
  color: var(--text); margin: 0 0 12px; line-height: 1.22;
}
.t-item p {
  font-size: 15px; line-height: 1.68;
  color: var(--text); opacity: 0.82; margin: 0;
  max-width: 58ch;
}
.t-item em { color: var(--text); opacity: 1; font-style: italic; }

/* ============== Engage ============== */
.engage-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.engage-card {
  padding: 32px 30px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
  transition: background .25s var(--ease);
}
.engage-card:hover { background: var(--bg-3); }
.engage-card h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500; font-size: 20px; letter-spacing: -0.012em;
  margin: 0 0 14px;
  color: var(--text);
}
.engage-card p {
  font-size: 14.5px; color: var(--text-dim); margin: 0; line-height: 1.65;
}
@media (max-width: 720px) {
  .engage-grid { grid-template-columns: 1fr; }
}

.contact-wrap { margin-top: 80px; }
.contact {
  padding: 56px 40px;
  text-align: center;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--bg-2);
}
.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 18px;
}
.contact-addr {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(22px, 3vw, 32px);
  color: var(--text);
  letter-spacing: -0.015em;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 6px;
  transition: border-color .2s var(--ease);
}
.contact-addr:hover { border-bottom-color: var(--text); }
.fine {
  font-size: 13px; color: var(--text-dim); margin-top: 22px;
  max-width: 54ch; margin-left: auto; margin-right: auto;
}

/* ============== Footer ============== */
.foot {
  padding: 72px 40px 48px;
  background: var(--bg-deep);
  border-top: 1px solid var(--rule);
}
.foot-inner {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px;
  align-items: start;
}
.foot-brand { display: flex; flex-direction: column; gap: 14px; }
.foot-brand img { width: 100%; max-width: 340px; height: auto; }
.foot-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-dim); margin: 0;
}
.foot-cols {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.foot-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 10px;
}
.foot-cols a {
  font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.foot-cols a:hover { border-color: var(--text); }
.foot-muted { color: var(--text-dim); font-size: 14px; }
.foot-fine {
  grid-column: 1 / -1;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
@media (max-width: 800px) {
  .foot-inner { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr; gap: 20px; }
}

/* Subtle entrance motion only */
@media (prefers-reduced-motion: no-preference) {
  h1, .lede, .cta-row, .hero-mark-fig, .stats {
    animation: riseIn 600ms var(--ease) both;
  }
  .lede { animation-delay: 80ms; }
  .cta-row { animation-delay: 160ms; }
  .hero-mark-fig { animation-delay: 200ms; }
  .stats { animation-delay: 260ms; }
  @keyframes riseIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
