:root {
  --bg: #10131a;
  --surface: #171b24;
  --line: #262b38;
  --line-soft: #1d222c;
  --text: #edeef2;
  --text-dim: #8d93a3;
  --text-faint: #5b6070;
  --accent: #f5f6f8;
  --accent-dim: #4b5768;
  --accent-soft: rgba(245, 246, 248, 0.09);
  --accent-text: #10131a;

  --status-green: #3ddc84;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --content-width: 760px;
  --edge: clamp(24px, 6vw, 64px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--edge);
  background: rgba(16, 19, 26, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.mark {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mark-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.mark-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-dim);
}

.site-nav a:hover { color: var(--text); }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-green);
  animation: beep 1.8s ease-in-out infinite;
}

@keyframes beep {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ---------- layout helpers ---------- */

main {
  max-width: calc(var(--content-width) + var(--edge) * 2);
  margin: 0 auto;
  padding: 0 var(--edge);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- hero ---------- */

.hero {
  padding: 96px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 40px;
  align-items: start;
}

.hero-avatar-frame {
  width: fit-content;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-avatar {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: cover;
  image-rendering: pixelated;
  background: var(--accent-dim);
}

.hero-mono-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 8px;
}

.hero-lede {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 15px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.hero-role {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 3px;
  margin-bottom: 24px;
}

.hero-bio {
  max-width: 54ch;
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 32px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #a8bad2;
}

.btn-ghost {
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--text-dim);
}

.hero-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.hero-links a:hover { color: var(--accent); }

/* ---------- projects / ledger ---------- */

.projects { padding-bottom: 96px; }

.ledger-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.ledger-row:last-child {
  border-bottom: 1px solid var(--line);
}

.ledger-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  padding-top: 4px;
}

.ledger-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ledger-title-row h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0;
}

.ledger-arrow {
  color: var(--text-dim);
  transition: color 0.15s ease, transform 0.15s ease;
}

.ledger-row:hover .ledger-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.ledger-body p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 10px 0 16px;
  max-width: 56ch;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 3px;
}

/* ---------- contact ---------- */

.contact {
  border-top: 1px solid var(--line);
  padding: 88px 0 72px;
}

.contact-lede {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 12px;
}

.contact-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 38px);
  max-width: 16ch;
  margin: 0 0 24px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.quote {
  position: relative;
  margin: 72px 0 0;
  padding: 40px 36px 36px 40px;
  background: linear-gradient(160deg, var(--surface), var(--bg));
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  overflow: hidden;
}

.quote::before {
  content: "\201C";
  position: absolute;
  top: -18px;
  left: 24px;
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1;
}

.quote p {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(19px, 2.6vw, 24px);
  line-height: 1.4;
  color: var(--text);
  max-width: 42ch;
  margin: 8px 0 18px;
}

.quote cite {
  position: relative;
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-style: normal;
}

.quote cite::before {
  content: "— ";
  color: var(--text-faint);
}

/* ---------- footer ---------- */

.site-footer {
  padding: 28px var(--edge) 40px;
  max-width: calc(var(--content-width) + var(--edge) * 2);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- boot-in animation ---------- */

.hero-mono, .hero-copy > * {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.5s ease forwards;
}

.hero-mono { animation-delay: 0.05s; }
.hero-lede { animation-delay: 0.12s; }
.hero-name { animation-delay: 0.18s; }
.hero-role { animation-delay: 0.26s; }
.hero-bio { animation-delay: 0.32s; }
.hero-actions { animation-delay: 0.4s; }
.hero-links { animation-delay: 0.46s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mono, .hero-copy > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .status-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .site-header { padding: 18px 20px; }
  .site-nav { display: none; }
  main, .site-footer { padding-left: 20px; padding-right: 20px; }
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-avatar { width: 120px; height: 120px; }
  .ledger-row { grid-template-columns: 1fr; gap: 8px; }
  .ledger-id { padding-top: 0; }
}