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

:root {
  --bg: #08080c;
  --surface: #111118;
  --border: #1c1c2a;
  --text: #d4d4dc;
  --text-muted: #70708a;
  --heading: #ffffff;
  --accent: #4f8fff;
  --accent-hover: #70a5ff;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --nav-height: 60px;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: none;
  scroll-behavior: smooth;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  position: relative;
}

.nav-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 0.5rem 0;
  transition: color 0.25s ease;
  white-space: nowrap;
}

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

.nav-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  will-change: transform, width;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* ── Sections (shared) ── */
.section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: var(--nav-height) 2rem 2rem;
  position: relative;
}

/* ── Hero ── */
.hero {
  flex-direction: column;
  text-align: center;
}

.wordmark {
  font-size: 17.5vw;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.04em;
  line-height: 0.85;
  text-transform: uppercase;
}

.tagline {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Project Sections ── */
.project {
  padding: var(--nav-height) 3rem 3rem;
}

.project-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5vw;
  align-items: center;
  max-width: 1400px;
  width: 100%;
}

.project-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-name {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.project-desc {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  max-width: 520px;
}

.project-link {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.25s ease, transform 0.25s ease;
  align-self: flex-start;
}

.project-link:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.project-screenshot {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.project-screenshot img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* ── Contact ── */
.contact-inner {
  text-align: center;
}

.contact-heading {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s ease;
}

.social-links a:hover {
  color: var(--heading);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Reveal Animation ── */
.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.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.reveal.is-visible .reveal-child {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.reveal.is-visible .reveal-child:nth-child(1) { transition-delay: 0.1s; }
.reveal.is-visible .reveal-child:nth-child(2) { transition-delay: 0.2s; }
.reveal.is-visible .reveal-child:nth-child(3) { transition-delay: 0.3s; }
.reveal.is-visible .reveal-child:nth-child(4) { transition-delay: 0.35s; }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-child {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .nav-indicator {
    transition: none;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --nav-height: 50px;
  }

  .nav-list {
    gap: 1.25rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .hero {
    padding-top: var(--nav-height);
  }

  .wordmark {
    font-size: 13vw;
  }

  .project {
    padding: var(--nav-height) 1.5rem 1.5rem;
  }

  .section {
    height: auto;
    min-height: 100vh;
  }

  .project-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
    height: auto;
  }

  .project-text {
    order: 2;
  }

  .project-screenshot {
    order: 1;
    height: auto;
    max-height: 45vh;
  }

  .project-link {
    align-self: center;
  }

  .project-desc {
    max-width: none;
  }

  .social-links {
    gap: 2rem;
  }
}
