/* Blueprint theme. Everything is self-hosted: the Content-Security-Policy blocks outside fonts and images,
   and it does not allow inline styles, so there are no style="" attributes anywhere in the HTML. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0a1020;
  --bg-raised: #101a30;
  --grid: rgba(110, 160, 255, 0.07);
  --line: #223357;
  --text: #dbe6ff;
  --muted: #93a4c8;
  --accent: #5ad1ff;
  --accent-ink: #04202c;
  --warm: #ffb454;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7fd;
    --bg-raised: #ffffff;
    --grid: rgba(30, 80, 170, 0.07);
    --line: #c5d3ec;
    --text: #14203a;
    --muted: #4a5b7d;
    --accent: #0b64b8;
    --accent-ink: #ffffff;
    --warm: #a85a00;
    color-scheme: light;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2rem, 62rem); margin-inline: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 0.9rem; border-radius: 6px; z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* ---------- hero ---------- */
.hero { padding: 1.25rem 0 3rem; border-bottom: 1px solid var(--line); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 3.5rem; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav a::before { content: "./"; color: var(--accent); opacity: 0.7; }

.mark {
  position: relative;
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  font: 700 1rem var(--mono); letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.mark::before, .mark::after {
  content: ""; position: absolute; width: 0.5rem; height: 0.5rem;
  border: 2px solid var(--accent);
}
.mark::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.mark::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }

.eyebrow { margin: 0 0 0.5rem; font: 500 0.9rem var(--mono); color: var(--accent); }
h1 { margin: 0; font-size: clamp(2.75rem, 9vw, 5rem); line-height: 1; letter-spacing: -0.03em; font-weight: 800; }
.role { margin: 0.75rem 0 0; font-size: clamp(1.25rem, 3.5vw, 1.75rem); font-weight: 600; }
.focus { margin: 0.35rem 0 0; font: 500 0.95rem var(--mono); color: var(--warm); }

.meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.75rem 0 0; font-size: 0.95rem; color: var(--muted); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px;
  margin: 2.5rem 0 0; padding: 0;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats div { background: var(--bg-raised); padding: 1.1rem 1.25rem; }
.stats dt { font: 700 1.75rem var(--mono); color: var(--accent); line-height: 1.1; }
.stats dd { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

/* ---------- sections ---------- */
main section { padding: 3rem 0 0.5rem; }

h2 {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin: 0 0 1.25rem; font-size: 1.5rem; letter-spacing: -0.01em;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); transform: translateY(-0.3em); }
.idx { font: 500 0.85rem var(--mono); color: var(--accent); }

h3 { margin: 0; font-size: 1.1rem; }
.sub { margin: 2rem 0 0.75rem; font: 600 0.85rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.lede { font-size: 1.05rem; max-width: 62ch; }
.note { color: var(--muted); font-size: 0.9rem; margin: -0.5rem 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.chips li {
  padding: 0.25rem 0.8rem; font-size: 0.875rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised);
}
.chips-dashed li { border-style: dashed; color: var(--muted); }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.card {
  position: relative; padding: 1.25rem 1.25rem 1rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.card::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 1.25rem; height: 1.25rem;
  border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-top-left-radius: var(--radius);
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-bottom: 0.5rem; }
.card p { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--muted); }
.card .links { font-family: var(--mono); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 1px solid var(--line); }
.timeline > li { position: relative; padding-bottom: 2rem; }
.timeline > li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 5px); top: 0.5rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline > li:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(90, 209, 255, 0.2); }
.dates { margin: 0; font: 500 0.8rem var(--mono); color: var(--warm); }
.org { margin: 0.1rem 0 0.5rem; color: var(--muted); font-weight: 500; }
.timeline ul { margin: 0; padding-left: 1.1rem; }
.timeline li li { margin-bottom: 0.35rem; font-size: 0.95rem; }
.timeline li li::marker { color: var(--accent); }

/* ---------- badge grid ---------- */
.badges {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem;
}
.badges a {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; height: 100%;
  padding: 0.9rem 0.6rem 0.75rem; text-align: center; text-decoration: none; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.badges a:hover { border-color: var(--accent); transform: translateY(-2px); }
.badges img { width: 75px; height: 75px; object-fit: contain; }
.badges span { font-size: 0.78rem; line-height: 1.3; color: var(--muted); }

/* ---------- footer ---------- */
footer { margin-top: 4rem; padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); }
.prompt { margin: 0; font: 500 0.9rem var(--mono); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.cmd { color: var(--accent); }
.count { color: var(--text); }
.fine { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- motion (respects reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .wrap > * { animation: rise 0.6s ease both; }
  .hero .wrap > *:nth-child(2) { animation-delay: 0.05s; }
  .hero .wrap > *:nth-child(3) { animation-delay: 0.1s; }
  .hero .wrap > *:nth-child(4) { animation-delay: 0.15s; }
  .hero .wrap > *:nth-child(5) { animation-delay: 0.2s; }
  .hero .wrap > *:nth-child(6) { animation-delay: 0.25s; }
  .hero .wrap > *:nth-child(7) { animation-delay: 0.3s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .badges a { transition: none; }
}

@media (max-width: 34rem) {
  .nav { margin-bottom: 2.5rem; }
  .badges { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
}

/* ---------- print: a clean text resume ---------- */
@media print {
  :root { --bg: #fff; --bg-raised: #fff; --text: #000; --muted: #333; --accent: #000; --warm: #000; --line: #999; }
  body { background: #fff; font-size: 10.5pt; }
  .nav, .skip, footer, .badges img, .stats { display: none; }
  .badges { display: block; }
  .badges li { display: inline; }
  .badges li:not(:last-child) span::after { content: " · "; }
  .badges a { display: inline; border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
  .card, .timeline > li { break-inside: avoid; }
  .hero { border: 0; padding-top: 0; }
}
