:root {
  /* Night city: deep navy ground, sodium street-lamp amber as the one accent */
  --bg: #0b0f1a;
  --surface: #121929;
  --text: #e6e8ee;
  --muted: #9aa3b5;
  --line: #222b3f;
  --accent: #f0a640;
  --accent-hover: #ffbd5c;
  --accent-soft: rgba(240, 166, 64, 0.12);
  --on-accent: #0b0f1a;
  --media-bg: #070a12;
  --max: 980px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 15, 26, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Home page */
.hero { padding: 88px 0 56px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; margin: 0 0 12px; }
.hero .tagline { font-size: 1.2rem; color: var(--muted); margin: 0 0 28px; max-width: 640px; }
.hero p { max-width: 680px; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.5rem; margin: 0 0 20px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; color: var(--text); text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card .thumb { aspect-ratio: 16 / 9; background: var(--media-bg); object-fit: cover; object-position: center top; width: 100%; }
.card .thumb.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.card .body { padding: 14px 16px 18px; }
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.skills { display: grid; grid-template-columns: 180px 1fr; gap: 10px 24px; margin: 0; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

/* Projects page */
.page-title { padding: 56px 0 8px; }
.page-title h1 { margin: 0 0 8px; font-size: 2.2rem; }
.page-title p { margin: 0; color: var(--muted); }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.jump a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.jump a:hover { border-color: var(--accent); color: var(--accent); }

.project { padding: 56px 0; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.project:first-of-type { border-top: 0; }
.project h2 { font-size: 1.8rem; margin: 0 0 4px; }
.project .summary { color: var(--muted); margin: 0 0 24px; font-size: 1.05rem; }

.media { background: var(--media-bg); border-radius: 10px; overflow: hidden; }
.media img, .media video { width: 100%; height: auto; }
figure { margin: 0; }
figcaption { font-size: 0.88rem; color: var(--muted); padding: 8px 2px 0; }

.headline { margin-bottom: 28px; }

.clips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0; }
.clips figure:first-child { grid-column: 1 / -1; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.gallery .media { aspect-ratio: 16 / 9; }
.gallery img { height: 100%; object-fit: cover; }

.detail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0; }
.detail h3 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin: 0 0 8px;
}
.detail p, .detail ul { margin: 0; font-size: 0.95rem; }
.detail ul { padding-left: 18px; }
.detail li { margin-bottom: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.tags li {
  font-size: 0.82rem; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.project-links { margin-top: 16px; font-size: 0.95rem; }

.placeholder {
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); border-radius: 10px; color: var(--muted);
  font-size: 0.95rem; text-align: center; padding: 16px; background: var(--surface);
}

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding: 56px 0 40px; }
  .cards, .detail { grid-template-columns: 1fr; }
  .clips { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 10px; }
  .nav a { padding: 6px 8px; }
}

/* Diagrams and small screenshots keep their own shape instead of being cropped */
.card .thumb.contain { object-fit: contain; object-position: center; background: #000; }
.media.diagram { background: #000; display: flex; justify-content: center; padding: 16px; }
.media.diagram img { width: 100%; max-width: 640px; }
.gallery.natural { grid-template-columns: 1fr 2fr; align-items: start; }
.gallery.natural .media { aspect-ratio: auto; background: var(--surface); }
.gallery.natural img { height: auto; object-fit: contain; }
@media (max-width: 760px) { .gallery.natural { grid-template-columns: 1fr; } }

/* Orb: square clip kept to a sensible size, portrait build photos */
.media.orb-clip { max-width: 560px; margin: 0 auto; }
.gallery.portraits .media { aspect-ratio: 3 / 4; }

/* Orb control app: phone screenshots in a row */
h3.sub { font-size: 1.1rem; margin: 36px 0 4px; }
.sub-intro { color: var(--muted); margin: 0; font-size: 0.95rem; }
.gallery.app-shots { grid-template-columns: repeat(4, 1fr); margin-top: 16px; }
.gallery.app-shots .media { aspect-ratio: 412 / 915; background: var(--surface); }
.gallery.app-shots img { object-position: top; }
@media (max-width: 760px) { .gallery.app-shots { grid-template-columns: repeat(2, 1fr); } }
