html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

:root {
  --apple-blue: #007AFF;
  --apple-gray: #F5F5F7;
  --apple-dark: #1D1D1F;
  --apple-light: #FAFAFC;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--apple-dark);
  background-color: var(--apple-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

nav ul li a {
  color: var(--apple-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
  padding: 8px 0;
}

nav ul li:hover > a {
  color: var(--apple-blue);
}

/* Dropdown menu styling */
nav ul li {
  position: relative;
}

nav ul li .dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  min-width: 180px;
  width: max-content;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 200;
}

nav ul li:hover .dropdown-menu,
nav ul li:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

nav ul li .dropdown-menu li {
  list-style: none;
  padding: 0;
}

nav ul li .dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--apple-dark);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

nav ul li .dropdown-menu a:hover {
  background: rgba(0, 122, 255, 0.12);
}

#hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 120px 0 80px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
}

#hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

#hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 400;
  opacity: 0.9;
  max-width: 900px;
  line-height: 1.5;
  margin: 0 auto;
}

section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 16px 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.project-nav a,
.project-nav .nav-disabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--apple-dark);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
}

.project-nav a {
  transition: background 0.2s ease, transform 0.12s ease;
}

.project-nav a:hover {
  background: rgba(0, 122, 255, 0.12);
  transform: translateY(-1px);
}

.project-nav a:active {
  transform: translateY(0);
}

.project-nav .nav-disabled {
  color: rgba(0, 0, 0, 0.5);
  cursor: default;
}

section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 48px;
  text-align: center;
  color: var(--apple-dark);
  letter-spacing: -0.02em;
}

#projects {
  max-width: 1200px;
  overflow: visible;
  padding-top: 72px;
  padding-bottom: 72px;
}

.projects-shell {
  width: 100%;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  row-gap: 12px;
  transform: translateX(-413px);
  overflow: visible;
}

.projects-header {
  width: 100%;
  margin: 0;
  text-align: center;
}

.projects-title {
  font-size: clamp(2.45rem, 3.8vw, 2.9rem);
  margin-bottom: 0;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
}

.project-list {
  display: flex;
  gap: var(--carousel-gap);
  padding: 0;
  margin-top: 0;
  will-change: transform;
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-carousel {
  --carousel-gap: clamp(18px, 2.6vw, 28px);
  --carousel-card-width: min(100%, 860px);
  position: relative;
  width: min(100%, 1120px);
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.projects-viewport {
  overflow: visible;
  width: 100%;
  padding: 16px 0 18px;
  margin: -16px 0 -18px;
}

.projects-viewport:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.65);
  outline-offset: 4px;
}

.carousel-dots {
  --dot-slot: 20px;
  position: relative;
  width: calc(var(--dot-slot) * 7);
  height: 14px;
  margin: 0 0 50px;
  overflow: hidden;
  pointer-events: auto;
}

.carousel-dot-track {
  display: flex;
  align-items: center;
  width: max-content;
  transform: translateX(calc(var(--dot-slot) * -1));
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-dot {
  flex: 0 0 var(--dot-slot);
  width: var(--dot-slot);
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.carousel-dot::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.3);
  opacity: 0;
  transform: translateX(0) scale(0.96);
  transition:
    width 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-dot[data-dot-role='hidden']::before {
  width: 3px;
  height: 3px;
  opacity: 0;
  transform: translateX(0) scale(0.7);
}

.carousel-dot[data-dot-role='far']::before {
  width: 4px;
  height: 4px;
  opacity: 0.28;
  transform: translateX(0) scale(1);
}

.carousel-dot[data-dot-role='mid']::before {
  width: 5px;
  height: 5px;
  opacity: 0.44;
  transform: translateX(0) scale(1);
}

.carousel-dot[data-dot-role='near']::before {
  width: 6px;
  height: 6px;
  opacity: 0.72;
  background: rgba(29, 29, 31, 0.52);
  transform: translateX(0) scale(1);
}

.carousel-dot[data-dot-role='active']::before {
  width: 26px;
  height: 8px;
  background: rgba(29, 29, 31, 0.76);
  opacity: 1;
  transform: translateX(0) scale(1);
}

.carousel-dot[data-dot-role='active'] {
  cursor: default;
}

.project {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 36px 36px 32px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: transform 0.24s ease, border-color 0.24s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 0 0 var(--carousel-card-width);
  min-height: 630px;
  cursor: pointer;
}

.project > * {
  position: relative;
  z-index: 1;
}

.project:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 23, 42, 0.08);
}

.project[data-card-position='side'] {
  opacity: 0.94;
}

.project[data-card-position='active'] {
  opacity: 1;
}

.project h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--apple-dark);
  letter-spacing: -0.01em;
}

.project p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #86868b;
  margin-bottom: 24px;
  max-width: 48ch;
  text-align: left;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: auto;
}

.project a {
  display: inline-flex;
  align-items: center;
  color: var(--apple-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.project a:hover {
  color: #0056cc;
}

#skills {
  background-color: var(--apple-gray);
  padding-top: 72px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}

.skill-tag {
  background: white;
  color: var(--apple-dark);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

#contact {
  background-color: white;
  text-align: center;
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
}

.contact-content p {
  font-size: 1.1rem;
  color: #86868b;
  margin-bottom: 16px;
  text-align: center;
}

.contact-content p:first-child {
  font-size: 1.25rem;
  margin-bottom: 24px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}

.contact-links a {
  color: var(--apple-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-links a:hover {
  color: #0056cc;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: #f5f5f7;
  border-top: 1px solid #d2d2d7;
}

footer p {
  margin: 0;
  font-size: 0.85rem;
  color: #86868b;
}

/* Responsive */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 16px;
  }

  #hero {
    padding: 80px 24px 60px;
  }

  #hero h1 {
    font-size: 2.5rem;
  }

  section {
    padding: 60px 24px;
  }

  section h2 {
    font-size: 2rem;
  }

  #projects {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 28px;
    padding-bottom: 48px;
  }

  .projects-shell {
    width: 100%;
    row-gap: 8px;
    transform: none;
  }

  .projects-carousel {
    --carousel-gap: 14px;
    --carousel-card-width: 100%;
    width: 100%;
  }

  .projects-title {
    font-size: 2.1rem;
  }

  .carousel-dots {
    --dot-slot: 18px;
    margin-bottom: 10px;
  }

  .projects-header {
    width: auto;
  }

  .project {
    flex: 0 0 100%;
    padding: 28px 24px 24px;
    min-height: 420px;
  }

  .contact-links {
    flex-direction: column;
    gap: 16px;
  }
}
