:root {
  --bg: #06070a;
  --fg: #f4f5f7;
  --muted: #9aa0ac;
  --accent1: #7c5cff;
  --accent2: #22d3ee;
  --accent3: #ff5c93;
  --accent1-rgb: 124, 92, 255;
  --accent2-rgb: 34, 211, 238;
  --accent3-rgb: 255, 92, 147;
  --border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.aurora {
  position: fixed;
  inset: -10%;
  z-index: -2;
  overflow: hidden;
  filter: blur(50px);
  opacity: 0.45;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}

.b1 {
  width: 38vmax;
  height: 38vmax;
  top: -16%;
  left: -18%;
  background: radial-gradient(circle at center, rgba(var(--accent1-rgb), 0.85), rgba(var(--accent1-rgb), 0) 70%);
  animation: float1 28s ease-in-out infinite;
}

.b2 {
  width: 34vmax;
  height: 34vmax;
  top: 18%;
  right: -20%;
  background: radial-gradient(circle at center, rgba(var(--accent2-rgb), 0.8), rgba(var(--accent2-rgb), 0) 70%);
  animation: float2 34s ease-in-out infinite;
}

.b3 {
  width: 34vmax;
  height: 34vmax;
  bottom: -22%;
  left: 30%;
  background: radial-gradient(circle at center, rgba(var(--accent3-rgb), 0.75), rgba(var(--accent3-rgb), 0) 70%);
  animation: float3 24s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(12vw, 8vh) scale(1.15); }
  66% { transform: translate(-6vw, 14vh) scale(0.9); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-10vw, 10vh) scale(0.85); }
  75% { transform: translate(-4vw, -8vh) scale(1.1); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30% { transform: translate(8vw, -10vh) scale(1.1); }
  70% { transform: translate(-8vw, -4vh) scale(0.95); }
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

main {
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  background: rgba(6, 7, 10, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-logo {
  color: var(--fg);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

  .nav-links {
    position: fixed;
    top: 68px;
    left: 24px;
    right: 24px;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(10, 10, 14, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: scale(0.96);
    transform-origin: top right;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }
}

/* Hero */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
}

.eyebrow {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 24px;
}

.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.75rem, 10vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-title .line {
  display: block;
  background: linear-gradient(100deg, var(--accent1), var(--accent2) 45%, var(--accent3) 80%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 8s ease-in-out infinite, rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.hero-title .line:nth-child(2) {
  animation-delay: 0s, 0.15s;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.6em);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  margin: 20px 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid transparent;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -10px rgba(124, 92, 255, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-cue span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--fg);
  animation: scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(10px); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Sections */

.section {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 20px;
}

.section p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
}

.section strong {
  color: var(--fg);
}

.section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 36px;
}

.skill-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 14px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  color: var(--fg);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background 0.25s ease;
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent2);
  background: rgba(34, 211, 238, 0.08);
}

/* Projects */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.project-card {
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 20px 40px -20px rgba(124, 92, 255, 0.45);
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(var(--accent1-rgb), 0.16), rgba(var(--accent2-rgb), 0.12));
  border: 1px solid var(--border);
}

.project-thumb svg {
  width: 26px;
  height: 26px;
  opacity: 0.7;
}

.project-thumb span {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb.placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shimmer 4.5s linear infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

.project-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.project-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: none;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.card-links {
  display: flex;
  gap: 16px;
}

.card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent2);
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.mail-link {
  color: var(--fg);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(var(--accent2), var(--accent2));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s ease;
}

.mail-link:hover,
.mail-link:focus-visible {
  background-size: 100% 2px;
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}
