/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --paper: #ffffff;
  --paper-alt: #f3f5f9;
  --ink: #0d1b2e;
  --ink-soft: #43526b;
  --ink-faint: #5a6a82;
  --line: #dde3ec;
  --accent: #e6a800;
  --accent-text: #1d4e89;
  --accent-ink: #00274c;
  --btn-primary-bg: #fdb515;

  /* Navy "bands" (header, hero, footer). Light mode gets real navy with a gold rule;
     dark mode's band equals the page color, so dark mode looks unchanged. */
  --band: #00274c;
  --on-band: #ffffff;
  --on-band-soft: #c6d2e4;
  --on-band-faint: #a3b4cc;
  --band-line: rgba(255, 255, 255, 0.16);
  --band-accent: #fdb515;
  --band-rule: #fdb515;
  --band-rule-w: 4px;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --max-w-text: 68ch;
  --max-w-wide: 1160px;
  --radius: 6px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

:root[data-theme='dark'] {
  --paper: #0a1626;
  --paper-alt: #0f2038;
  --ink: #eef2f7;
  --ink-soft: #c3cedd;
  --ink-faint: #8fa0b8;
  --line: #22344c;
  --accent: #ffcb05;
  --accent-text: #ffcb05;
  --accent-ink: #00274c;
  --btn-primary-bg: #ffcb05;
  --band: #0a1626;
  --on-band: #eef2f7;
  --on-band-soft: #c3cedd;
  --on-band-faint: #8fa0b8;
  --band-line: #22344c;
  --band-accent: #ffcb05;
  --band-rule: #22344c;
  --band-rule-w: 1px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0a1626;
    --paper-alt: #0f2038;
    --ink: #eef2f7;
    --ink-soft: #c3cedd;
    --ink-faint: #8fa0b8;
    --line: #22344c;
    --accent: #ffcb05;
    --accent-text: #ffcb05;
    --accent-ink: #00274c;
    --btn-primary-bg: #ffcb05;
    --band: #0a1626;
    --on-band: #eef2f7;
    --on-band-soft: #c3cedd;
    --on-band-faint: #8fa0b8;
    --band-line: #22344c;
    --band-accent: #ffcb05;
    --band-rule: #22344c;
    --band-rule-w: 1px;
  }
}

/* ==========================================================================
   Fonts (self-hosted)
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}
.site-header :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--band-accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-text);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--band) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--band-line);
}
.nav-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-weight: 700;
  color: var(--on-band);
  font-size: 1.05rem;
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--on-band-soft);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover { color: var(--on-band); text-decoration: underline; text-decoration-color: var(--band-accent); }
.nav-links a[aria-current] {
  color: var(--on-band);
  text-decoration: underline;
  text-decoration-color: var(--band-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--band-line);
  border-radius: var(--radius);
  color: var(--on-band);
  padding: 8px 10px;
  font-size: 0;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--band);
    border-bottom: 1px solid var(--band-line);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 24px 20px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; width: 100%; }
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.wrap {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.wrap-text {
  max-width: var(--max-w-text);
}
.section {
  padding: var(--space-6) 24px;
  border-top: 1px solid var(--line);
}
.section-alt { background: var(--paper-alt); }
.section-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.section-head {
  margin-bottom: var(--space-4);
  max-width: 640px;
}
.section-title {
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.section-dek {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 60ch;
}

@media (max-width: 640px) {
  .section { padding: var(--space-5) 20px; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { border: 1px solid var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-faint); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  overflow: hidden;
  background: var(--band);
  color: var(--on-band);
  border-bottom: var(--band-rule-w) solid var(--band-rule);
}
.hero + .section { border-top: none; }
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: center;
}
.hero-portrait { margin: 0; }
.hero-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--band-line);
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-portrait { order: -1; width: 176px; }
}
.hero h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  max-width: 40rem;
}
.hero-line {
  display: block;
  text-wrap: balance;
}
.hero-line + .hero-line { margin-top: 0.7em; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero .btn-secondary { border-color: var(--band-line); color: var(--on-band); }
.hero .btn-secondary:hover { border-color: var(--band-accent); }
.hero-credibility {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 44px 0 0;
  color: var(--on-band-faint);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.hero-credibility li:not(:last-child)::after {
  content: '·';
  margin-left: 8px;
  color: var(--band-accent);
}

@media (max-width: 640px) {
  .hero { padding: 88px 20px 64px; }
}

/* ==========================================================================
   Project cards
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 860px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}
.project-card-media {
  margin-top: auto;
}
.project-card-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper-alt);
}
.project-card-media figcaption {
  margin: 0;
  padding: 8px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper-alt);
}
.project-card-body { padding: 20px 22px 24px; }
.project-card-context {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.project-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.project-card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin-bottom: 14px;
}
.project-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0 !important;
}
.project-card-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ==========================================================================
   Figure & caption
   ========================================================================== */
figure { margin: 0; }
figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 10px;
  line-height: 1.5;
}

/* ==========================================================================
   Theme cards (Current direction)
   ========================================================================== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) {
  .theme-grid { grid-template-columns: 1fr; }
}
.theme-card {
  padding: 4px 0 0;
  border-top: 2px solid var(--accent);
}
.theme-card h3 {
  font-size: 1.05rem;
  margin: 14px 0 10px;
}
.theme-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ==========================================================================
   Research list
   ========================================================================== */
.research-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.research-item {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.research-item:last-child { border-bottom: none; padding-bottom: 0; }
.research-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.research-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.research-note {
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.research-item h3 a { color: var(--ink); text-decoration-color: var(--line); }
.research-item h3 a:hover { color: var(--accent-text); }
.research-links { margin-top: 24px; }

/* ==========================================================================
   Background
   ========================================================================== */
.background-copy .section-head { margin-bottom: var(--space-3); }
.background-copy p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 68ch;
}
.background-copy .background-affiliation {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 16px;
}
.trajectory-link {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ==========================================================================
   Footer / contact
   ========================================================================== */
.site-footer {
  border-top: var(--band-rule-w) solid var(--band-rule);
  background: var(--band);
  color: var(--on-band);
  padding: var(--space-5) 24px var(--space-4);
}
.site-footer a { color: var(--band-accent); }
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.footer-contact h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--on-band);
}
.footer-contact p {
  color: var(--on-band-soft);
  max-width: 56ch;
  margin-bottom: 22px;
}
.footer-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: var(--space-4);
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--on-band-faint);
  font-size: 0.82rem;
  font-family: var(--mono);
  border-top: 1px solid var(--band-line);
  padding-top: 18px;
}
.footer-meta a { color: var(--on-band-faint); }
