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

:root {
  --bg: #000;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #fff;
  --text-2: #a1a1a1;
  --text-3: #737373;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --page: 1120px;
  --gutter: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(255, 255, 255, 0.9); color: #000; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.container { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header (home) ---------- */
.site-header { padding: 28px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.identity { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.identity strong { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; }
.identity span { font-size: 13px; color: var(--text-3); }
.header-links { display: flex; align-items: center; gap: 4px; }
.header-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color .15s, background-color .15s;
}
.header-links a:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font: 500 12px/16px var(--mono); color: var(--text-2);
}
.hero h1 {
  margin: 20px 0 24px; font-size: clamp(42px, 6.4vw, 72px); line-height: 1.02;
  font-weight: 600; letter-spacing: -0.035em;
}
.lead { font-size: 15px; line-height: 1.7; color: var(--text-2); max-width: 560px; }
.lead + .lead { margin-top: 14px; color: var(--text-3); }
.lead b { color: var(--text); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: 500 14px/1 var(--sans); cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary:hover { background: #e5e5e5; border-color: #e5e5e5; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.profile { padding: 24px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.facts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.facts li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.facts .icon { color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding: 0; list-style: none; }
.chip {
  padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border);
  font: 500 12px/18px var(--mono); color: var(--text-2);
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3); }
.section h2 { margin-top: 12px; font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 64px; }
.about-text p { color: var(--text-2); font-size: 15px; line-height: 1.85; }
.about-text p + p { margin-top: 18px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.interest { padding: 24px; transition: border-color .2s, background-color .2s; }
.interest:hover { border-color: var(--border-strong); background: var(--surface-2); }
.interest .icon { width: 20px; height: 20px; color: var(--text-2); }
.interest h3 { margin: 18px 0 8px; font-size: 16px; font-weight: 600; }
.interest p { font-size: 14px; line-height: 1.65; color: var(--text-3); }

.empty { padding: 48px 24px; text-align: center; }
.empty p { color: var(--text-3); font-size: 14px; margin-top: 6px; }
.empty .btn { margin-top: 20px; }

.contact { padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contact h2 { margin: 0; font-size: 24px; }
.contact p { color: var(--text-3); font-size: 14px; margin-top: 6px; }

.site-footer { padding: 40px 0 48px; color: var(--text-3); font-size: 13px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; gap: 20px; }

/* ---------- Projects page (mono) ---------- */
.mono-page { font-family: var(--mono); }
.topbar-wrap { position: sticky; top: 0; z-index: 10; padding: 16px 0; background: linear-gradient(#000 60%, transparent); }
.topbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
  border: 1px solid var(--border); background: rgba(5, 5, 5, 0.85); backdrop-filter: blur(10px);
}
.brand { font-weight: 700; font-size: 14px; margin-right: 12px; }
.brand i { font-style: normal; color: var(--text-3); }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; font-size: 13px; color: var(--text-3); }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--text); }
.topbar .spacer { flex: 1; }

.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 40px 0 36px; border: 1px solid var(--border); background: #050505;
  color: var(--text); font: 13px var(--mono); border-radius: 0;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: rgba(255, 255, 255, 0.4); }
.search kbd {
  position: absolute; right: 8px; padding: 1px 6px; border: 1px solid var(--border);
  font: 11px var(--mono); color: var(--text-3); pointer-events: none;
}

.page-head { padding: 72px 0 40px; }
.page-head .kicker { font-size: 12px; color: var(--text-3); }
.page-head h1 { margin: 8px 0 16px; font-size: clamp(52px, 9vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -0.07em; }
.page-head h1 .dot { color: var(--text-3); }
.page-head p { font-size: 14px; color: var(--text-2); }

.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 24px; }
.list-bar .search { flex: 0 1 360px; }
.count { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  font: 500 12px var(--mono); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s;
}
.chip-btn span { color: var(--text-3); }
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn[aria-pressed="true"] { background: #fff; border-color: #fff; color: #000; }
.chip-btn[aria-pressed="true"] span { color: #555; }
.mono-page .empty { border: 1px dashed var(--border); border-radius: 0; background: #050505; }
.mono-page .btn { border-radius: 0; font-family: var(--mono); font-size: 13px; }
.mono-page .site-footer { font-family: var(--mono); font-size: 12px; }

/* ---------- Project cards & pages ---------- */
.ui-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ui-tags li { padding: 2px 8px; border: 1px solid var(--border); font-size: 11px; color: var(--text-2); }
.btn-note { font-size: 11px; opacity: .6; font-weight: 400; }

.ui-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ui-grid.single { grid-template-columns: minmax(0, 1fr); }
.card-kicker { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.not-found { margin-top: 48px; }

/* Text-only project card: a raised panel so it stands out from the black page. */
.project-card {
  display: flex; flex-direction: column; gap: 14px; padding: 28px;
  background: #0d0d0d; border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color .2s, border-color .2s;
}
.project-card:hover { background: #141414; border-color: rgba(255, 255, 255, 0.28); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-card .num { font: 500 11px var(--mono); color: var(--text-3); }
.project-card h3 { display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; }
.project-card h3 .icon { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s, color .2s; }
.project-card:hover h3 .icon { transform: translate(2px, -2px); color: var(--text); }
.project-card p {
  font-size: 13.5px; line-height: 1.75; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.project-card .ui-tags { margin-top: 2px; }
.project-card .ui-tags li { background: rgba(255, 255, 255, 0.04); }
.project-card-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  font: 12px var(--mono); color: var(--text-3); white-space: pre-wrap;
}

.ui-detail { padding-bottom: 32px; }
.crumbs { display: flex; gap: 8px; padding-top: 40px; font-size: 12px; color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.ui-head { padding: 24px 0 32px; display: flex; flex-direction: column; gap: 16px; }
.ui-head h1 { margin: 0; }
.ui-head .actions { margin-top: 4px; }
.ui-tagline { max-width: 760px; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.ui-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 8px 0 0; font-size: 12px; }
.ui-meta dt { color: var(--text-3); }
.ui-meta dd { margin: 2px 0 0; color: var(--text-2); }
/* Screenshots: compact thumbnails; click an image for full size. */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.shot { margin: 0; padding: 8px; background: #0d0d0d; border: 1px solid rgba(255, 255, 255, 0.12); transition: border-color .2s; }
.shot:hover { border-color: rgba(255, 255, 255, 0.28); }
.shot a { display: block; cursor: zoom-in; }
.shot img, .shot video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.shot video { object-fit: contain; }
.shot figcaption { padding: 8px 2px 0; font-size: 12px; color: var(--text-3); }

.readme { border: 1px solid var(--border); background: #050505; margin-top: 28px; }
.readme-head { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.readme-body { padding: 8px 28px 28px; max-width: 860px; font-family: var(--sans); }
.readme-body h2, .readme-body h3 { margin: 28px 0 12px; font-size: 18px; letter-spacing: -0.02em; }
.readme-body h4 { margin: 20px 0 8px; font-size: 15px; }
.readme-body p, .readme-body li { font-size: 14px; line-height: 1.8; color: var(--text-2); }
.readme-body p { margin: 0 0 14px; }
.readme-body ul { margin: 0 0 14px; padding-left: 20px; }
.readme-body li { margin-bottom: 6px; }
.readme-body strong { color: var(--text); font-weight: 600; }
.readme-body a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
.readme-body a:hover { text-decoration-color: var(--text); }
.readme-body code { font-family: var(--mono); font-size: 12.5px; padding: 1px 5px; background: var(--surface-2); border: 1px solid var(--border); }
.readme-body pre { margin: 0 0 16px; padding: 16px; overflow-x: auto; background: #0a0a0a; border: 1px solid var(--border); }
.readme-body pre code { padding: 0; border: 0; background: none; font-size: 12.5px; line-height: 1.7; color: #d4d4d4; }
.readme-body .table-wrap { overflow-x: auto; margin: 0 0 16px; }
.readme-body table { border-collapse: collapse; font-size: 13px; min-width: 50%; }
.readme-body th, .readme-body td { padding: 8px 14px; border: 1px solid var(--border); text-align: left; color: var(--text-2); }
.readme-body th { color: var(--text); font-weight: 600; background: var(--surface); }

.ui-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.ui-pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border: 1px solid var(--border); transition: border-color .2s; }
.ui-pager a:last-child { text-align: right; }
.ui-pager a:hover { border-color: rgba(255, 255, 255, 0.3); }
.ui-pager span { font-size: 11px; color: var(--text-3); }
.ui-pager strong { font-size: 14px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease-out, transform .6s ease-out; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: var(--radius-sm); background: #fff; color: #000; font-size: 14px; font-weight: 500;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 40px 0 72px; }
  .hero .container, .about { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 64px 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .header-links .label { display: none; }
  .header-links a { min-width: 44px; min-height: 44px; justify-content: center; }
  .topbar { padding-left: 12px; }
  .topbar .search { display: none; }
  .topbar nav a { min-height: 44px; }
  /* bio + github don't fit; the brand links home and GitHub is in the footer. */
  .topbar nav a:nth-child(n+3) { display: none; }
  .list-bar { flex-direction: column; align-items: stretch; }
  .list-bar .search { flex-basis: auto; }
  .page-head { padding: 48px 0 32px; }
  .contact { padding: 24px; }
  .ui-grid, .ui-pager { grid-template-columns: minmax(0, 1fr); }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .project-card { padding: 22px; }
  .readme-body { padding: 4px 16px 20px; }
  .crumbs { padding-top: 24px; }
  .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
