:root {
  --bg: #1a1915;
  --surface: #26241f;
  --surface-2: #2e2b25;
  --border: #3d3a33;
  --border-strong: #524d44;

  --text: #f5f1e8;
  --text-secondary: #b8b2a7;
  --text-muted: #8a857c;

  --accent: #d97757;        /* coral — section headings, hover */
  --accent-amber: #e8b06f;  /* warm amber — metrics, strong terms */
  --accent-sage: #8fa78f;   /* muted sage — tech stacks */
  --accent-sky: #8ea9c4;    /* soft sky — eyebrow labels */

  --font-serif: 'Source Serif 4', 'Iowan Old Style', 'Apple Garamond', Georgia, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max-width: 880px;
  --section-gap: 96px;
  --gutter: 32px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(26, 25, 21, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  border-bottom: none;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-bottom: none;
  padding-bottom: 4px;
  transition: color 200ms ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Hamburger toggle (mobile/tablet only) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  z-index: 2;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: transform 200ms ease, opacity 200ms ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */
.hero {
  padding-top: 96px;
  padding-bottom: 48px;
}

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}

.hero-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.08);
}

.hero-copy {
  min-width: 0;
}

/* Stats strip — sits between hero and About */
.stats-section {
  margin-bottom: var(--section-gap);
}

/* Featured stat — the headline number, with story-context */
.stat-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 18px;
  border-top: 1px solid var(--border);
}

.stat-feature-num {
  font-family: var(--font-serif);
  font-size: clamp(72px, 11vw, 112px);
  font-weight: 400;
  color: var(--accent-amber);
  line-height: 0.9;
  letter-spacing: -0.04em;
  display: flex;
  align-items: flex-start;
}

.stat-feature-suffix {
  color: var(--accent);
  font-size: 0.55em;
  margin-top: 0.18em;
  margin-left: 4px;
}

.stat-feature-label {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.stat-feature-context {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 44ch;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
}

/* Right edge of each row gets no right border (3-col grid) */
.stat:nth-child(3n) {
  border-right: none;
}

/* First row gets a bottom border separating it from row 2 */
.stat:nth-child(-n+3) {
  border-bottom: 1px solid var(--border);
}

.stat-num {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 500;
  color: var(--accent-amber);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-suffix {
  color: var(--accent);
  font-weight: 400;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
  background-image: linear-gradient(
    100deg,
    var(--text) 35%,
    var(--accent-amber) 50%,
    var(--text) 65%
  );
  background-size: 300% 100%;
  background-position: 0% 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-role {
  color: var(--accent-amber);
  font-size: 17px;
  margin-bottom: 16px;
}

/* Hero status pill — small live indicator under hero role */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 6px 14px;
  background: rgba(143, 167, 143, 0.08);
  border: 1px solid rgba(143, 167, 143, 0.25);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent-sage);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-sage);
  animation: pulse-dot 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Prose & links */
.prose {
  color: var(--text-secondary);
  max-width: 64ch;
}

.prose + .prose {
  margin-top: 16px;
}

.prose p + p {
  margin-top: 16px;
}

.prose strong {
  color: var(--accent-amber);
  font-weight: 500;
}

main a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 200ms ease, color 200ms ease;
}

main a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Sections */
.section {
  padding-bottom: var(--section-gap);
  scroll-margin-top: 80px;
}

.section h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1) 180ms,
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1) 180ms;
}

.section.visible h2 {
  opacity: 1;
  transform: translateY(0);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: start;
}

.about-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

/* Work / education entries — grid layout with logo */
.entry {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.entry:first-of-type {
  border-top: none;
  padding-top: 0;
}

.entry-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-areas:
    "logo title date"
    "logo role  role";
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
  margin-bottom: 16px;
}

.entry-logo {
  grid-area: logo;
  width: 48px;
  height: 48px;
  background: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.entry-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Letter-mark fallback for entries without an image asset */
.entry-logo--moody {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--bg);
  line-height: 1;
  padding: 0;
}

.entry h3 {
  grid-area: title;
  align-self: end;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.entry-role {
  grid-area: role;
  align-self: start;
  color: var(--accent-amber);
  font-size: 15px;
}

.entry-date {
  grid-area: date;
  align-self: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
}

.entry-list {
  list-style: none;
  color: var(--text-secondary);
  margin-bottom: 16px;
  margin-left: 64px;
}

.entry-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.entry-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.entry-list li:last-child {
  margin-bottom: 0;
}

.entry-list strong {
  color: var(--accent-amber);
  font-weight: 500;
}

/* Tech chips — replaces the old monospace · separated stack list */
.tech-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.tech-chips li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-sage);
  background: rgba(143, 167, 143, 0.06);
  border: 1px solid rgba(143, 167, 143, 0.2);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  transition: background 200ms ease,
              border-color 200ms ease,
              transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              color 200ms ease;
}

.tech-chips li:hover {
  background: rgba(143, 167, 143, 0.14);
  border-color: rgba(143, 167, 143, 0.4);
  color: var(--text);
  transform: translateY(-2px);
}

/* Work entries: chips align with bullet text (64px indent for logo column) */
.tech-chips--indent {
  margin-left: 64px;
}

.entry > .prose {
  margin-left: 64px;
}

/* Expertise */
.expertise-card {
  display: block;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.expertise-card:first-of-type {
  border-top: none;
  padding-top: 0;
}

.expertise-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}

.expertise-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}

.expertise-body p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  max-width: 64ch;
}

.expertise-body strong {
  color: var(--accent-amber);
  font-weight: 500;
}

.expertise-body .tech-chips {
  margin-top: 16px;
}

/* Projects */
.project {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.project:first-of-type {
  border-top: none;
  padding-top: 0;
}

.project h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--text);
}

.project-tagline {
  color: var(--accent-amber);
  font-size: 15px;
  margin-bottom: 12px;
}

.project > p:not(.project-tagline):not(.project-links) {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.project strong {
  color: var(--accent-amber);
  font-weight: 500;
}

.project .tech-chips {
  margin-bottom: 14px;
}

/* Section intro — short paragraph under an h2 */
.section-intro {
  color: var(--text-secondary);
  margin-top: -16px;
  margin-bottom: 40px;
  font-size: 15px;
  max-width: 64ch;
}

/* Highlights — grouped sub-blocks within one section */
.highlights-block {
  margin-bottom: 56px;
}

.highlights-block:last-child {
  margin-bottom: 0;
}

.highlights-block > h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.highlights-block .prose {
  margin-bottom: 16px;
}

/* Activity band — GitHub heatmap promoted next to the stats */
.activity-section {
  margin-bottom: var(--section-gap);
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.activity-meta a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 200ms ease, border-color 200ms ease;
}

.activity-meta a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* "Now" panel — small heartbeat block under the activity heatmap */
.now-section {
  margin-bottom: var(--section-gap);
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(46, 43, 37, 0.4);
}

.now-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.now-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.now-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.now-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.now-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-sage);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.now-list em {
  color: var(--text);
  font-style: italic;
}

@media (max-width: 640px) {
  .now-section {
    padding: 18px 16px;
  }
  .now-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* GitHub contribution heatmap — light "data panel" insert against dark page */
.github-graph {
  background: #f0eee4;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 22px 24px;
  overflow-x: auto;
}

.github-graph img {
  display: block;
  width: 100%;
  height: auto;
  min-width: 680px;
}

.project-links {
  font-size: 14px;
  color: var(--text-muted);
}

/* Article cards — treat writing like content, not link list */
.articles-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  border-bottom: 1px solid var(--border) !important;
  transition: border-color 240ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent) !important;
}

.article-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background:
    radial-gradient(circle at 80% 10%, rgba(217, 119, 87, 0.18), transparent 60%),
    linear-gradient(135deg, #2e2b25 0%, #1a1915 100%);
  overflow: hidden;
}

.article-cover[data-topic="rag"] {
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 176, 111, 0.25), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(217, 119, 87, 0.2), transparent 55%),
    linear-gradient(135deg, #2e2b25 0%, #1a1915 100%);
}

.article-cover[data-topic="memory"] {
  background:
    radial-gradient(circle at 70% 30%, rgba(142, 169, 196, 0.22), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(143, 167, 143, 0.18), transparent 55%),
    linear-gradient(135deg, #26241f 0%, #1a1915 100%);
}

.article-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 241, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 232, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.article-cover-tag {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(26, 25, 21, 0.6);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.article-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
  transition: color 200ms ease;
}

.article-card:hover .article-title {
  color: var(--accent);
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

/* Recognition list */
.recognition-list {
  list-style: none;
}

.recognition-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.recognition-list li:first-child {
  border-top: none;
}

.recognition-title {
  color: var(--text);
  font-size: 15px;
}

.recognition-meta {
  color: var(--accent-sage);
  font-family: var(--font-mono);
  font-size: 13px;
}

.recognition-link {
  border-bottom: none;
  display: inline-block;
}

.recognition-link .recognition-title {
  border-bottom: 1px solid var(--border);
  transition: color 200ms ease, border-color 200ms ease;
  padding-bottom: 1px;
}

.recognition-link:hover {
  border-bottom: none;
}

.recognition-link:hover .recognition-title {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Contact form */
.contact-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.field span em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 200ms ease, background 200ms ease;
  width: 100%;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

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

.form-submit {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 200ms ease, transform 100ms ease;
}

.form-submit:hover {
  background: #c5663f;
}

.form-submit:active {
  transform: translateY(1px);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  font-size: 13px;
  color: var(--text-muted);
}

.form-status.success {
  color: var(--accent-sage);
}

.form-status.error {
  color: var(--accent);
}

/* Social row */
.social-row {
  margin-top: 32px;
  font-size: 14px;
  max-width: none;
}

/* Scroll progress bar — fills as the page scrolls */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 20;
  will-change: transform;
  transition: transform 80ms linear;
}

/* Vertical social-icon rail — fixed right-edge, icons only */
.social-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
  opacity: 0;
  animation: rail-in 600ms cubic-bezier(0.22, 1, 0.36, 1) 700ms forwards;
}

.social-rail a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  border: none !important;
  text-decoration: none;
  transition: color 200ms ease, transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.social-rail a svg {
  width: 16px;
  height: 16px;
  display: block;
}

.social-rail a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

@keyframes rail-in {
  from { opacity: 0; transform: translateY(-50%) translateX(8px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@media (max-width: 1100px) {
  .social-rail { display: none; }
}

/* Section progress dots — fixed left-edge scroll-spy nav */
.section-dots {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 5;
}

.section-dots a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none !important;
  position: relative;
}

.section-dots a span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 200ms ease;
}

.section-dots a:hover span {
  background: var(--text-secondary);
  transform: scale(1.4);
}

.section-dots a.active span {
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.section-dots a::before {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.section-dots a:hover::before {
  opacity: 1;
}

@media (max-width: 1100px) {
  .section-dots {
    display: none;
  }
}

/* Footer */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gutter);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Section fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card-level fade-up — staggers entries/projects/cards individually */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero sequential reveal on page load */
.hero-photo,
.hero h1,
.hero-role,
.hero-status,
.hero .prose {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-reveal 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-photo {
  animation-delay: 0ms;
}

.hero h1 {
  animation:
    hero-reveal 800ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards,
    hero-shimmer 2200ms cubic-bezier(0.4, 0, 0.2, 1) 1100ms 1 forwards;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

@keyframes hero-shimmer {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}

.hero-role {
  animation-delay: 220ms;
}

.hero-status {
  animation-delay: 360ms;
}

.hero .prose {
  animation-delay: 500ms;
}

@keyframes hero-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover micro-interactions */
.project,
.entry,
.expertise-card {
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project:hover,
.entry:hover,
.expertise-card:hover {
  transform: translateY(-3px);
}

.project h3 {
  transition: color 250ms ease;
}

.project:hover h3 {
  color: var(--accent);
}

.entry-logo {
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 300ms ease;
}

.entry:hover .entry-logo {
  transform: scale(1.07);
  border-color: var(--accent);
}

.entry-date {
  transition: color 250ms ease;
}

.entry:hover .entry-date {
  color: var(--text-secondary);
}

.stat {
  transition: background 300ms ease;
}

.stat:hover {
  background: rgba(217, 119, 87, 0.05);
}

.stat-num {
  transition: color 300ms ease;
}

.stat:hover .stat-num {
  color: var(--accent);
}

.expertise-body h3 {
  transition: color 250ms ease;
}

.expertise-card:hover .expertise-body h3 {
  color: var(--accent-amber);
}

.expertise-num {
  transition: color 250ms ease;
}

.expertise-card:hover .expertise-num {
  color: var(--accent-amber);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade-in,
  .fade-up,
  .section h2 {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-photo,
  .hero h1,
  .hero-role,
  .hero-status,
  .hero .prose {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .project,
  .entry,
  .expertise-card,
  .project h3,
  .entry-logo,
  .entry-date,
  .stat,
  .stat-num,
  .expertise-body h3,
  .expertise-num,
  .tech-chips li {
    transition: none;
  }
  .project:hover,
  .entry:hover,
  .expertise-card:hover,
  .tech-chips li:hover {
    transform: none;
  }
  .entry:hover .entry-logo {
    transform: none;
  }
}

/* Tablet & narrower — switch to hamburger nav */
@media (max-width: 880px) {
  :root {
    --gutter: 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(26, 25, 21, 0.96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 4px var(--gutter) 16px;
    gap: 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
  }

  .nav.open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    border-top: 1px solid var(--border);
  }

  .nav-links li:first-child {
    border-top: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 15px;
  }

  .nav-links a::after {
    display: none;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --section-gap: 64px;
  }

  .section {
    scroll-margin-top: 64px;
  }

  .nav {
    padding: 16px var(--gutter);
    gap: 16px;
  }

  .hero {
    padding-top: 56px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-photo {
    width: 110px;
    height: 110px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-photo {
    width: 110px;
    height: 110px;
  }

  .stat-feature {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px 14px;
  }

  .stat-feature-num {
    font-size: 72px;
  }

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

  .stat {
    padding: 18px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  /* Reset 3-col rules for 2-col mobile layout */
  .stat:nth-child(3n) {
    border-right: 1px solid var(--border);
  }
  .stat:nth-child(-n+3) {
    border-bottom: 1px solid var(--border);
  }

  /* Right column: no right border */
  .stat:nth-child(even) {
    border-right: none;
  }

  /* Last two stats: no bottom border */
  .stat:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .github-graph {
    border-radius: 6px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .github-graph {
    padding: 16px;
  }

  /* Stack entry header: logo + title in row 1, role in row 2, date in row 3 */
  .entry-header {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "logo title"
      "logo role"
      "date date";
    column-gap: 12px;
    row-gap: 4px;
  }

  .entry-logo {
    width: 40px;
    height: 40px;
  }

  .entry-date {
    text-align: left;
    margin-top: 6px;
  }

  .entry-list,
  .tech-chips--indent,
  .entry > .prose {
    margin-left: 0;
  }

  .hero-status {
    font-size: 12px;
    padding: 5px 12px;
  }

  .recognition-list li {
    flex-direction: column;
    gap: 4px;
  }

  .footer {
    padding: 32px var(--gutter);
  }
}
