:root {
  --bg: #faf9f7;
  --bg-alt: #f0eee7;
  --text: #1f2328;
  --text-muted: #6b7280;
  --accent: #6c5ce7;
  --accent-soft: rgba(108, 92, 231, 0.12);
  --coral: #ff6b4a;
  --coral-soft: rgba(255, 107, 74, 0.14);
  --border: #e6e2d9;
  --radius: 10px;
  --max-width: 760px;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(31, 35, 40, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

h1, h2, h3, .stat-value, .logo {
  font-family: var(--font-display);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
  position: relative;
  padding-bottom: 0.2rem;
}

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

.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

.hero-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .hero-grid {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.25rem;
  }

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

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hero .title {
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.hero-support {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 0.9rem;
}

.hero-tags {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #8172ea;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
  max-width: 560px;
}

.about-text {
  color: var(--text-muted);
  max-width: 640px;
}

.about-text + .about-text {
  margin-top: 1rem;
}

/* Impact stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* What I Build */
.build-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.build-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.build-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.build-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Experience */
.job {
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.job:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.job-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

.job-role {
  font-size: 1.1rem;
  font-weight: 700;
}

.job-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  line-height: 1;
}

.company-badge--aws {
  background: #ff9900;
  color: #0b0d12;
  text-transform: lowercase;
}

.company-badge--amex {
  background: #006fcf;
  color: #ffffff;
  text-transform: uppercase;
}

.job-dates {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.job-summary {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 640px;
}

.job-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.job-list li {
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}

.job-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Projects */
.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.project-card:last-child {
  margin-bottom: 0;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-header .project-title {
  margin-bottom: 0;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.project-link:hover {
  text-decoration: underline;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.arch-diagram {
  width: 100%;
  height: auto;
  margin-bottom: 1.25rem;
}

.project-body p {
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.project-body .job-list {
  margin-top: 0.75rem;
}

/* Open Source */
.oss-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.oss-card:last-child {
  margin-bottom: 0;
}

.oss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.oss-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.oss-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.oss-status--merged {
  background: rgba(47, 138, 69, 0.12);
  color: #2f7d43;
}

.oss-status--open {
  background: var(--accent-soft);
  color: var(--accent);
}

.oss-pr-title {
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.oss-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.oss-desc code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

.oss-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.oss-link:hover {
  text-decoration: underline;
}

.oss-compact-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.oss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.oss-row:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.oss-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.oss-row-repo {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.oss-row-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.oss-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.oss-view-all:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.oss-communities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin-bottom: 2rem;
}

.oss-communities a {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.oss-communities a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Skills */
.skill-group {
  margin-bottom: 1.75rem;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-category {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
}

.skills-grid li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* Education */
.edu-item {
  margin-bottom: 1.25rem;
}

.edu-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.edu-degree {
  font-weight: 700;
  font-size: 1rem;
}

.edu-dates {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.edu-school {
  color: var(--accent);
  font-size: 0.9rem;
}

.edu-honors {
  margin-top: 1.5rem;
}

.projects-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.contact-links a {
  color: var(--accent);
  width: fit-content;
}

.contact-links a:hover {
  text-decoration: underline;
}

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .build-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 1rem;
  }

  .hero {
    padding: 4rem 1.25rem 3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Scroll reveal (progressive enhancement — see script.js) */
.reveal.reveal-init {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-init.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stats-grid .stat-card:nth-child(1) { transition-delay: 0s; }
.stats-grid .stat-card:nth-child(2) { transition-delay: 0.08s; }
.stats-grid .stat-card:nth-child(3) { transition-delay: 0.16s; }
.stats-grid .stat-card:nth-child(4) { transition-delay: 0.24s; }

.build-grid .build-card:nth-child(1) { transition-delay: 0s; }
.build-grid .build-card:nth-child(2) { transition-delay: 0.08s; }
.build-grid .build-card:nth-child(3) { transition-delay: 0.16s; }
.build-grid .build-card:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-init {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
