:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --accent: #06b6d4;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(248, 250, 252, 0.75);
  --hero-glow: rgba(6, 182, 212, 0.16);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #020617;
  --surface: rgba(15, 23, 42, 0.8);
  --surface-strong: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --primary: #60a5fa;
  --accent: #22d3ee;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  --header-bg: rgba(2, 6, 23, 0.7);
  --hero-glow: rgba(34, 211, 238, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, var(--hero-glow), transparent 24%), var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 0.8rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

.section {
  padding: 6rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-weight: 500;
  padding: 0.35rem 0;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.1rem;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: transform 0.25s ease;
}

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

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.theme-toggle,
.nav-toggle,
.back-to-top {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle,
.back-to-top {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.24rem;
  padding: 0.3rem;
  background: transparent;
}

.nav-toggle span {
  width: 1.35rem;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.theme-toggle:hover,
.nav-toggle:hover,
.back-to-top:hover,
.btn:hover,
.card:hover {
  transform: translateY(-2px);
}

.hero {
  padding-top: 5rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero h1,
.section-heading h2,
.blog-card h2,
.contact-copy h2,
.resume-card h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.3rem, 3.7vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero-role {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  margin-bottom: 1rem;
}

.hero-role__text {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 700;
  color: var(--accent);
}

.hero-description,
.about-copy p,
.blog-card p,
.contact-copy p,
.resume-card p,
.hero-card__body p,
.timeline-item p,
.card p {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.8rem 0 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

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

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}

.hero-highlights li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
}

.hero-card,
.about-card,
.blog-card,
.resume-card,
.contact-form,
.timeline-item,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 1.4rem;
}

.hero-card {
  padding: 1rem;
  overflow: hidden;
}

.hero-card img {
  width: 100%;
  border-radius: 1rem;
}

.hero-card__body {
  padding: 1.2rem 0.3rem 0.4rem;
}

.hero-card__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.87rem;
  font-weight: 700;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.about-card,
.contact-form,
.blog-card,
.resume-card {
  padding: 1.6rem;
}

.about-card ul {
  padding-left: 1.1rem;
  margin: 0;
}

.about-card li + li {
  margin-top: 0.65rem;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 2rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  padding: 1.4rem 1.5rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 1.5rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.timeline-item h3,
.card h3,
.about-card h3 {
  margin: 0 0 0.35rem;
}

.timeline-item .meta {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.timeline-item ul,
.card ul {
  padding-left: 1.1rem;
  margin: 0.8rem 0 0;
}

.skills-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.skill-card,
.project-card,
.talk-card {
  padding: 1.25rem;
  border-radius: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.skill-card:hover,
.project-card:hover,
.talk-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.24);
}

.skill-card h3,
.project-card h3,
.talk-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tag-list span,
.tag {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.84rem;
}

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

.project-actions a {
  color: var(--primary);
  font-weight: 600;
}

.blog-card,
.resume-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.45rem;
}

.contact-list a {
  color: var(--primary);
  font-weight: 600;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 0.95rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
}

.site-footer {
  padding: 2rem 0 3rem;
}

.footer-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.footer-title {
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .hero-grid,
  .about-grid,
  .contact-grid,
  .skills-grid,
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid,
  .about-grid,
  .contact-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 780px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 4.5rem;
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .hero-grid,
  .about-grid,
  .contact-grid,
  .skills-grid,
  .card-grid,
  .blog-card,
  .resume-card,
  .footer-shell {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 4.5rem 0;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
