/* NeuroFly — site stylesheet.
   Light, document-like reading surface; the brand's dark ink and signal green
   frame it (header, footer). No web fonts, no third-party requests. */

:root {
  color-scheme: light;
  --paper: #fbfbf9;
  --paper-2: #f3f4f0;
  --card: #ffffff;
  --ink: #15201c;
  --ink-2: #3c4a45;
  --muted: #62716b;
  --rule: #dfe3dd;
  --rule-2: #cdd3cc;
  --accent: #0b7a47;          /* signal green, darkened for text on paper (5.4:1) */
  --accent-2: #0d9456;
  --accent-wash: #e6f3ec;
  --brand: #00ff41;            /* the mark itself, only on dark */
  --night: #0c1311;            /* header / footer ground */
  --night-2: #131d1a;
  --night-ink: #e8efec;
  --night-muted: #9aaaa4;
  --warn: #8a5a00;
  --warn-wash: #fbf1dc;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --maxw: 1140px;
  --measure: 70ch;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(18px, 4vw, 32px); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---- header ------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(12, 19, 17, .96);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid #1d2a26;
  padding-top: env(safe-area-inset-top, 0px); }
.site-header .bar { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.site-header .brand { display: flex; align-items: center; }
.site-header .brand img { display: block; height: 28px; width: auto; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--night-muted); text-decoration: none; font-size: 14.5px; padding: 8px 12px; border-radius: 7px; }
.site-nav a:hover { color: var(--night-ink); background: #17231f; }
.site-nav a[aria-current="page"] { color: var(--night-ink); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 7px 7px 0 0; }
.site-nav .cta { margin-left: 10px; color: #04140a; background: var(--brand); font-weight: 650; }
.site-nav .cta:hover { color: #04140a; background: #7dffab; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid #2a3a35; color: var(--night-ink);
  border-radius: 8px; padding: 7px 11px; font: inherit; font-size: 14px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: var(--night); border-bottom: 1px solid #1d2a26; padding: 10px clamp(18px, 4vw, 32px) 18px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; font-size: 16px; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); border-radius: 0 7px 7px 0; }
  .site-nav .cta { margin: 8px 0 0; text-align: center; }
}

/* ---- typography ------------------------------------------------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.06; letter-spacing: -0.02em; margin: 0 0 22px; }
h2 { font-size: clamp(27px, 3.2vw, 38px); line-height: 1.15; letter-spacing: -0.012em; margin: 0 0 16px; }
h3 { font-size: 21px; line-height: 1.3; margin: 0 0 8px; }
h4 { font: 650 13px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
p { margin: 0 0 16px; }
.lead { font-size: clamp(18.5px, 2vw, 21.5px); line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.kicker { display: inline-block; font: 650 12.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px; }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.small, .note { font-size: 14.5px; color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
abbr { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* ---- page layout -------------------------------------------------------- */
.page-head { padding-block: clamp(56px, 8vw, 96px) clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--rule); background:
  linear-gradient(180deg, #f1f4ef 0, var(--paper) 100%); }
.page-head .lead { margin-bottom: 0; }
section.block { padding-block: clamp(52px, 7vw, 88px); border-bottom: 1px solid var(--rule); }
section.block.alt { background: var(--paper-2); }
.section-head { max-width: 68ch; margin-bottom: 36px; }
.section-head p { color: var(--ink-2); }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(28px, 4vw, 56px); align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

/* ---- hero -------------------------------------------------------------------- */
.hero { padding-block: clamp(64px, 9vw, 116px) clamp(44px, 6vw, 72px); background:
  radial-gradient(900px 380px at 85% -10%, #dff0e6 0, transparent 70%), linear-gradient(180deg, #f2f5f0 0, var(--paper) 100%);
  border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 17ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }

.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px; border-radius: 9px; font: 620 15.5px/1.2 var(--sans);
  text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #26352f; color: #fff; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--rule-2); }
.btn.secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---- facts ------------------------------------------------------------------ */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); margin-top: 48px; overflow: hidden; }
.fact { padding: 20px 22px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 -1px -1px 0; }
.fact b { display: block; font: 600 30px/1.1 var(--sans); letter-spacing: -0.02em; color: var(--ink); }
.fact span { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.fact .src { font-size: 12px; color: var(--muted); margin-top: 8px; font-family: var(--mono); }

/* ---- cards --------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 24px 20px; }
.card h3 { font-size: 20px; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 14px; display: block; }
.card.link-card { text-decoration: none; color: inherit; display: block; transition: border-color .12s, transform .12s; }
.card.link-card:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.card.link-card .more { color: var(--accent); font-weight: 600; font-size: 15px; }

/* status labels: measured / modelled / planned */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 650 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 99px; border: 1px solid var(--rule-2); color: var(--ink-2); background: var(--card); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.measured { color: #0b6b3f; border-color: #b8dcc8; background: #eef8f2; }
.tag.modelled { color: #1f5aa6; border-color: #c3d6f0; background: #f0f5fc; }
.tag.planned { color: #6b5a12; border-color: #e2d6a6; background: #fbf7e8; }
.tag.done { color: #0b6b3f; border-color: #b8dcc8; background: #eef8f2; }
.tag.progress { color: #1f5aa6; border-color: #c3d6f0; background: #f0f5fc; }

/* ---- figures ------------------------------------------------------------------ */
figure { margin: 0; }
figure.shot { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--night);
  box-shadow: 0 30px 60px -40px rgba(12, 19, 17, .45); }
figure.shot img { display: block; width: 100%; }
figcaption { font-size: 14.5px; color: var(--muted); padding: 14px 2px 0; line-height: 1.55; }
figure.shot figcaption { background: var(--card); padding: 14px 18px; border-top: 1px solid var(--rule); }
figcaption b { color: var(--ink); font-weight: 650; }
.figure-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 22px 18px; }
.figure-card h3 { font-size: 19px; }
.figure-card .q { color: var(--ink-2); font-size: 15px; margin-bottom: 12px; }
.figure-card .result { font-size: 15px; color: var(--ink); background: var(--paper-2); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 12px 0 4px; }
.figure-card details { margin-top: 10px; font-size: 14px; }
.figure-card summary { cursor: pointer; color: var(--accent); }

/* charts (inline SVG, drawn by site.js from inline JSON) */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .lbl { font: 12px var(--sans); fill: var(--muted); }
.chart .axis-title { font: 12.5px var(--sans); fill: var(--ink-2); }
.chart .grid-line { stroke: #e8ebe6; stroke-width: 1; }
.chart .base-line { stroke: #b9c1ba; stroke-width: 1; }
.chart .end-lbl { font: 600 12.5px var(--sans); fill: var(--ink); }
.chart .hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4;
  padding: 8px 10px; border-radius: 7px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: 0 8px 24px -10px #000; }
.chart-tip b { font-size: 14.5px; }
.chart-tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin: 4px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 16px; height: 2px; border-radius: 2px; }
.legend i.dot { width: 9px; height: 9px; border-radius: 50%; }
.legend i.ring { width: 9px; height: 9px; border-radius: 50%; background: transparent !important; border: 2px solid; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; margin-top: 8px; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; }
table.data td.n, table.data th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- tables ---------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table.spec { border-collapse: collapse; width: 100%; font-size: 15px; }
table.spec th, table.spec td { padding: 13px 16px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.spec tr:last-child td { border-bottom: 0; }
table.spec thead th { font: 650 12px/1.3 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
table.spec td .num, table.spec td.num { white-space: nowrap; }
table.spec td small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---- diagram ---------------------------------------------------------------------- */
.diagram { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(14px, 2.5vw, 28px); overflow-x: auto; }
.diagram svg { display: block; min-width: 720px; width: 100%; height: auto; }
.diagram .box { fill: #f6f8f5; stroke: #cfd6cf; stroke-width: 1.2; }
.diagram .box.measured { fill: #eef8f2; stroke: #9fcfb4; }
.diagram .box.modelled { fill: #f0f5fc; stroke: #aac3e6; }
.diagram .t { font: 600 14px var(--sans); fill: var(--ink); }
.diagram .s { font: 12.5px var(--sans); fill: var(--muted); }
.diagram .arrow { stroke: #7b8a84; stroke-width: 1.6; fill: none; marker-end: url(#arrowhead); }
.diagram .arrow.feedback { stroke-dasharray: 5 4; }

/* ---- references ------------------------------------------------------------------ */
ol.refs { padding-left: 1.4em; margin: 0; }
ol.refs li { margin-bottom: 12px; color: var(--ink-2); font-size: 15.5px; padding-left: 4px; }
ol.refs li a { word-break: break-word; }
.cite-box { font-family: var(--mono); font-size: 13.5px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px; white-space: pre-wrap; color: var(--ink-2); overflow-x: auto; }

/* ---- callouts ------------------------------------------------------------------------ */
.callout { border: 1px solid var(--rule); border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; margin: 24px 0; }
.callout.warn { border-left-color: #c58a00; background: var(--warn-wash); }
.callout h3 { font-size: 18px; margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }

/* ---- roadmap -------------------------------------------------------------------------- */
.roadmap { list-style: none; margin: 0; padding: 0; position: relative; }
.roadmap::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--rule-2); }
.roadmap li { position: relative; padding: 0 0 30px 44px; }
.roadmap li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--rule-2); }
.roadmap li.done::before { background: var(--accent); border-color: var(--accent); }
.roadmap li.progress::before { background: linear-gradient(90deg, var(--accent) 50%, var(--card) 50%); border-color: var(--accent); }
.roadmap h3 { font-size: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.roadmap p { color: var(--ink-2); max-width: 70ch; margin-bottom: 8px; }
.roadmap .needs { font-size: 14.5px; color: var(--muted); }

/* ---- forms ---------------------------------------------------------------------------- */
.form-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; flex-wrap: wrap; }
.tabs button { font: 600 15px var(--sans); background: none; border: 0; padding: 12px 14px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.field { margin-bottom: 18px; }
.field label, .field .label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.field input[type=text], .field input[type=email], .field select, .field textarea {
  width: 100%; font: 16px/1.4 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--rule-2); border-radius: 8px; padding: 11px 13px; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; font-size: 15px; padding: 12px 14px; border-radius: 8px; }
.form-status.ok { background: #eef8f2; color: #0b5c36; border: 1px solid #b8dcc8; }
.form-status.err { background: #fdf0ef; color: #8f2320; border: 1px solid #efc4c1; }
.req { color: #a3322e; }

.contact-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---- footer ------------------------------------------------------------------------------ */
.site-footer { background: var(--night); color: var(--night-muted); font-size: 14.5px; padding-block: 56px calc(40px + env(safe-area-inset-bottom, 0px)); }
.site-footer a { color: var(--night-ink); text-decoration-color: #3b4c46; }
.site-footer a:hover { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 32px; }
.site-footer img { height: 26px; width: auto; display: block; margin-bottom: 14px; }
.site-footer h4 { color: var(--night-ink); letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .fine { border-top: 1px solid #1f2c28; margin-top: 40px; padding-top: 22px; font-size: 13px; line-height: 1.6; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .fact { padding: 16px 16px; }
  .fact b { font-size: 24px; }
  .card { padding: 20px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  .site-header, .site-footer, .nav-toggle, .btn { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  section.block { padding-block: 20px; border: 0; }
}
