:root {
  --bg: #0a0e13;
  --bg-2: #0f151c;
  --card: #111922;
  --line: #1e2a36;
  --grid: rgba(125, 180, 230, 0.05);
  --text: #e6edf3;
  --muted: #8b9aab;
  --accent: #f5a524;      /* amber */
  --accent-2: #7cc4f0;    /* blueprint blue */
  --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  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;
}

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

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: #000; padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 8px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 19, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 1.5px solid var(--accent); color: var(--accent);
  font-family: var(--mono); font-weight: 700; font-size: 13px; border-radius: 6px;
}
.nav nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav nav a:not(.btn) { color: var(--muted); }
.nav nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* BUTTONS */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 8px;
  background: var(--accent); color: #111; font-weight: 600; font-size: 15px;
  border: 1.5px solid var(--accent); transition: transform .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); background: #ffb84a; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--muted); }
.btn-small { padding: 6px 12px; font-size: 13px; }

/* HERO */
.hero { padding: 110px 0 80px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 14px; margin: 0 0 14px; }
h1 { font-size: clamp(44px, 8vw, 80px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 24px; }
.lede { font-size: 19px; color: #c5d0db; max-width: 680px; margin: 0 0 20px; }
.seeking { display: flex; gap: 10px; align-items: baseline; color: var(--muted); max-width: 680px; margin: 0 0 32px; }
.seeking strong { color: var(--text); font-weight: 600; }
.dot {
  flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .18);
}
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

.specs {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 56px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
}
.specs div { padding: 14px 18px; border-right: 1px solid var(--line); }
.specs div:last-child { border-right: 0; }
.specs dt { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.specs dd { margin: 4px 0 0; font-size: 14px; }

/* SECTIONS */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 36px; }
.sec-num { color: var(--accent); font-size: 14px; }
.sec-num::after { content: " /"; color: var(--line); }
h2 { font-size: 32px; margin: 0; letter-spacing: -0.02em; }
h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 24px 0 10px; font-weight: 500; }

/* PROJECT CARDS */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: #2f4356; transform: translateY(-2px); }
/* corner registration marks for a drawing-sheet feel */
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--accent); border-style: solid; opacity: .7;
}
.card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }
.card-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.card-top span:first-child { color: var(--accent-2); }
.card p { margin: 0 0 16px; color: #b9c5d1; font-size: 15.5px; }
.card .card-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 16px; }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--bg); }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 14px 0 0 !important; }

/* TIMELINE */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 26px 0;
  border-top: 1px dashed var(--line);
}
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.tl-meta { color: var(--accent-2); font-size: 13px; padding-top: 3px; }
.org { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.tl-body ul { margin: 0; padding-left: 18px; color: #b9c5d1; font-size: 15.5px; }
.tl-body li { margin-bottom: 6px; }
.tl-body li::marker { color: var(--accent); }

/* SKILLS */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; }
.skill h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 10px; }
.skill p { margin: 0 0 6px; }
.skill p.muted { font-size: 14.5px; margin: 0; }
.skill:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* EDUCATION */
.edu { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.edu-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.edu-head p { margin: 0; }
.edu .tags { margin: 0; }

/* CONTACT */
.contact { border-bottom: 0; }
.email-text { margin-top: 18px; font-size: 14px; }

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; }

/* RESPONSIVE */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav nav a:not(.btn) { display: none; }
  .hero { padding: 72px 0 56px; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .specs div:nth-child(2) { border-right: 0; }
  .specs div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section { padding: 64px 0; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .skills { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #000; }
  .nav, .cta, .skip { display: none; }
}

/* ---------- Photos ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center; }
.portrait { margin: 0; }
.portrait img {
  display: block; width: 300px; aspect-ratio: 4/5; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 14px 14px 0 -1px var(--bg-2), 14px 14px 0 0 var(--line);
}
.card .card-img {
  width: calc(100% + 44px); max-width: none; margin: -22px -22px 18px;
  aspect-ratio: 16/10; object-fit: cover; display: block;
  border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}

/* Key facts inside a project card */
.facts { margin: 0 0 16px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.facts dt { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; padding-top: 1px; }
.facts dd { margin: 0; color: #c5d0db; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.about-text p { margin: 0 0 16px; color: #c5d0db; max-width: 560px; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.about-photos img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.about-photos img:only-child { grid-column: 1 / -1; aspect-ratio: 3/2; }
.about-photos:empty { display: none; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .portrait { order: -1; }
  .portrait img { width: 160px; }
  .about { grid-template-columns: 1fr; }
}

/* ---------- Project write-up pages ---------- */
.card-link { margin: 18px 0 0 !important; }
.card-link a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border: 1.5px solid var(--accent); border-radius: 8px;
  background: rgba(245, 165, 36, 0.08); color: var(--accent);
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  transition: background .15s, color .15s;
}
.card-link a::after { content: "→"; font-size: 16px; transition: transform .15s; }
.card-link a:hover { background: var(--accent); color: #111; text-decoration: none; }
.card-link a:hover::after { transform: translateX(4px); }

.doc-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.back { font-family: var(--mono); font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 28px; }
.back:hover { color: var(--text); text-decoration: none; }
.doc-hero h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: 16px; }
.doc-hero .lede { max-width: 760px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 24px 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 13px; }
.meta li span { color: var(--muted); margin-right: 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }

.doc { padding: 56px 0 88px; }
.doc-body { max-width: 820px; }
.doc h2 { font-size: 26px; margin: 64px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
.doc h2:first-child { margin-top: 0; }
.doc h2 .n { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 400; }
.doc h3 { font-size: 18px; margin: 32px 0 10px; }
.doc p, .doc li { color: #c5d0db; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); }

.role { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--card); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 8px; }
.role h3 { margin: 0 0 6px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.role p { margin: 0; }

.spec-table, .data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 16px 0 8px; }
.spec-table th, .spec-table td, .data-table th, .data-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { width: 38%; color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
.spec-table td { color: var(--text); }
.data-table thead th { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; border-bottom: 1px solid #2f4356; }
.data-table td { color: #c5d0db; font-family: var(--mono); font-size: 13px; }
.data-table td:first-child { font-family: var(--sans); font-size: 14.5px; }
.data-table tr.total td { color: var(--text); font-weight: 600; border-top: 1px solid #2f4356; }
.data-table .win, .data-table tr.total td.win { color: var(--accent); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.table-note { font-size: 13px; color: var(--muted); margin-top: 6px; }

figure.fig { margin: 24px 0; }
figure.fig img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
figure.fig figcaption, .gallery figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
figure.fig figcaption b, .gallery figcaption b { color: var(--accent-2); font-weight: 500; margin-right: 6px; }
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fig-row figure.fig { margin: 0; }
.fig-row + .fig-row { margin-top: 16px; }
.doc-body > .fig-row { margin: 24px 0; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 20px 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.wide { max-width: 1032px; }

.eq { font-family: var(--mono); font-size: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 14px 0; color: var(--text); overflow-x: auto; white-space: pre; line-height: 1.8; }
.eq .c { color: var(--muted); }

.status-list { list-style: none; padding: 0 !important; }
.status-list li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.status-list .tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.tag.met { color: #3ddc84; }
.tag.partial { color: var(--accent); }
.tag.open { color: var(--muted); }

.next-prev { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }

@media (max-width: 760px) {
  .fig-row, .gallery { grid-template-columns: 1fr; }
  .spec-table th { width: 45%; }
}
.gallery figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gallery figure:last-child:nth-child(odd) img { aspect-ratio: 21/9; }
.fig-row.photos img { aspect-ratio: 4/3; object-fit: cover; background: none; }
figure.fig img.portrait-fig { width: auto; max-width: 100%; max-height: 460px; background: none; }

/* Key-number tiles on write-up pages */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.stats div { padding: 20px 22px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stats dd { margin: 8px 0 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.stats p { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Embedded interactive viewer */
figure.viewer { margin: 24px 0 64px; }
figure.viewer iframe { display: block; width: 100%; aspect-ratio: 2 / 1; min-height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: #0d0d0d; }
figure.viewer figcaption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
figure.viewer figcaption b { color: var(--text); font-weight: 500; }
figure.viewer figcaption a { color: var(--accent); white-space: nowrap; }
@media (max-width: 760px) { figure.viewer iframe { aspect-ratio: 3 / 4; min-height: 0; } }
.viewer-poster { display: none; position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer-poster img { display: block; width: 100%; }
.viewer-poster span { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; background: var(--accent); color: #111; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 8px; }
.viewer-poster:hover { text-decoration: none; }
@media (max-width: 600px) {
  figure.viewer iframe { display: none; }
  .viewer-poster { display: block; }
}
