:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --bg-alt: #efede7;
  --text: #1b1c1e;
  --muted: #5b616a;
  --accent: #1f4f46;
  --border: #d5d1c7;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(27, 28, 30, 0.08);
  --max-width: 1100px;
  --radius: 18px;
  --font-sans: "Space Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Libre Baskerville", "Georgia", serif;
}

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

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(31, 79, 70, 0.08), transparent 45%),
    radial-gradient(circle at 15% 40%, rgba(31, 79, 70, 0.05), transparent 50%),
    linear-gradient(180deg, #f7f6f2 0%, #f2f1ed 100%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: min(100% - 3rem, var(--max-width));
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
}

.hero {
  padding-top: 4rem;
  padding-bottom: 3rem;
}

/* New Hero Styles */
.hero-intro {
  margin-bottom: 2rem;
}

.hero-greeting {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero h1::after {
  display: none;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Collapsible Bio */
.bio-expandable {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.bio-preview p,
.bio-full p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.bio-preview p strong {
  color: var(--text);
}

.bio-full {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.bio-full.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 1rem;
}

.bio-full p {
  margin-bottom: 0.75rem;
}

.bio-full p:last-child {
  margin-bottom: 0;
}

.bio-full a {
  color: var(--accent);
  font-weight: 500;
}

.bio-full a:hover {
  text-decoration: underline;
}

.bio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: gap 0.2s ease;
}

.bio-toggle:hover {
  gap: 0.6rem;
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.bio-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

.section.alt {
  background: var(--bg-alt);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 246, 242, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  gap: 2rem;
}

.brand-link {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
}

.brand-link:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  transition: color 0.2s ease;
}

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

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  position: relative;
}

h1::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 2px;
  margin-top: 0.75rem;
  background: var(--accent);
  opacity: 0.5;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 52rem;
}

.lead + .lead {
  margin-top: 1rem;
}

.lead a {
  color: var(--accent);
  font-weight: 500;
}

.lead a:hover {
  text-decoration: underline;
}

.links-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: border 0.2s ease, color 0.2s ease;
}

.pill:hover,
.pill:focus {
  color: var(--accent);
  border-color: var(--accent);
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header p {
  color: var(--muted);
  max-width: 40rem;
}

.section-header-spaced {
  margin-top: 3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(27, 28, 30, 0.12);
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.callout {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  align-items: center;
}

.project-callout {
  margin-bottom: 2rem;
}

.label {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

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

.button {
  background: var(--accent);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.updates {
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.updates li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.date {
  font-weight: 600;
  color: var(--accent);
  min-width: 7rem;
}

.update-text {
  color: var(--muted);
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: #f4f3ef;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--accent);
}

.project-hero {
  padding: 5rem 0 3rem;
}

.project-meta {
  color: var(--muted);
  max-width: 48rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-block {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.project-block ul {
  margin-left: 1.25rem;
  color: var(--muted);
}

.project-block li {
  margin-bottom: 0.5rem;
}

.metrics {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--muted);
}

.metrics span {
  font-weight: 600;
  color: var(--text);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.project-links a {
  color: var(--accent);
  font-weight: 600;
}

/* Education highlight */
.education-highlight {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.education-highlight p {
  color: var(--muted);
  margin-top: 0.5rem;
}

.education-highlight p:first-of-type {
  margin-top: 0.75rem;
}

/* Skills section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.skill-category h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: var(--bg-alt);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

/* Card labels */
.card-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(31, 79, 70, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Tech stack in callouts */
.tech-stack {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

.tech-stack strong {
  color: var(--text);
}

/* Experience section */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.experience-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.experience-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.experience-org {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.experience-item p:last-child {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Header scroll state */
.site-header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Multiple callouts spacing */
.callout + .callout {
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    gap: 1rem;
  }

  .callout {
    flex-direction: column;
    align-items: flex-start;
  }

  .updates li {
    flex-direction: column;
    gap: 0.35rem;
  }

  .date {
    min-width: 0;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 3.5rem 0;
  }

  .container {
    width: min(100% - 2rem, var(--max-width));
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .stat {
    min-width: 80px;
  }

  .links-row {
    gap: 0.5rem;
  }

  .pill {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}
