:root {
  --bg: #0a0a0f;
  --bg-soft: #111117;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #f3f3f7;
  --text-dim: #9a9aa8;
  --accent-1: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2) 50%, var(--accent-3));
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --nav-h: 76px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-2);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

@media (pointer: fine) {
  body.cursor-ready {
    cursor: none;
  }
  body.cursor-ready .cursor-dot,
  body.cursor-ready .cursor-ring {
    opacity: 1;
  }
  body.cursor-ready a,
  body.cursor-ready button {
    cursor: none;
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 15, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--surface-border);
}

.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 2.25rem;
}

.nav-link {
  position: relative;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1.5px;
  background: var(--gradient);
  transition: width 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 26px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  overflow: hidden;
}

.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.blob-1 {
  width: 480px;
  height: 480px;
  background: var(--accent-1);
  top: -10%;
  left: -10%;
  animation: float1 16s ease-in-out infinite;
}

.blob-2 {
  width: 420px;
  height: 420px;
  background: var(--accent-2);
  bottom: -15%;
  right: -8%;
  animation: float2 20s ease-in-out infinite;
}

.blob-3 {
  width: 340px;
  height: 340px;
  background: var(--accent-3);
  top: 40%;
  left: 55%;
  animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -30px) scale(1.15); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 50px) scale(0.9); }
}

.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.reveal-line {
  display: block;
  overflow: hidden;
}

.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 2.25rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
  background: var(--gradient);
  color: #0a0a0f;
  font-weight: 600;
  box-shadow: 0 8px 30px -8px rgba(124, 92, 255, 0.6);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px -6px rgba(124, 92, 255, 0.75);
}

.btn-ghost {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--surface-border);
  border-radius: 999px;
  z-index: 1;
}

.scroll-indicator span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--gradient);
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { top: 8px; opacity: 1; }
  70% { top: 22px; opacity: 0; }
  100% { top: 22px; opacity: 0; }
}

/* ---------- Sections ---------- */
.section {
  padding: 7rem 1.5rem;
}

.section-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text {
  font-size: 1.05rem;
  color: var(--text-dim);
}

.stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.work-card {
  position: relative;
  padding: 2rem 1.75rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s ease;
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
}

.work-card-glow {
  position: absolute;
  inset: -1px;
  background: var(--gradient);
  opacity: 0;
  filter: blur(30px);
  transition: opacity 0.4s ease;
  z-index: -1;
}

.work-card:hover .work-card-glow {
  opacity: 0.25;
}

.work-num {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.work-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact-inner {
  text-align: center;
  max-width: 560px;
}

.contact-text {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface-border);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

.hero-title .reveal {
  transition-delay: 0.1s;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    height: calc(100svh - var(--nav-h));
    width: min(75vw, 320px);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--surface-border);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2.5rem 2rem;
    gap: 1.75rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
