/* JAKSEN | base styles
   Palette: near-black ink, charcoal panels, white type, one electric-blue accent.
   Type: system sans with tabular figures for data. No external font requests. */

:root {
  --ink: #06070a;
  --panel: #0c0e13;
  --panel-2: #11141b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f6;
  --muted: #9aa3b2;
  --faint: #6b7385;
  --accent: #3d7bff;
  --accent-hi: #6b97ff;
  --accent-dim: rgba(61, 123, 255, 0.14);
  --danger: #ff7a7a;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Subtle engineering-paper grid across the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius);
  text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; color: var(--text); }
h1 { font-size: clamp(2.6rem, 6.2vw, 5.4rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; color: var(--muted); }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: #c6ccd7; max-width: 38rem; line-height: 1.55; }
.lead-sm { font-size: 1.08rem; color: #c6ccd7; max-width: 36rem; }
.muted { color: var(--faint); font-size: 0.95rem; }
.text-link { color: var(--accent-hi); text-decoration: none; border-bottom: 1px solid rgba(107, 151, 255, 0.35); padding-bottom: 1px; transition: border-color 0.2s, color 0.2s; }
.text-link:hover { color: #fff; border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 7, 10, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 650; letter-spacing: 0.14em; font-size: 0.95rem; color: var(--text); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; align-items: center; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; transition: color 0.2s; position: relative; padding: 0.25rem 0; }
.site-nav a:not(.nav-cta):hover,
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.site-nav a:not(.nav-cta):hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav .nav-cta {
  color: var(--text); border: 1px solid var(--line-strong); padding: 0.45rem 0.95rem; border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}
.site-nav .nav-cta:hover { border-color: var(--accent); background: var(--accent-dim); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius);
  width: 44px; height: 44px; cursor: pointer; color: var(--text); position: relative;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle .bars { top: 50%; transform: translateY(-50%); }
.nav-toggle .bars::before { top: -6px; left: 0; right: 0; }
.nav-toggle .bars::after { top: 6px; left: 0; right: 0; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 68px 0 auto 0; background: var(--panel);
    border-bottom: 1px solid var(--line); padding: 1rem var(--gutter) 1.5rem;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li a { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav .nav-cta { text-align: center; margin-top: 0.75rem; border-color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-size: 0.98rem; font-weight: 550; text-decoration: none;
  padding: 0.85rem 1.4rem; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a8dff; }
.btn-ghost { color: var(--text); border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy h1 { margin-bottom: 1.5rem; }
.hero-copy .lead { margin-bottom: 2.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-figure { margin: 0; }
.chart-frame {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 1rem;
  box-shadow: 0 30px 80px -40px rgba(61, 123, 255, 0.35);
}
.chart { width: 100%; height: auto; color: var(--text); }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.chart .grid-line-faint { stroke: rgba(255, 255, 255, 0.04); }
.chart .zero-line { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; stroke-dasharray: 4 5; }
.chart .band { fill: rgba(61, 123, 255, 0.08); stroke: rgba(61, 123, 255, 0.25); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .signal { fill: #fff; stroke: var(--accent); stroke-width: 1.5; }
.chart .axis-label { fill: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes draw-in { to { stroke-dashoffset: 0; } }

.chart-caption { margin-top: 0.85rem; font-size: 0.85rem; color: var(--faint); line-height: 1.5; }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 10vw, 7.5rem) 0; border-top: 1px solid var(--line); }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.012)); }
.section-tight { padding-top: 3rem; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.prose p:last-child { margin-bottom: 0; }
.prose p { font-size: 1.05rem; }
.section-head { max-width: 46rem; margin-bottom: 3.5rem; }
.section-head p { margin: 1.25rem 0 0; font-size: 1.05rem; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); }
.principle { padding: 2rem 2rem 0 0; }
.principle + .principle { padding-left: 2rem; border-left: 1px solid var(--line); }
.principle h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.principle p { font-size: 0.97rem; margin: 0; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.25rem; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 2rem 1.75rem; position: relative; overflow: hidden;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.card:hover { border-color: rgba(61, 123, 255, 0.35); background: var(--panel-2); }
.card:hover::after { transform: scaleX(1); }
.card h3 { margin: 1.5rem 0 0.75rem; }
.card p { font-size: 0.97rem; margin: 0; }
.glyph { width: 48px; height: 48px; color: #c9d3e4; }

/* Research article cards */
.card-article { display: flex; flex-direction: column; }
.card-article h3 { margin-top: 0.9rem; font-size: 1.1rem; }
.card-article h3 a { text-decoration: none; }
.card-article h3 a:hover { color: var(--accent-hi); }
.card-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--faint); margin: 0; }
.status { color: var(--muted); }
.status-published { color: var(--accent-hi); }
.card-article p:last-child { margin-top: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.chip {
  font: inherit; font-size: 0.92rem; color: var(--muted); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.chip.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.empty { color: var(--muted); padding: 2rem 0; }

.page-head { padding: clamp(3.5rem, 8vw, 5.5rem) 0 2rem; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: 1.25rem; }

/* ---------- Approach track ---------- */
.track {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  position: relative;
}
.track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 17px; height: 1px; background: var(--line-strong);
}
.step { position: relative; padding: 0 1.75rem 0 0; }
.step:last-child { padding-right: 0; }
.step-index {
  display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--accent); color: var(--accent-hi);
  font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; z-index: 1;
  margin-bottom: 1.5rem;
}
.step h3 { margin-bottom: 0.75rem; }
.step p { font-size: 0.97rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact-grid h2 { margin-bottom: 1.5rem; }
.contact-grid .lead-sm { margin-bottom: 1.5rem; }
.direct a { color: var(--accent-hi); }

.contact-form {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid; gap: 1.25rem;
}
.field { display: grid; gap: 0.45rem; }
.field label { font-size: 0.92rem; color: #d6dce7; font-weight: 500; }
.optional { color: var(--faint); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.75rem 0.9rem; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.28); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.form-actions { display: grid; gap: 0.9rem; }
.form-actions .btn { justify-self: start; }
.form-note { font-size: 0.88rem; color: var(--faint); margin: 0; }
.form-note.is-error { color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2.5rem; background: rgba(0, 0, 0, 0.25); }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.footer-brand p { margin: 0.9rem 0 0; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.footer-nav a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-nav a:hover { color: var(--text); }
.disclaimer-wrap { padding-top: 2rem; }
.disclaimer { font-size: 0.83rem; line-height: 1.65; color: var(--faint); max-width: 62rem; }
.copyright { font-size: 0.83rem; color: var(--faint); margin: 1rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; }
  .track { grid-template-columns: repeat(2, 1fr); row-gap: 3rem; }
  .track::before { display: none; }
  .step { padding-right: 1rem; }
}
@media (max-width: 860px) {
  .cards-3 { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
  .principle { padding: 1.5rem 0; }
  .principle + .principle { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .track { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .card { padding: 1.6rem 1.35rem; }
}

/* ---------- 404 ---------- */
.page-head-404 { padding-top: 7rem; min-height: 70vh; }
.actions-spaced { margin-top: 2rem; }
