:root {
  --bg-main: #0a0b0e; /* Deep Charcoal Base */
  --bg-surface: #111216; /* Slightly lighter surface */
  --bg-card: rgba(255, 255, 255, 0.02);
  --border-color: rgba(255, 255, 255, 0.05);
  --text-main: #f3f4f6;
  --text-muted: #8a8d98;
  --primary: #f59e0b; /* Amber/Orange Accent */
  --primary-dim: rgba(245, 158, 11, 0.15);
  --font-sans: "Geist", sans-serif;
  --font-heading: "Cabinet Grotesk", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    /* Amber radial glow top right */
    radial-gradient(
      circle at 80% 20%,
      rgba(245, 158, 11, 0.08) 0%,
      transparent 50%
    ),
    /* Blueish/gray radial glow bottom left */
    radial-gradient(
        circle at 20% 80%,
        rgba(138, 141, 152, 0.08) 0%,
        transparent 50%
      ),
    /* Noise texture overlay */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.12'/%3E%3C/svg%3E");
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background elements removed - using noise and subtle ambient radial gradients instead */

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p {
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 8rem 0; /* Huge macro-whitespace */
}

.text-center {
  text-align: center;
}
.mt-4 {
  margin-top: 1rem;
}

.text-gradient {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Double-Bezel (Doppelrand) Architecture */
.card-shell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.375rem; /* 6px outer gap */
  border-radius: 2rem; /* 32px outer radius */
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-shell:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.card-core {
  background: var(--bg-surface);
  border-radius: calc(2rem - 0.375rem); /* Flawless concentric curve */
  padding: 2.5rem;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.08); /* Inner highlight */
  height: 100%;
}

/* Fluid Island Nav */
.navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  border-radius: 9999px;
  z-index: 1000;
  background: rgba(10, 10, 12, 0.4);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.5rem 1rem;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.05em;
  padding-left: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding-right: 0.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
}

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

.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1001; /* Keep above overlay */
}

.bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: var(--text-main);
}

/* Nested Island Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1.5rem; /* Asymmetric padding to fit the island */
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px 0 var(--primary-dim);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.3);
}

.island-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-primary:hover .island-icon {
  background: rgba(0, 0, 0, 0.3);
  transform: scale(1.05) translate(2px, -1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

.greeting {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.name {
  font-size: clamp(3rem, 6vw, 5rem);
  margin-bottom: 0.5rem;
}

.role {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-desc {
  max-width: 600px;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

/* Section Headings */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.heading-line {
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin-bottom: 3rem;
}

/* About & Skills */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.contact-inline {
  display: flex;
  gap: 2rem;
  color: var(--text-main);
  font-size: 0.95rem;
  margin-top: 2rem;
}

.contact-inline i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.skill-category h4 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Experience Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  background: var(--border-color);
  top: 0;
  bottom: 0;
  left: 20px;
  margin-left: -1px;
}

.timeline-item {
  padding: 10px 0 30px 50px;
  position: relative;
}

.timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 12px;
  top: 15px;
  background: var(--bg-main);
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 1;
}

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

.job-role {
  font-size: 1.3rem;
  color: var(--text-main);
}

.company {
  font-size: 1rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
}

.timeline-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.date-badge {
  background: rgba(236, 72, 153, 0.1);
  color: #f472b6;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.location {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-tasks {
  list-style-type: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-tasks li {
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline-tasks li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Asymmetrical Bento Projects Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  grid-auto-flow: dense;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Bento logic (Removed for uniform grid sizing) */
.project-card:hover {
  transform: translateY(-2px);
}

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

.project-icon {
  font-size: 2rem;
  color: var(--accent);
}

.project-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.project-link {
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--primary);
}

.project-link i {
  font-size: 1rem;
  color: var(--text-muted);
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.project-link:hover i {
  color: var(--primary);
  transform: translate(2px, -2px);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

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

.project-tech .tag {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

/* Contact */
.contact-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.contact-subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

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

.social-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.social-btn i {
  font-size: 1.5rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.social-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(5px);
}

/* Footer */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* JS Scroll Interpolation (Spring Physics) */
.js-scroll {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(40px);
  transition:
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

.js-scroll.scrolled {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Base structural fixes for staggered elements */
.project-card,
.timeline-content,
.card-shell {
  transform: translateY(0); /* Prevents overriding the js-scroll classes */
}

/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: all;
  }

  .nav-link {
    font-size: 2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-links.active .nav-link {
    transform: translateY(0);
    opacity: 1;
  }

  /* Stagger delays for mobile nav links */
  .nav-links li:nth-child(1) .nav-link {
    transition-delay: 0.1s;
  }
  .nav-links li:nth-child(2) .nav-link {
    transition-delay: 0.15s;
  }
  .nav-links li:nth-child(3) .nav-link {
    transition-delay: 0.2s;
  }
  .nav-links li:nth-child(4) .nav-link {
    transition-delay: 0.25s;
  }

  /* Grid Fallbacks are handled above with min-width queries */
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }

  .timeline::after {
    left: 15px;
  }

  .timeline-item {
    padding-left: 40px;
  }

  .timeline-dot {
    left: 7px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 1rem;
  }

  .timeline-date {
    align-items: flex-start;
  }
}
