:root {
  --bg: #000000;
  --text-main: #f5f5f7;
  --text-muted: #86868b;
  --accent: #ffffff;
  --border-light: rgba(255, 255, 255, 0.12);
  --glass-bg: rgba(18, 18, 18, 0.65);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: auto; /* Let custom JS smooth lerp control scroll feel */
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  background-color: var(--bg);
}

/* Preloader */
.loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}

.loader-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-fill {
  width: 0%;
  height: 100%;
  background: #fff;
  transition: width 0.1s linear;
}

.loader-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Minimal Header */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
}

.nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-main);
  text-decoration: none;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

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

/* Pinned Scroll Section */
.pin-container {
  height: 800vh; /* Scroll height controlling animation duration */
  position: relative;
}

.sticky-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Overlay Layer */
.overlay-wrapper {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content {
  position: absolute;
  max-width: 900px;
  width: 90%;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(8px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.step-content.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
  pointer-events: auto;
}

.key-legend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 1rem;
}

/* Hero Step */
.step-hero {
  text-align: center;
}

.subtitle-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--text-muted);
  margin-top: 1rem;
  font-weight: 400;
}

.scroll-cue {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.scroll-text {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* About Step */
.step-about {
  max-width: 650px;
  left: 8%;
}

.step-about h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.step-about p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Skills Step */
.step-skills {
  max-width: 800px;
  text-align: center;
}

.step-skills h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  margin-bottom: 2.5rem;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text-main);
  backdrop-filter: blur(8px);
  transition: background 0.3s, border-color 0.3s;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Projects Step */
.step-projects {
  max-width: 900px;
}

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

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-header h3 {
  font-size: 1.4rem;
  font-weight: 600;
}

.proj-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: color 0.3s;
}

.proj-link:hover {
  color: #fff;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* Experience Step */
.step-experience {
  max-width: 750px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
  border-left: 1px solid var(--border-light);
  padding-left: 1.5rem;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.time-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.time-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.time-content .company {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.time-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contact Step */
.step-contact {
  text-align: center;
  max-width: 600px;
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.cta-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  background: #fff;
  color: #000;
  padding: 1rem 2rem;
  border-radius: 100px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
  margin-bottom: 2rem;
}

.cta-button:hover {
  transform: scale(1.03);
  background: #e5e5e7;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: #fff;
}

/* Footer */
.footer {
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  background: #000;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
  .step-about { left: 5%; width: 90%; }
}