:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-alt: #edf1f5;
  --panel: #ffffff;
  --panel-strong: #eef3f7;
  --text: #141a1f;
  --muted: #536274;
  --border: rgba(20, 26, 31, 0.12);
  --accent: #1c7ae3;
  --accent-strong: #1458b5;
  --shadow: 0 18px 45px rgba(20, 26, 31, 0.08);
}

body.dark {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-alt: #121a24;
  --panel: #141d2a;
  --panel-strong: #1a2635;
  --text: #edf3f8;
  --muted: #9aa8b7;
  --border: rgba(237, 243, 248, 0.1);
  --accent: #7ab6ff;
  --accent-strong: #9ac8ff;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  opacity: 0;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.4s ease;
}

body.loaded {
  opacity: 1;
}

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

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

button {
  font: inherit;
}

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

.section {
  padding: 5rem 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 246, 248, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.scrolled {
  background: rgba(244, 246, 248, 0.85);
  border-color: var(--border);
  box-shadow: 0 10px 22px rgba(20, 26, 31, 0.06);
}

body.dark .site-header {
  background: rgba(13, 17, 23, 0.72);
}

body.dark .site-header.scrolled {
  background: rgba(13, 17, 23, 0.88);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

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

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-short {
  display: none;
}

.highlight {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.96rem;
  color: var(--muted);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--text);
}

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

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.toggle-icon {
  font-size: 1.1rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero .floating-orb {
  z-index: 1;
  opacity: 0.06;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.77rem;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.1;
}

.hero-name {
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  letter-spacing: -0.05em;
  animation: fadeUp 0.7s ease both;
}

.intro {
  max-width: 42rem;
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 1.08rem;
  color: var(--muted);
  animation: fadeUp 0.7s ease 0.1s both;
}

.opportunity-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.tagline {
  min-height: 2.2rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  animation: fadeUp 0.7s ease 0.2s both;
}

.typing-text {
  display: inline-block;
  min-width: 1px;
}

.typing-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 0.15rem;
  vertical-align: bottom;
  background: var(--accent);
  animation: blink 0.8s steps(1) infinite;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
.button:focus-visible,
.project-link:hover,
.project-link:focus-visible,
.contact-box a:hover,
.contact-box a:focus-visible,
.social-links a:hover,
.social-links a:focus-visible,
.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-strong);
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.social-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  color: var(--muted);
}

.social-links a,
.contact-box a,
.contact-links a,
.project-link {
  color: var(--accent);
  font-weight: 600;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.photo-frame {
  width: min(100%, 360px);
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(28, 122, 227, 0.12), rgba(28, 122, 227, 0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.05em;
}

.reveal,
.reveal-card,
.reveal-section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible,
.reveal-card.visible,
.reveal-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-card {
  transition-delay: 0.06s;
}

.project-card.reveal-card {
  transition-delay: 0.1s;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
}

.about-grid p,
.info-card p,
.education-card p,
.project-card p,
.timeline-content li,
.skill-group li {
  color: var(--muted);
}

.info-card,
.education-card,
.project-card,
.skill-group,
.timeline-content,
.contact-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.info-card {
  padding: 1.4rem 1.3rem;
}

.info-card h3,
.education-card h3,
.skill-group h3,
.project-header h3,
.timeline-content h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 1rem;
  align-items: flex-start;
}

.timeline-item.smaller-margin {
  margin-left: 0.75rem;
}

.timeline-bullet {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.7rem;
  box-shadow: 0 0 0 5px rgba(28, 122, 227, 0.12);
}

.timeline-content {
  padding: 1.2rem 1.3rem;
}

.role-blocks {
  display: grid;
}

.role-block {
  position: relative;
  margin-left: 0.25rem;
  padding: 0 0 1.2rem 1.15rem;
  border-left: 1px solid var(--border);
}

.role-block:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.role-block + .role-block {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.role-block::before {
  position: absolute;
  top: 0.4rem;
  left: -0.3rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.role-block + .role-block::before {
  top: 1.5rem;
}

.role {
  margin: 0 0 0.6rem;
  font-weight: 600;
  color: var(--text);
}

.role-note {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-content ul,
.research-list,
.skill-group ul {
  margin: 0;
  padding-left: 1.2rem;
}

.project-grid,
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card {
  padding: 1.3rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(20, 26, 31, 0.11);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status.live {
  background: rgba(48, 184, 119, 0.12);
  color: #16985a;
}

.status.coming {
  background: rgba(255, 165, 0, 0.12);
  color: #b67400;
}

.status.progress {
  background: rgba(255, 165, 0, 0.12);
  color: #b67400;
}

.project-tech {
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
}

.project-link,
.project-link.muted {
  display: inline-flex;
  margin-top: 0.5rem;
}

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

.skill-group {
  padding: 1.3rem;
}

.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  list-style: none;
  padding-left: 0;
}

.skill-group li {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
}

.skill-tag {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.skill-tag.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.education-stack {
  display: grid;
  gap: 1rem;
}

.education-card {
  padding: 1.3rem 1.4rem;
}

.degree {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-weight: 700;
  color: var(--text);
}

.contact-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-box {
  padding: 1.2rem 1.4rem;
  display: grid;
  gap: 1rem;
}

.contact-box > a {
  font-size: 1.15rem;
}

.copy-email {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.copy-email:hover,
.copy-email:focus-visible {
  color: var(--accent-strong);
}

.copy-status {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.3rem;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.35;
  pointer-events: none;
  animation: float 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 200px;
  height: 200px;
  background: rgba(28, 122, 227, 0.18);
  top: 25px;
  left: 4%;
}

.orb-2 {
  width: 180px;
  height: 180px;
  background: rgba(37, 182, 153, 0.14);
  right: 8%;
  top: 8%;
  animation-delay: 1.4s;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: rgba(142, 120, 255, 0.12);
  bottom: -30px;
  left: 38%;
  animation-delay: 0.8s;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0 2rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 15;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 1.45rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@keyframes float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(0, -18px, 0) scale(1.08);
  }
}

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

  .site-nav {
    display: none;
  }
}

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

  .hero {
    padding-top: 3rem;
  }

  .hero-actions,
  .social-links,
  .contact-links,
  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .button {
    width: 100%;
  }

  .nav-wrap {
    min-height: 64px;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
  }

  .floating-orb {
    opacity: 0.18;
  }
}

@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;
  }

  body,
  .reveal,
  .reveal-card,
  .reveal-section,
  .skill-tag {
    opacity: 1 !important;
    transform: none !important;
  }
}
