:root {
  --color-bg: #000000;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-text: #f5f5f7;
  --color-text-secondary: rgba(245, 245, 247, 0.65);
  --color-accent: #667eea;
  --color-accent2: #764ba2;
  --color-accent-light: #a8b2ff;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-hover: rgba(102, 126, 234, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-blur: blur(40px);
  --glass-border: 1px solid var(--color-border);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --radius-full: 9999px;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --font:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
::selection {
  background: rgba(102, 126, 234, 0.35);
  color: #fff;
}
img {
  max-width: 100%;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 clamp(16px, 4vw, 48px);
  transition:
    background 0.5s var(--ease-smooth),
    box-shadow 0.5s var(--ease-smooth);
}
.nav.scrolled {
  background: rgba(20, 20, 22, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  height: 60px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, var(--color-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: rgba(245, 245, 247, 0.8);
  transition: color 0.3s var(--ease-smooth);
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-apple);
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}
.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s var(--ease-apple);
}
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-apple);
  z-index: 999;
}
.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-nav a {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  transition: color 0.3s;
  letter-spacing: -0.02em;
}
.mobile-nav a:hover {
  color: var(--color-accent-light);
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px clamp(20px, 5vw, 80px) 80px;
  position: relative;
  overflow: hidden;
}
.hero-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 45%,
      rgba(102, 126, 234, 0.18),
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 50% at 75% 70%,
      rgba(118, 75, 162, 0.14),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 40% at 25% 60%,
      rgba(41, 151, 255, 0.1),
      transparent 55%
    );
  animation: meshShift 18s ease-in-out infinite alternate;
}
@keyframes meshShift {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 32px;
  position: relative;
  box-shadow:
    0 0 60px rgba(102, 126, 234, 0.35),
    0 0 120px rgba(102, 126, 234, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(102, 126, 234, 0.4);
  animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

.hero h1 {
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, var(--color-accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.hero .location {
  font-size: clamp(15px, 2vw, 20px);
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 40px;
  font-weight: 300;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: all 0.5s var(--ease-apple);
}
.hero-cta:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
}
.scroll-arrow {
  position: absolute;
  bottom: 32px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 24px;
  animation: arrowBounce 2.5s var(--ease-apple) infinite;
}
@keyframes arrowBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s var(--ease-apple),
    transform 0.9s var(--ease-apple);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.hero .reveal:nth-child(1) {
  transition-delay: 0s;
}
.hero .reveal:nth-child(2) {
  transition-delay: 0.12s;
}
.hero .reveal:nth-child(3) {
  transition-delay: 0.24s;
}
.hero .reveal:nth-child(4) {
  transition-delay: 0.36s;
}
.hero .reveal:nth-child(5) {
  transition-delay: 0.48s;
}
.hero .reveal:nth-child(6) {
  transition-delay: 0.6s;
}

.section {
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 80px);
  position: relative;
}
.section-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: clamp(48px, 6vw, 80px);
  background: linear-gradient(135deg, #fff, var(--color-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
.about-image {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: var(--glass-border);
  box-shadow:
    0 0 80px rgba(102, 126, 234, 0.18),
    inset 0 0 40px rgba(255, 255, 255, 0.02);
  transition: all 0.6s var(--ease-apple);
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-image:hover {
  transform: scale(1.02);
  box-shadow:
    0 0 100px rgba(102, 126, 234, 0.28),
    inset 0 0 60px rgba(255, 255, 255, 0.03);
}
.about-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
  transition: all 0.6s var(--ease-apple);
}
.about-card:hover {
  background: var(--color-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}
.about-card h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: #fff;
}
.about-card p {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  font-weight: 300;
  line-height: 1.7;
}
.about-card p:last-child {
  margin-bottom: 0;
}

/* Two-column layout: sticky cube + skills */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.sticky-visual {
  position: sticky;
  top: 100px;
  width: 100%;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: visible;
}

.cube {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.scroll-animation-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating code-snippet background (codewiki-style) */
.cube-code-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-md);
  z-index: 0;
}

.cube-code-frag {
  position: absolute;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  color: rgba(168, 178, 255, 0.20);
  white-space: nowrap;
  user-select: none;
  animation: codeFloat linear infinite;
  transform: translateY(0);
}

/* Large "zoomed" fragments behind the cube — simulate magnification */
.cube-code-zoom {
  color: rgba(168, 178, 255, 0.11);
  filter: blur(1.5px);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Subtle radial glow in the cube center to sell the lens effect */
.cube-code-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 55% 55% at 50% 50%,
    rgba(102, 126, 234, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}

@keyframes codeFloat {
  0%   { transform: translateY(0);    opacity: 0; }
  8%   { opacity: 1;                              }
  92%  { opacity: 1;                              }
  100% { transform: translateY(-60px); opacity: 0; }
}


.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.skill-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: clamp(24px, 3vw, 36px);
  transition: all 0.5s var(--ease-apple);
  position: relative;
  overflow: hidden;
  cursor: default;
  transform-style: preserve-3d;
  perspective: 800px;
}
.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-accent),
    transparent
  );
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-apple);
  transform-origin: left;
}
.skill-card:hover::before {
  transform: scaleX(1);
}
.skill-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  box-shadow:
    0 20px 60px rgba(102, 126, 234, 0.18),
    inset 0 0 30px rgba(102, 126, 234, 0.04);
}
.skill-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
}
.skill-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #fff;
}
.skill-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  font-weight: 300;
  line-height: 1.6;
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--color-accent),
    var(--color-accent2),
    transparent
  );
}
.timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 48px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 16px rgba(102, 126, 234, 0.5);
  transition: all 0.3s var(--ease-apple);
}
.timeline-item:hover::before {
  transform: scale(1.4);
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.7);
}
.timeline-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: clamp(24px, 3vw, 36px);
  transition: all 0.5s var(--ease-apple);
}
.timeline-card:hover {
  background: var(--color-surface-hover);
  transform: translateX(8px);
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
}
.timeline-card h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}
.timeline-card .date {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent-light);
  margin-bottom: 16px;
  display: block;
}
.timeline-card ul {
  margin-left: 18px;
  list-style: disc;
}
.timeline-card li {
  color: var(--color-text-secondary);
  font-weight: 300;
  font-size: clamp(14px, 1.6vw, 16px);
  margin-bottom: 8px;
  line-height: 1.6;
}
.timeline-card li:last-child {
  margin-bottom: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.7s var(--ease-apple);
  position: relative;
  cursor: pointer;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(102, 126, 234, 0.12),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.project-card:hover::after {
  opacity: 1;
}
.project-card:hover {
  transform: translateY(-10px) scale(1.015);
  border-color: var(--color-border-hover);
  box-shadow: 0 32px 80px rgba(102, 126, 234, 0.22);
}
.project-visual {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 42px;
}
.project-visual .vis-bg {
  position: absolute;
  inset: 0;
}
.project-info {
  padding: clamp(20px, 3vw, 32px);
}
.project-info h3 {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  margin-bottom: 10px;
  color: #fff;
}
.project-info p {
  color: var(--color-text-secondary);
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 12px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.badge {
  display: inline-block;
  background: rgba(102, 126, 234, 0.18);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-light);
  border: 1px solid rgba(102, 126, 234, 0.25);
}
.tech-stack {
  font-size: 13px !important;
  color: var(--color-accent) !important;
  font-weight: 500 !important;
  margin-bottom: 0 !important;
}

.contact {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 30% 40%,
      rgba(102, 126, 234, 0.15),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 70% 60%,
      rgba(118, 75, 162, 0.12),
      transparent 50%
    );
}
.contact-inner {
  position: relative;
  z-index: 1;
}
.contact h2 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: #fff;
}
.contact p {
  font-size: clamp(16px, 2.2vw, 22px);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  font-weight: 300;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 44px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  transition: all 0.6s var(--ease-apple);
  cursor: pointer;
}
.cta-btn:hover {
  transform: translateY(-4px) scale(1.04);
  background: rgba(102, 126, 234, 0.25);
  border-color: var(--color-border-hover);
  box-shadow:
    0 24px 64px rgba(102, 126, 234, 0.35),
    inset 0 0 40px rgba(255, 255, 255, 0.06);
}
.social-row {
  display: flex;
  gap: 20px;
  margin-top: 36px;
  justify-content: center;
}
.social-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--ease-apple);
  font-size: 20px;
}
.social-link:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.25);
}
.bot-note {
  margin-top: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

footer {
  padding: 48px clamp(20px, 5vw, 80px);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  font-weight: 300;
}
footer a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s;
}
footer a:hover {
  color: var(--color-accent-light);
}

@media (max-width: 1024px) {
  .skills-layout {
    grid-template-columns: 1fr;
  }
  .sticky-visual {
    position: relative;
    top: 0;
    height: 320px;
    margin-bottom: 32px;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .hero-photo {
    width: 120px;
    height: 120px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-image {
    max-width: 320px;
    margin: 0 auto;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 0;
  }
  .timeline-item {
    padding-left: 32px;
  }
}
@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    width: 100px;
    height: 100px;
  }
  .nav-inner {
    height: 52px;
  }
  .social-row {
    gap: 14px;
  }
  .cta-btn {
    padding: 14px 32px;
    font-size: 16px;
  }
  .hero-cta {
    padding: 12px 28px;
    font-size: 14px;
  }
  .timeline-item {
    padding-left: 28px;
  }
}
