:root {
  color-scheme: dark;
  --bg: #0a0b0c;
  --bg-inset: #060607;
  --surface: #111317;
  --surface-2: #161a1f;
  --border: #2a2f36;
  --border-muted: #1f242a;
  --fg: #e6edf3;
  --fg-muted: #8d96a0;
  --fg-subtle: #6e7681;
  --olive: #5a5a36;
  --olive-bright: #8a8a4e;
  --amber: #f0b020;
  --orange: #f07800;
  --link: #f0b020;
  --green: #3fb950;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --radius: 6px;
  --radius-lg: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: var(--radius);
  background: rgba(110, 118, 129, 0.2);
}

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

.muted {
  color: var(--fg-muted);
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 10;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--amber);
  color: #111;
}

.skip:focus {
  top: 12px;
}

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

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 11, 12, 0.88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border-muted);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.brand em {
  font-style: normal;
  color: var(--amber);
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.site-nav a svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.site-nav a:hover {
  color: var(--fg);
  background: var(--surface-2);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
  box-shadow: inset 0 -2px 0 var(--orange);
  border-radius: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 20px;
}

.btn:hover {
  background: #1f252c;
  border-color: #3b424b;
  text-decoration: none;
}

.btn-primary {
  background: var(--amber);
  border-color: rgba(0, 0, 0, 0.2);
  color: #16130a;
}

.btn-primary:hover {
  background: #ffc23a;
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-small {
  padding: 4px 12px;
  font-size: 0.85rem;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-muted);
  background:
    radial-gradient(900px 420px at 78% 40%, rgba(240, 176, 32, 0.1), transparent 70%),
    radial-gradient(700px 500px at 10% 0%, rgba(90, 90, 54, 0.22), transparent 70%),
    var(--bg-inset);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(138, 138, 78, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 138, 78, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 48px;
  padding: 88px 0 80px;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive-bright);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 650;
}

.lede {
  margin: 22px 0 0;
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--fg-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-mark {
  margin: 0;
  justify-self: center;
  position: relative;
}

.hero-mark::after {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 176, 32, 0.25), transparent 70%);
  filter: blur(30px);
}

.hero-mark img {
  width: min(360px, 100%);
  height: auto;
  border-radius: var(--radius-lg);
  mix-blend-mode: lighten;
}

/* North star */

.north-star {
  margin-top: -36px;
  position: relative;
}

.callout {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.callout h2 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
}

.callout p {
  margin: 0;
  font-size: 1.08rem;
  max-width: 62rem;
}

/* Sections */

.section {
  padding-top: 72px;
}

.section-head {
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-muted);
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--fg-muted);
}

.section-head-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

/* Features */

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.feature-lead {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.feature-media {
  position: relative;
  min-height: 100%;
  background: var(--bg-inset);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 12% center;
}

.feature-body {
  padding: 28px;
}

.feature-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--olive-bright);
}

.feature h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 600;
}

.feature h3 a {
  color: var(--fg);
}

.feature p {
  color: var(--fg-muted);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 22px 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}

.pipeline li {
  position: relative;
  padding: 12px 10px 0 0;
  border-top: 2px solid var(--olive);
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.35;
}

.pipeline li::before {
  counter-increment: stage;
  content: counter(stage);
  position: absolute;
  top: -11px;
  left: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--amber);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--mono);
}

.pipeline li span {
  display: block;
  margin: 6px 0 2px;
  color: var(--fg);
  font-weight: 600;
  font-size: 0.86rem;
}

.repo-trio {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo-trio li {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-inset);
}

.repo-trio a {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
}

.repo-trio p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
}

.feature + .feature,
.feature + .feature-pair,
.feature-lead + .feature,
.feature-lead + .feature-pair,
.feature-pair + .feature,
.feature-pair + .feature-pair {
  margin-top: 16px;
}

.feature-media-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  gap: 2px;
}

.feature-media.feature-media-stack img {
  aspect-ratio: 16 / 9;
  object-position: center;
}

.feature-media.feature-media-stack img:first-child {
  grid-column: 1 / -1;
  height: auto;
}

.feature-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-pair .feature-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-pair .repo-trio {
  margin-top: 16px;
}

.repo-trio .repo-muted {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.repo-trio .muted-sep {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.feature-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: auto 0 0;
  padding-top: 16px;
  font-size: 0.92rem;
}

.code,
.terminal {
  margin: 4px 0 0;
  padding: 16px;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-inset);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--fg);
}

.code code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.code .k {
  color: #7ee787;
}

.code .v {
  color: #79c0ff;
}

.code .s {
  color: #a5d6ff;
}

.terminal p {
  margin: 0;
  color: var(--fg);
}

.terminal .dim {
  color: var(--fg-subtle);
}

.terminal .gap {
  margin-top: 12px;
}

.terminal .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.terminal .prompt {
  color: var(--amber);
  margin-right: 6px;
}

/* Status + labels */

.status,
.visibility {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 2em;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 18px;
  color: var(--fg-muted);
  font-family: var(--sans);
  white-space: nowrap;
}

.status-live {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.45);
}

.status-active {
  color: var(--amber);
  border-color: rgba(240, 176, 32, 0.45);
}

.status-beta {
  color: var(--blue);
  border-color: rgba(88, 166, 255, 0.45);
}

.status-design {
  color: var(--purple);
  border-color: rgba(188, 140, 255, 0.45);
}

/* Layers */

.layers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.layers article {
  position: relative;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg));
}

.layers article::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  width: 36px;
  height: 2px;
  background: var(--amber);
}

.layers h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.layers p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.layers .layer-repos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.layer-repos a,
.topics span {
  display: inline-block;
  padding: 0 10px;
  border-radius: 2em;
  background: rgba(240, 176, 32, 0.1);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 22px;
}

.layer-repos a:hover {
  background: var(--amber);
  color: #16130a;
  text-decoration: none;
}

/* Repo cards (GitHub pinned style) */

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.repo-card:hover {
  border-color: #3b424b;
}

.repo-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.repo-desc {
  margin: 8px 0 12px;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

.repo-card .repo-desc {
  flex: 1;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.78rem;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hosts {
  display: inline-flex;
  gap: 12px;
  margin-left: auto;
}

.hosts a {
  color: var(--fg-muted);
}

.hosts a:hover {
  color: var(--amber);
}

/* Principles */

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.principles div {
  padding: 20px;
  background: var(--surface);
  border-right: 1px solid var(--border-muted);
}

.principles div:last-child {
  border-right: 0;
}

.principles dt {
  font-weight: 600;
  margin-bottom: 6px;
}

.principles dt::before {
  content: "▸ ";
  color: var(--amber);
}

.principles dd {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* Projects page */

.page-head {
  padding: 40px 0 16px;
}

.page-head h1 {
  font-size: 2rem;
}

.page-head p {
  margin: 6px 0 0;
}

.about-page {
  padding-bottom: 48px;
}

.about-section {
  padding-top: 40px;
  max-width: 44rem;
}

.about-section:first-of-type {
  padding-top: 16px;
}

.about-prose p {
  margin: 0 0 1rem;
  line-height: 1.65;
  color: var(--fg-muted);
}

.about-prose p:last-child {
  margin-bottom: 0;
}

.about-timeline,
.about-skills,
.about-edu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-timeline li,
.about-edu li {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
}

.about-timeline li:last-child,
.about-edu li:last-child,
.about-skills li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.about-timeline span,
.about-edu span {
  display: block;
  margin-top: 4px;
  color: var(--fg-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.about-skills li {
  margin: 0 0 10px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.about-skills strong,
.about-timeline strong,
.about-edu strong {
  color: var(--fg);
  font-weight: 600;
}

.about-links .actions {
  margin-top: 8px;
}

.about-actions {
  padding-top: 36px;
  padding-bottom: 72px;
}

.repo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-muted);
}

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 440px;
}

.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-subtle);
}

.search input {
  width: 100%;
  padding: 6px 12px 6px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--fg);
  font: inherit;
  font-size: 0.92rem;
  line-height: 20px;
}

.search input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 176, 32, 0.25);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.tabs button:hover {
  color: var(--fg);
  background: var(--surface-2);
}

.tabs button[aria-selected="true"] {
  color: var(--fg);
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--orange);
}

.count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 2em;
  background: rgba(110, 118, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.repo-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-muted);
}

.repo-row .repo-name {
  font-size: 1.2rem;
}

.repo-row .repo-desc {
  max-width: 48rem;
  font-size: 0.92rem;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.repo-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--fg-muted);
}

/* Footer */

.site-footer {
  margin-top: 88px;
  border-top: 1px solid var(--border-muted);
  background: var(--bg-inset);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px 0 36px;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

.footer-row p {
  margin: 0;
  max-width: 44rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
}

.footer-links a:hover {
  color: var(--fg);
  text-decoration: none;
}

.footer-links a svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Responsive */

@media (max-width: 1000px) {
  .layers,
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principles div:nth-child(2) {
    border-right: 0;
  }

  .principles div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border-muted);
  }

  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-lead {
    grid-template-columns: 1fr;
  }

  .feature-media img {
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 32px);
  }

  /* Keep Overview / Projects / About; hide external social links on small screens */
  .site-nav a:nth-child(n + 4) {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 48px 0 64px;
  }

  .hero-mark {
    order: -1;
    justify-self: start;
  }

  .hero-mark img {
    width: 120px;
  }

  .feature-pair,
  .layers,
  .principles,
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .principles div {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .principles div:last-child {
    border-bottom: 0;
  }

  .pipeline {
    grid-template-columns: 1fr;
    gap: 14px;
    border-left: 2px solid var(--olive);
    margin-left: 10px;
    padding-left: 20px;
  }

  .pipeline li {
    border-top: 0;
    padding: 0;
  }

  .pipeline li::before {
    top: 2px;
    left: -32px;
  }

  .pipeline li span {
    margin-top: 0;
  }

  .feature-body {
    padding: 20px;
  }

  .hosts {
    margin-left: 0;
  }
}

.about-stub {
  max-width: 40rem;
  padding: 8px 0 64px;
}

.about-lede {
  margin: 0 0 24px;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.about-note {
  margin: 0;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .terminal .cursor {
    animation: none;
  }
}
