*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  font-family: "Figtree", sans-serif;
  background: #0a0a0a;
  color: #fff;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p {
  overflow-wrap: break-word;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
img {
  display: block;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 70% 35% at 25% 0%,
      rgba(90, 80, 130, 0.28) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 55% 30% at 75% 0%,
      rgba(60, 70, 120, 0.22) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

.nav {
  position: fixed;
  top: 1.375rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-indicator {
  position: absolute;
  top: 0.5rem;
  left: 0;
  height: calc(100% - 1rem);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
}

.nav-link {
  position: relative;
  z-index: 1;
  padding: 0.625rem 1.35rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.25s;
  white-space: nowrap;
}
.nav-link:hover {
  color: rgba(255, 255, 255, 0.88);
}
.nav-link.active {
  color: #0a0a0a;
  font-weight: 600;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  overflow-x: clip;
}

.section {
  padding: clamp(5.5rem, 9vw, 8rem) 0 clamp(3rem, 5vw, 5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  overflow-x: clip;
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4rem, 7.5vw, 8rem);
  padding-top: clamp(6.5rem, 12vh, 8.5rem);
  padding-bottom: clamp(3.5rem, 6vh, 5rem);
}

.hero-profile {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar {
  width: clamp(290px, 28vw, 410px);
  height: clamp(290px, 28vw, 410px);
  border-radius: 50%;
  padding: 7px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.hero-avatar:hover {
  transform: scale(1.025);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(3rem, 5.5vw + 0.5rem, 5.8rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.04em;
  margin-bottom: 1.375rem;
  color: #fff;
}

.hero h1 em {
  font-style: italic;
  font-weight: 800;
}

.sub {
  font-size: clamp(1.0625rem, 1.3vw + 0.25rem, 1.25rem);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.72;
  max-width: 46ch;
  margin-bottom: 2.5rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #fff;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-dark:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 28px rgba(255, 255, 255, 0.18);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.skill-row {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.skill-row:first-child {
  border-top: none;
}

.row-label {
  flex-shrink: 0;
  width: 140px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.28);
  padding-top: 0.35rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}
.chip img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.projects-header {
  margin-bottom: 2.25rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2rem;
}

.stack-nav,
.stack-hint {
  display: none;
}

.project-card {
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.2s,
    transform 0.3s;
}
.project-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
}

.project-thumb {
  display: flex;
  flex-direction: column;
  height: 230px;
  overflow: hidden;
  background: #0d0d12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2;
}

.browser-header .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.browser-url {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  font-family: "JetBrains Mono", monospace;
}

.scroll-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.scroll-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-position: top;
  transition: transform 3.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card:hover .scroll-wrapper img {
  transform: translateY(calc(-100% + 185px));
}

.project-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  flex: 1;
  justify-content: space-between;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.28);
  margin-bottom: 0.5rem;
}

.project-title {
  font-size: clamp(1.375rem, 2vw + 0.5rem, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.7;
}

.connect {
  text-align: center;
  padding-bottom: 6rem;
}

.connect h2 {
  font-size: clamp(2.5rem, 4.5vw + 0.5rem, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 2.75rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  font-size: 0.95rem;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.social-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: unset;
    padding-top: 7.5rem;
    padding-bottom: 3.5rem;
    gap: 2.75rem;
  }

  .hero-avatar {
    width: 230px;
    height: 230px;
  }

  .sub {
    max-width: 100%;
    margin-inline: auto;
  }

  .actions {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  main {
    padding: 0 1.25rem;
  }
  .skill-row {
    flex-direction: column;
    gap: 1rem;
  }
  .row-label {
    width: auto;
  }
  .projects-header {
    text-align: center;
    margin-bottom: 1.75rem;
  }
  .projects-grid {
    display: block;
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 1.75rem auto 0;
    min-height: 480px;
    perspective: 1200px;
  }
  .project-card {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 18px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #0f0f14;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform, opacity, filter;
    transform-origin: 25% 85%;
    transition:
      transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.45s ease,
      filter 0.45s ease,
      box-shadow 0.3s ease;
  }
  .project-card.is-peeking {
    cursor: pointer;
    box-shadow:
      0 18px 44px rgba(0, 0, 0, 0.85),
      0 0 0 1px rgba(255, 255, 255, 0.18),
      0 0 30px rgba(120, 110, 220, 0.16);
  }
  .project-card.is-peeking * {
    pointer-events: none;
  }
  @media (hover: hover) and (pointer: fine) {
    .project-card.is-peeking:hover {
      filter: brightness(0.95) !important;
      transform: translate3d(18px, -13px, 0) rotate(2.8deg) scale(0.985) !important;
    }
  }
  .project-card:hover {
    transform: none;
  }
  .stack-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
  }
  .stack-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s, transform 0.2s;
  }
  .stack-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }
  .stack-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
  }
  .stack-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .stack-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .stack-dot.active {
    width: 24px;
    background: #fff;
  }
  .stack-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.85rem;
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.02em;
    transition: opacity 0.3s ease;
    animation: hintPulse 2.8s ease-in-out infinite;
  }
  .stack-hint svg {
    color: rgba(255, 255, 255, 0.6);
  }
  .stack-hint.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    animation: none !important;
  }
  @keyframes hintPulse {
    0%, 100% { opacity: 0.45; transform: translateX(0); }
    50% { opacity: 0.85; transform: translateX(3px); }
  }
}

@media (max-width: 680px) {
  .nav {
    top: 0.875rem;
    width: calc(100% - 1.5rem);
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%);
  }
  .nav-inner {
    width: 100%;
    padding: 0.35rem 0.3rem;
    gap: 0.125rem;
    box-sizing: border-box;
  }
  .nav-indicator {
    display: none;
  }
  .nav-link {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0.55rem 0.2rem;
    font-size: clamp(0.72rem, 2.5vw, 0.8rem);
    white-space: nowrap;
  }
  .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
  }
}

@media (max-width: 520px) {
  main {
    padding: 0 1rem;
  }
  .hero {
    padding-top: 6.5rem;
    gap: 2rem;
  }
  .hero-avatar {
    width: 170px;
    height: 170px;
  }
  .hero h1 {
    font-size: clamp(2.3rem, 9.5vw, 3.2rem);
    margin-bottom: 1rem;
  }
  .sub {
    font-size: 0.98rem;
    margin-bottom: 2rem;
  }
  .actions {
    width: 100%;
    gap: 0.75rem;
  }
  .btn-dark,
  .btn-outline {
    flex: 1;
    min-width: 130px;
    height: 48px;
    padding: 0 1rem;
    font-size: clamp(0.82rem, 3.4vw, 0.9rem);
    white-space: nowrap;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
  .chips {
    gap: 0.45rem;
  }
  .chip {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
  }
  .project-thumb {
    height: 200px;
  }
  .project-body {
    padding: 1.35rem;
  }
}
