:root {
  --bg: #050816;
  --bg-2: #080d1f;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.075);
  --text: #f8fafc;
  --muted: #a7b0c2;
  --line: rgba(255, 255, 255, 0.14);
  --primary: #38bdf8;
  --primary-2: #60a5fa;
  --accent: #22c55e;
  --purple: #a78bfa;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --glow: 0 0 32px rgba(56, 189, 248, 0.22);
  --radius: 26px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 5%, rgba(56, 189, 248, 0.16), transparent 24rem),
    radial-gradient(circle at 90% 10%, rgba(167, 139, 250, 0.16), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

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

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.bg-orb {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.24;
  pointer-events: none;
  z-index: -2;
  animation: floatOrb 10s ease-in-out infinite alternate;
}

.orb-one {
  top: 5rem;
  left: -12rem;
  background: var(--primary);
}

.orb-two {
  right: -13rem;
  bottom: 2rem;
  background: var(--purple);
  animation-delay: 1.8s;
}

@keyframes floatOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, -35px, 0) scale(1.08); }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(5, 8, 22, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #02111f;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--glow);
  transform: rotate(-6deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.nav-links a::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

.nav-links a:hover::before,
.nav-links a:focus-visible::before,
.nav-links a.active::before {
  transform: scaleX(1);
}

.nav-links a.active {
  color: #03111f;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.28);
}

.nav-links a.active::before {
  background: rgba(3, 17, 31, 0.75);
}

.nav-cta {
  color: var(--text);
}

.nav-cta.active,
.nav-cta:hover,
.nav-cta:focus-visible {
  color: #03111f !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--glow);
}

.nav-toggle {
  display: none;
  color: var(--text);
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.section { padding: 96px 0; }

.hero {
  position: relative;
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  perspective: 1200px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 44px;
  align-items: center;
}

.eyebrow,
.section-label,
.project-tag {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.05em; margin: 0; }

h1 {
  max-width: 850px;
  margin-top: 12px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  background: linear-gradient(135deg, #ffffff 20%, #9bdcff 48%, #b8a8ff 78%);
  -webkit-background-clip: text;
  color: transparent;
}

h2 { font-size: clamp(2rem, 4vw, 3.3rem); }

h3 { font-size: 1.25rem; }

.hero-text {
  max-width: 760px;
  margin: 24px 0 0;
  font-size: 1.14rem;
  color: var(--muted);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 23px;
  border-radius: 999px;
  font-weight: 900;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.btn:hover::after { transform: translateX(120%); }

.btn:hover { transform: translateY(-3px) translateZ(18px); }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #02111f;
  box-shadow: 0 18px 44px rgba(56, 189, 248, 0.28);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line);
}

.quick-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  color: var(--muted);
  font-weight: 700;
}

.quick-info a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(10px);
  transition: transform 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.quick-info a:hover {
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-2px);
}

.hero-card,
.card,
.project-card,
.timeline-content,
.stats article,
.contact-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.045));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.18s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tilt-card:hover {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--shadow), var(--glow);
}

.hero-card {
  position: relative;
  min-height: 470px;
  padding: 28px;
  overflow: hidden;
}

.hero-card::before,
.project-card.featured::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(56, 189, 248, 0.28), transparent 32%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.hero-card:hover::before,
.project-card.featured:hover::before { opacity: 1; }

.status-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin: 110px 0 24px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.24);
  font-size: 0.85rem;
  font-weight: 900;
}

.hero-card h2 {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.hero-card ul {
  position: relative;
  z-index: 1;
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
}

.hero-card li + li { margin-top: 10px; }

.android-scene {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 132px;
  height: 132px;
  transform: translateX(-50%);
  perspective: 760px;
}

.android-logo {
  position: relative;
  width: 112px;
  height: 124px;
  margin: 0 auto;
  transform-style: preserve-3d;
  animation: rotateAndroid 7s ease-in-out infinite;
  filter: drop-shadow(0 0 26px rgba(34, 197, 94, 0.34));
}

.android-head {
  position: absolute;
  top: 20px;
  left: 18px;
  width: 76px;
  height: 42px;
  border-radius: 40px 40px 12px 12px;
  background: linear-gradient(135deg, #22c55e, #84cc16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform: translateZ(22px);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.16),
    0 18px 44px rgba(34, 197, 94, 0.22);
}

.android-body {
  position: absolute;
  top: 67px;
  left: 18px;
  width: 76px;
  height: 54px;
  border-radius: 10px 10px 18px 18px;
  background: linear-gradient(135deg, #16a34a, #65a30d);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: translateZ(18px);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.12),
    0 22px 48px rgba(34, 197, 94, 0.18);
}

.antenna {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bbf7d0, #22c55e);
  transform-origin: bottom center;
}

.antenna.left {
  left: 35px;
  transform: rotate(-30deg) translateZ(28px);
}

.antenna.right {
  right: 35px;
  transform: rotate(30deg) translateZ(28px);
}

.eye {
  position: absolute;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #052e16;
  box-shadow: 0 0 8px rgba(5, 46, 22, 0.35);
}

.eye.left { left: 22px; }
.eye.right { right: 22px; }

.arm {
  position: absolute;
  top: 5px;
  width: 15px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #65a30d);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.arm.left {
  left: -21px;
  transform: rotate(5deg) translateZ(8px);
}

.arm.right {
  right: -21px;
  transform: rotate(-5deg) translateZ(8px);
}

.leg {
  position: absolute;
  bottom: -27px;
  width: 16px;
  height: 32px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(135deg, #16a34a, #65a30d);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.leg.left { left: 16px; }
.leg.right { right: 16px; }

@keyframes rotateAndroid {
  0% {
    transform: rotateX(0deg) rotateY(-28deg) rotateZ(-2deg) translateY(0);
  }
  35% {
    transform: rotateX(8deg) rotateY(28deg) rotateZ(2deg) translateY(-8px);
  }
  70% {
    transform: rotateX(-5deg) rotateY(0deg) rotateZ(0deg) translateY(4px);
  }
  100% {
    transform: rotateX(0deg) rotateY(-28deg) rotateZ(-2deg) translateY(0);
  }
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border-block: 1px solid rgba(255,255,255,0.08);
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
}

.content p {
  margin-top: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-head {
  max-width: 760px;
  margin-bottom: 34px;
}

.skills-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  perspective: 1000px;
}

.card,
.project-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.card::after,
.project-card::after,
.stats article::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.65), transparent);
}

.card p,
.project-card p,
.timeline-content p,
.contact-card p {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.timeline-date {
  color: var(--primary);
  font-weight: 900;
  padding-top: 24px;
}

.timeline-content {
  padding: 24px;
}

.project-card.featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.045));
  border-color: rgba(56, 189, 248, 0.24);
}

.tech-list {
  margin-top: 18px;
  color: var(--primary);
  font-weight: 900;
  font-size: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  perspective: 1000px;
}

.stats article {
  position: relative;
  padding: 26px;
  text-align: center;
  overflow: hidden;
}

.stats strong {
  display: block;
  color: var(--primary);
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: 0 0 22px rgba(56, 189, 248, 0.28);
}

.stats span {
  color: var(--muted);
  font-weight: 800;
}

.contact {
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 12% 10%;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(34, 197, 94, 0.1), rgba(167, 139, 250, 0.14));
  filter: blur(30px);
}

.contact-card {
  position: relative;
  max-width: 900px;
  padding: 44px;
}

.footer {
  padding: 28px 0;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: absolute;
    inset: 76px 20px auto 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: rgba(5, 8, 22, 0.96);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    justify-content: center;
    width: 100%;
  }

  .nav-links a.active {
    transform: none;
  }

  .hero-grid,
  .split,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .skills-grid,
  .project-grid,
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .project-card.featured { grid-column: auto; }

  .timeline-date { padding-top: 0; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 28px, 1120px); }
  .section { padding: 68px 0; }
  .hero { min-height: auto; }
  .skills-grid,
  .project-grid,
  .stats {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
  }
}
