/* Neural EM on FPGA: restrained academic theme (navy, off-white, teal). */
:root {
  --navy: #13294b;
  --navy-deep: #0b1c36;
  --ink: #1a2433;
  --muted: #4a5b72;
  --paper: #f7f5f0;
  --tint: #eef1f4;
  --card: #ffffff;
  --line: #d8dee6;
  --teal: #0f766e;
  --teal-strong: #0b5e57;
  --teal-soft: #e6f4f2;
  --teal-bright: #5eead4;
  --amber: #8a4b08;
  --amber-soft: #fdf1df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 41, 75, 0.06), 0 6px 22px rgba(19, 41, 75, 0.06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-strong); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
sub { line-height: 0; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin-bottom: 0.7em; }
.muted { color: var(--muted); }
.math { font-family: var(--serif); font-style: italic; white-space: nowrap; }

/* Header ----------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(19, 41, 75, 0.97);
  color: #f7f5f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; letter-spacing: 0.01em; }
.brand:hover { color: #fff; }
.nav-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: #dbe4f0; text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav-menu a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-menu a[aria-current="true"] { color: #fff; box-shadow: inset 0 -2px 0 var(--teal-bright); border-radius: 8px 8px 0 0; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; border-radius: 8px; padding: 8px; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; padding: 8px 16px 16px; background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px; }
  .nav-menu a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--teal-bright); border-radius: 0 8px 8px 0; }
}

/* Hero ------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% 20%, rgba(94, 234, 212, 0.10), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #e6edf6;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.6rem); letter-spacing: -0.02em; margin-bottom: 0.25em; }
.hero .subtitle { font-family: var(--serif); font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem); color: var(--teal-bright); margin-bottom: 1.2em; }
.hero .eyebrow { color: var(--teal-bright); }
.hero .lede { font-size: 1.12rem; color: #d3dcea; max-width: 62ch; }
.hero .lede em { color: #fff; font-style: normal; font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 28px; }
.btn { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.btn-primary { background: var(--teal-bright); color: var(--navy-deep); }
.btn-primary:hover { background: #99f6e4; color: var(--navy-deep); }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, 0.45); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); color: #fff; }
.status-key { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.95rem; color: #c3cfdf; }
.status-key li { display: flex; gap: 10px; align-items: baseline; }
.hero-figure { margin: 0; }
.hero-figure img { width: 100%; max-width: 480px; margin-inline: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35)); }
.hero-figure figcaption { font-size: 0.85rem; color: #a9b8cc; margin-top: 14px; text-align: center; max-width: 46ch; margin-inline: auto; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure img { max-width: 340px; }
}

/* Tags ------------------------------------------------------------------- */
.tag { display: inline-block; flex: none; font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag-existing { background: var(--teal-soft); color: var(--teal-strong); border: 1px solid #a7d8d1; }
.tag-proposed { background: var(--amber-soft); color: var(--amber); border: 1px solid #f0cf9f; }

/* Sections and cards ----------------------------------------------------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.tint { background: var(--tint); }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-intro { color: var(--muted); font-size: 1.08rem; }
.cards { display: grid; gap: 20px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .cards.two, .cards.three, .cards.four { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.card.wide { margin-top: 20px; display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; border-left: 4px solid var(--teal); }
@media (max-width: 640px) { .card.wide { flex-direction: column-reverse; gap: 12px; } }
.card-icon { width: 40px; height: 40px; color: var(--teal); margin-bottom: 14px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-top h3 { margin: 0; }
.kicker { font-weight: 600; color: var(--teal-strong); margin: 6px 0 14px; }
.repo { font-size: 0.92rem; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
.metric { border-top: 4px solid var(--teal); }
.mt { margin-top: 1.4em; }

.ticks { padding-left: 0; list-style: none; margin: 0 0 1.2em; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 0.8em; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 10px; height: 10px; border-radius: 2px; background: var(--teal); transform: rotate(45deg); }

.diagram { margin: 32px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.diagram img { width: 100%; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 12px; }

/* Pipeline --------------------------------------------------------------- */
.pipeline { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; counter-reset: none; }
.stage { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stage.existing { border-top: 4px solid var(--teal); }
.stage.proposed { border-top: 4px dashed #d08a2f; }
.stage h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.stage p { font-size: 0.92rem; color: var(--muted); flex: 1; }
.stage .tag { align-self: flex-start; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; }
.stage:not(:last-child)::after {
  content: ""; position: absolute; right: -12px; top: 30px; width: 10px; height: 10px;
  border-top: 2.5px solid var(--teal); border-right: 2.5px solid var(--teal); transform: rotate(45deg);
}
@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .stage:nth-child(3)::after { display: none; }
}
@media (max-width: 640px) {
  .pipeline { grid-template-columns: 1fr; gap: 18px; }
  .stage::after { display: none; }
  .stage:not(:last-child)::after { display: block; right: auto; left: 50%; top: auto; bottom: -14px; transform: translateX(-50%) rotate(135deg); }
}
.approach-detail { margin-top: 8px; }

/* Hardware --------------------------------------------------------------- */
.hw-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .hw-grid { grid-template-columns: 1fr; } }
.spec { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spec div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.spec div:last-child { border-bottom: 0; }
.spec dt { font-weight: 600; color: var(--navy); }
.spec dd { margin: 0; }
@media (max-width: 480px) { .spec div { grid-template-columns: 1fr; gap: 2px; } }
.source { font-size: 0.88rem; color: var(--muted); margin-top: 12px; }
.reasons { padding-left: 1.3em; margin: 0; }
.reasons li { margin-bottom: 1em; padding-left: 4px; }
.reasons li::marker { color: var(--teal); font-weight: 700; }
.note { margin: 36px 0 48px; padding: 22px 26px; background: var(--teal-soft); border-left: 4px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; }
.note h3 { font-size: 1.1rem; }
.note p { margin: 0; }

.arch-title { margin-bottom: 16px; }
.arch { margin: 0; display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }
.arch-board { background: var(--navy); color: #e6edf6; border-radius: var(--radius); padding: 20px; }
.arch-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-bright); margin-bottom: 14px; }
.arch-cols { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: stretch; }
@media (max-width: 640px) { .arch-cols { grid-template-columns: 1fr; } }
.arch-block { border-radius: 12px; padding: 16px 18px; }
.arch-block h4 { font-family: var(--sans); font-size: 1rem; margin-bottom: 8px; }
.arch-block h4 span { display: block; font-weight: 500; font-size: 0.82rem; opacity: 0.8; margin-top: 2px; }
.arch-block ul { margin: 0; padding-left: 1.1em; font-size: 0.93rem; }
.arch-block li { margin-bottom: 4px; }
.arch-block.ps { background: #1f3d68; border: 1px solid #36598a; }
.arch-block.ps h4 { color: #fff; }
.arch-block.pl { background: #0e3d47; border: 1px solid var(--teal); }
.arch-block.pl h4 { color: var(--teal-bright); }
.arch-bus { display: grid; place-items: center; position: relative; }
.arch-bus::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 6px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, var(--teal-bright) 0 8px, transparent 8px 12px); opacity: 0.7; }
.arch-bus span { position: relative; background: var(--navy); color: var(--teal-bright); font-size: 0.75rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
@media (max-width: 640px) {
  .arch-bus { height: 44px; }
  .arch-bus::before { left: 50%; right: auto; top: 4px; bottom: 4px; width: 6px; height: auto; transform: translateX(-50%); background: repeating-linear-gradient(180deg, var(--teal-bright) 0 8px, transparent 8px 12px); }
}
.arch-mem { margin-top: 14px; padding: 10px 14px; border: 1px dashed #5b7aa6; border-radius: 10px; font-size: 0.88rem; color: #c3cfdf; text-align: center; }
.arch-ext { display: grid; gap: 14px; align-content: start; }
.arch-block.ext { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.arch-block.ext h4 { color: var(--navy); }
.arch-block.ext p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.arch-block.add { border: 1.5px dashed #d08a2f; }
.arch-block.add .tag { margin-top: 6px; }
.arch figcaption { grid-column: 1 / -1; }

/* Timeline --------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: linear-gradient(90deg, var(--teal), var(--navy)); }
.timeline li { position: relative; padding-top: 36px; }
.timeline li::before { content: ""; position: absolute; top: 3px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 4px solid var(--teal); }
.when { font-weight: 700; color: var(--teal-strong); font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.4em; }
.timeline h3 { font-size: 1.15rem; }
.timeline p:last-child { color: var(--muted); font-size: 0.97rem; }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; gap: 28px; padding-left: 32px; }
  .timeline::before { left: 8px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; background: linear-gradient(180deg, var(--teal), var(--navy)); }
  .timeline li { padding-top: 0; }
  .timeline li::before { left: -32px; top: 4px; }
}

/* References ------------------------------------------------------------- */
.refs { padding-left: 1.6em; font-size: 0.97rem; }
.refs li { margin-bottom: 0.75em; padding-left: 4px; }
.refs li:target { background: var(--teal-soft); border-radius: 6px; }
.refs a { word-break: break-word; }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--navy-deep); color: #e6edf6; padding: 40px 0; font-size: 0.92rem; }
.footer-grid p { max-width: 900px; }
.muted-inv { color: #a9b8cc; }

/* Reveal animation (only when JS confirms motion is allowed) ------------- */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js-reveal .reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

@media print {
  .site-header, .cta, .skip-link { display: none; }
  .hero { background: #fff; color: #000; }
  .hero h1, .hero .lede { color: #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
