:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-soft: #e8f0ff;
  --ink: #172033;
  --muted: #5f6f89;
  --line: #d7e2f3;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --coral: #3b82f6;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(37, 99, 235, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 248, 255, 0.9);
  border-bottom: 1px solid rgba(215, 226, 243, 0.9);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand-text {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 14px;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  place-items: center;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 2px 0;
}

section {
  padding: 88px 0;
  scroll-margin-top: 78px;
}

.hero {
  background: var(--bg);
  min-height: auto;
  display: flex;
  align-items: center;
  padding: 58px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero h1,
.section-title {
  letter-spacing: 0;
  line-height: 1.04;
}

.hero h1 {
  max-width: 700px;
  font-size: clamp(2.05rem, 4.8vw, 3.95rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero-description {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.45vw, 1.08rem);
  margin-top: 18px;
}

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

.btn {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface);
}

.hero-photo {
  border: 8px solid var(--surface);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-width: 300px;
  justify-self: end;
  transform: translate(-24px, -22px);
}

.hero-photo img {
  aspect-ratio: 1;
  background: var(--surface-soft);
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.hero-photo figcaption {
  display: none;
}

.section-light {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.education,
.projects {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.split-section,
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 7vw, 84px);
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  font-weight: 800;
  max-width: 850px;
}

.section-copy {
  color: var(--muted);
  display: grid;
  font-size: 1.05rem;
  gap: 18px;
}

.section-heading {
  margin-bottom: 42px;
}

.education-timeline {
  display: grid;
  gap: 0;
  margin-top: 18px;
  position: relative;
}

.education-timeline::before {
  background: var(--line);
  bottom: 18px;
  content: "";
  left: 148px;
  position: absolute;
  top: 18px;
  width: 2px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 56px;
  padding: 0 0 28px;
  position: relative;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  background: var(--accent);
  border: 5px solid var(--bg);
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 140px;
  position: absolute;
  top: 8px;
  width: 16px;
  z-index: 1;
}

.timeline-year {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
  padding-top: 6px;
  text-align: right;
  text-transform: uppercase;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
}

.timeline-content h3,
.project-card h3 {
  font-size: 1.12rem;
  line-height: 1.25;
}

.timeline-content p,
.project-card p {
  color: var(--muted);
  margin-top: 7px;
}

.section-dark {
  background: var(--dark);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-dark .eyebrow {
  color: #93c5fd;
}

.section-dark .section-title,
.section-dark .contact-copy {
  color: var(--white);
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.skill-group {
  background: var(--dark-soft);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 22px;
}

.skill-group:last-child {
  grid-column: 1 / -1;
}

.skill-group h3 {
  color: var(--white);
  font-size: clamp(1.12rem, 1.7vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span {
  background: rgba(147, 197, 253, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 14px;
}

.project-group {
  margin-top: 38px;
}

.project-group:first-of-type {
  margin-top: 0;
}

.project-group-title {
  color: var(--ink);
  font-size: clamp(1.12rem, 1.7vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.technical-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 290px;
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.1);
  transform: translateY(-3px);
}

.featured-project {
  background: var(--surface);
  color: var(--ink);
}

.featured-project .project-meta,
.featured-project p,
.featured-project .text-link {
  color: inherit;
}

.featured-project .project-meta {
  color: var(--coral);
}

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

.featured-project .text-link {
  color: var(--accent-dark);
}

.creative-card {
  background: #eef5ff;
}

.opensource-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.opensource-card-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.opensource-card h3,
.gsoc-card h3 {
  font-size: clamp(1.12rem, 1.55vw, 1.38rem);
  line-height: 1.25;
}

.pr-list {
  display: grid;
  gap: 14px;
}

.pr-item {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.pr-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.pr-header a {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.pr-header a:hover {
  color: var(--accent-dark);
}

.status-badge {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 10px;
}

.status-badge.merged {
  background: #dcfce7;
  color: #166534;
}

.status-badge.review {
  background: #e8f0ff;
  color: var(--accent-dark);
}

.pr-item p,
.gsoc-card p {
  color: var(--muted);
  margin-top: 10px;
}

.pr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pr-tags span {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 13px;
}

.gsoc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-top: 18px;
  padding: 24px;
}

.project-meta {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.project-card h3 {
  font-size: clamp(1.12rem, 1.55vw, 1.38rem);
  min-height: 2.6em;
}

.project-card p {
  margin-bottom: 28px;
  min-height: 5.2em;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-copy {
  color: rgba(255, 255, 255, 0.76);
  margin-top: 22px;
  max-width: 560px;
}

.contact-links {
  display: grid;
  gap: 12px;
}

.contact-links a {
  background: var(--dark-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--white);
  font-weight: 700;
  padding: 18px;
}

.contact-links a:hover {
  background: #26344f;
}

.footer {
  background: #08111f;
  color: rgba(255, 255, 255, 0.78);
  padding: 28px 0;
}

.footer-content {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer a {
  color: var(--white);
  font-weight: 700;
}

@media (max-width: 840px) {
  .nav-toggle {
    display: grid;
  }

  .nav-menu {
    background: rgba(245, 248, 255, 0.98);
    border-bottom: 1px solid var(--line);
    display: none;
    left: 0;
    padding: 14px 20px 22px;
    position: absolute;
    right: 0;
    top: 74px;
  }

  .nav-menu.active {
    display: block;
  }

  .nav-list {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-link {
    display: flex;
    padding: 12px 0;
  }

  .hero-grid,
  .split-section,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-photo {
    max-width: 260px;
    justify-self: start;
    transform: none;
  }

  .skill-groups,
  .projects-grid,
  .technical-grid,
  .writing-grid {
    grid-template-columns: 1fr;
  }

  .skill-group:last-child {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  section {
    padding: 66px 0;
  }

  .brand-text {
    font-size: 0.92rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .hero-actions,
  .footer-content,
  .footer-links {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .education-timeline::before {
    left: 8px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: 34px;
  }

  .timeline-item::before {
    left: 0;
  }

  .timeline-year {
    padding-top: 0;
    text-align: left;
  }

  .opensource-card-header,
  .pr-header {
    flex-direction: column;
  }
}
