html {
  scroll-behavior: smooth;
}

:root {
  --ink: #0b1220;
  --ink-soft: #162034;
  --text: #2c3446;
  --muted: #5c667a;
  --line: #e3e7ef;
  --card: #ffffff;
  --bg: #f6f7fb;
  --accent: #ff6b35;
  --accent-2: #2ec4b6;
  --accent-3: #4666ff;
  --shadow: 0 20px 50px rgba(11, 18, 32, 0.12);
}

body.dark-mode {
  --ink: #f3f4f7;
  --ink-soft: #d6d9e3;
  --text: #c6ccda;
  --muted: #9aa3b5;
  --line: #2c3448;
  --card: #121826;
  --bg: #0b0f1a;
  --accent: #ff8c5a;
  --accent-2: #45d6c6;
  --accent-3: #7d94ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
  background: radial-gradient(circle at 10% 20%, rgba(46, 196, 182, 0.15), transparent 55%),
    radial-gradient(circle at 90% 15%, rgba(255, 107, 53, 0.12), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(70, 102, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

@media (max-width: 768px) {
  .page-container {
    padding: 0 1.1rem 3rem;
  }
}

.main-nav {
  position: relative;
  z-index: 1000;
  width: 100%;
  backdrop-filter: blur(18px);
  background: transparent;
  border-bottom: none;
}

body.dark-mode .main-nav {
  background: transparent;
  border-bottom: none;
}

.main-nav.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: var(--shadow);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

body.dark-mode .main-nav.is-sticky {
  background: var(--bg);
}

.nav-spacer {
  height: 0;
  transition: height 0.2s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  margin: 0 auto;
  position: relative;
}

.main-nav .nav-left .name {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.hamburger {
  display: none !important;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  padding: 0.5rem 0;
  z-index: 1001;
  transition: opacity 0.3s ease;
}

.hamburger span {
  width: 26px;
  height: 3px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
  background-color: var(--accent);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
  background-color: var(--accent);
}

.main-nav .nav-right {
  display: flex !important;
  gap: 1.7rem;
  align-items: center;
}

.main-nav .nav-right a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

.main-nav .nav-right a:hover {
  color: var(--ink);
}

.main-nav .nav-right a.active {
  color: var(--ink);
}

.main-nav .nav-right a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}

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

@media (max-width: 768px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }

  .hamburger {
    display: flex !important;
  }

  .main-nav .nav-right {
    display: none !important;
    position: fixed !important;
    top: 61px !important;
    left: 0 !important;
    right: 0 !important;
    flex-direction: column !important;
    background: var(--card) !important;
    gap: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease !important;
    box-shadow: var(--shadow) !important;
    width: 100% !important;
    z-index: 998 !important;
  }

  .main-nav .nav-right.active {
    display: flex !important;
    max-height: 700px !important;
    padding: 1rem 0 1.4rem !important;
  }

  .main-nav .nav-right a {
    padding: 0.8rem 1.6rem;
    width: 100%;
  }
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3.5rem;
  align-items: center;
  padding: 4.2rem 0 2rem;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  font-size: clamp(2.4rem, 3.5vw, 4.1rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-title-large {
  display: block;
  font-size: clamp(2.8rem, 4vw, 4.5rem);
  color: var(--accent);
}

.hero-info {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(46, 196, 182, 0.12);
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-location {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.4rem;
  align-items: center;
  color: var(--muted);
  margin-bottom: 1.3rem;
}

.hero-location a {
  color: var(--muted);
  text-decoration: none;
}

.hero-location a:hover {
  color: var(--ink);
}

.hero-description {
  font-size: 1.05rem;
  max-width: 520px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.4rem 0 2rem;
}

.hero-tags span {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 15px 35px rgba(255, 107, 53, 0.25);
}

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

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  filter: brightness(1.02);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

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

.hero-image {
  width: 290px;
  height: 360px;
  border-radius: 30px;
  overflow: hidden;
  border: 3px solid rgba(46, 196, 182, 0.3);
  box-shadow: var(--shadow);
  position: relative;
  background: linear-gradient(140deg, rgba(46, 196, 182, 0.15), rgba(255, 107, 53, 0.15));
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-content {
  margin-top: 2rem;
  display: grid;
  gap: 2.5rem;
}

.section {
  background: var(--card);
  padding: 2.3rem;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .btn-primary,
  .btn-secondary {
    transition: none;
  }
}

.section h2 {
  color: var(--ink);
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.section p {
  margin-top: 0.7rem;
}

.experience-list,
.skill-groups,
#projects,
#education {
  display: grid;
  gap: 1.5rem;
}

.experience-item,
.project-item,
.education-item,
.skill-group {
  padding: 1.4rem 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(246, 247, 251, 0.6);
}

body.dark-mode .experience-item,
body.dark-mode .project-item,
body.dark-mode .education-item,
body.dark-mode .skill-group {
  background: rgba(18, 24, 38, 0.6);
}

.item-meta {
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

.experience-item ul {
  padding-left: 1.2rem;
  margin: 0.8rem 0 0;
}

.experience-item li {
  margin-bottom: 0.4rem;
}

.experience-subroles {
  margin-top: 1.1rem;
  display: grid;
  gap: 1rem;
  border-left: 2px dashed rgba(92, 102, 122, 0.35);
  padding-left: 1.1rem;
}

.experience-subrole {
  padding: 0.95rem 1.1rem;
  border-radius: 0;
  border: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(246, 247, 251, 0.6));
  box-shadow: 0 14px 28px rgba(11, 18, 32, 0.08);
  position: relative;
}

.experience-subrole::before {
  content: '';
  position: absolute;
  left: -1.45rem;
  top: 1.15rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.18);
}

body.dark-mode .experience-subroles {
  border-left-color: rgba(154, 163, 181, 0.35);
}

body.dark-mode .experience-subrole {
  background: linear-gradient(135deg, rgba(18, 24, 38, 0.9), rgba(18, 24, 38, 0.6));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.experience-subrole h4 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.experience-subrole ul {
  margin: 0;
  padding-left: 1.2rem;
}

.skills-list {
  list-style: none;
  padding-left: 0;
  margin: 0.8rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.skills-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.skills-list i {
  color: var(--accent-2);
}

.project-item a {
  color: var(--accent-3);
  font-weight: 600;
  text-decoration: none;
}

.project-item a:hover {
  text-decoration: underline;
}

.year-location-container {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.notable-courses-text strong {
  color: var(--ink);
}

#contact form {
  display: grid;
  gap: 1rem;
}

#contact input,
#contact textarea {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(246, 247, 251, 0.5);
  color: var(--ink);
}

#contact input::placeholder,
#contact textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

body.dark-mode #contact input,
body.dark-mode #contact textarea {
  background: rgba(18, 24, 38, 0.7);
}

body.dark-mode #contact input::placeholder,
body.dark-mode #contact textarea::placeholder {
  color: #c2c8d6;
  opacity: 0.9;
}

#contact textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-social-links {
  margin-top: 2rem;
}

.social-icons-contact {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  box-shadow: var(--shadow);
}

footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero {
    padding-top: 3rem;
  }

  .hero-image {
    width: 260px;
    height: 320px;
  }
}

@media (max-width: 600px) {
  .page-container {
    padding: 0 1rem 2.5rem;
  }

  .nav-container {
    padding: 0.7rem 0.9rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .hero-text h1 {
    font-size: 2.3rem;
  }

  .hero-title-large {
    font-size: 2.8rem;
  }

  .section {
    padding: 1.6rem;
  }

  .experience-item,
  .project-item,
  .education-item,
  .skill-group {
    padding: 1.2rem;
  }

  .hero-location {
    gap: 0.6rem 1rem;
    font-size: 0.95rem;
  }

  .hero-tags span {
    font-size: 0.85rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .skills-list {
    grid-template-columns: 1fr;
  }

  .year-location-container {
    flex-direction: column;
    gap: 0.4rem;
  }

  #contact input,
  #contact textarea {
    font-size: 0.95rem;
  }
}

@media (max-width: 420px) {
  .hero {
    gap: 2.2rem;
  }

  .hero-image {
    width: 230px;
    height: 290px;
    border-radius: 24px;
  }

  .section h2 {
    font-size: 1.55rem;
  }
}
