:root {
  /* Colors */
  --bg: #0A0E1A;
  --bg-card: #111827;
  --bg-card-hover: #1a2235;
  --border: #1E2A3A;
  --border-hover: #F5A623;
  --text-primary: #F0EDE8;
  --text-muted: #6B6B6B;
  --text-dim: #3A3A3A;
  --accent: #F5A623;
  --accent-soft: rgba(245, 166, 35, 0.08);
}

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

/* Targeted transitions instead of global */
a, button, .card, .pill, .nav-link, .project-card, .filter-tab {
  transition: color 0.25s ease, background 0.25s ease, 
              border-color 0.25s ease, transform 0.25s ease,
              opacity 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
}


/* 
  Mobile-first base styles (320px) 
  Ensure sections take structure
*/

main {
  width: 100%;
}

section {
  width: 100%;
  padding: 4rem 1.5rem; /* Mobile spacing placeholder */
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  /* min-height: 100vh;  Placeholder to see sections */
}

section.section-dim {
  opacity: 0.3;
}

/* Desktop overrides at 768px+ */
@media (min-width: 768px) {
  section {
    padding: 9rem 4rem; /* Desktop spacing placeholder */
  }
}

/* --- NAVIGATION BAR --- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  z-index: 1000;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#navbar.scrolled {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  letter-spacing: 2px;
  text-decoration: none; /* No underline */
  /* Static, no hover */
}

/* Desktop Links Hide on Mobile */
.desktop-only {
  display: none;
}

.mobile-only {
  display: block;
}

.nav-hamburger {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #0D0D0D;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.mobile-nav-link {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-nav-link:hover {
  color: var(--accent);
}

/* Desktop Styles */
@media (min-width: 768px) {
  #navbar {
    padding: 1.5rem 3rem;
  }
  
  .desktop-only {
    display: flex;
    gap: 2rem;
  }

  .mobile-only {
    display: none;
  }

  .nav-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 4px;
  }

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

  .nav-link.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
  }
}

/* --- ENTRANCE ANIMATIONS --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HERO SECTION --- */
#hero {
  position: relative;
  min-height: 100svh; /* full viewport height, handles mobile address bars better */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    ellipse 60% 60% at 50% 50%,
    transparent 30%,
    #0A0E1A 100%
  );
  pointer-events: none;
}

.hero-bg-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(2);
  z-index: 0;
  background-image: radial-gradient(circle, rgba(245,166,35,0.25) 1.5px, transparent 1.5px);
  background-size: 36px 36px;
  animation: driftDots 25s infinite alternate ease-in-out;
  pointer-events: none;
  user-select: none;
}

@keyframes driftDots {
  0% { transform: scale(2) translate(0, 0); }
  100% { transform: scale(2) translate(20px, 20px); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-name {
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  
  opacity: 0;
  animation: fadeUp 0.4s ease forwards 0.1s;
}

.hero-typewriter {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
  height: 24px; /* Prevent layout shift during typing */
  
  opacity: 0;
  animation: fadeUp 0.4s ease forwards 0.2s;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  animation: none;
}

.typewriter-cursor.blinking {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-bio {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
  margin: 0 auto 2.5rem auto;

  opacity: 0;
  animation: fadeUp 0.4s ease forwards 0.3s;
}

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

.pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  white-space: nowrap;
  
  opacity: 0;
  animation: fadeUp 0.4s ease forwards; /* Base animation */
}

/* Staggered Pills Delay */
.hero-pills .pill:nth-child(1) { animation-delay: 0.45s; }
.hero-pills .pill:nth-child(2) { animation-delay: 0.50s; }
.hero-pills .pill:nth-child(3) { animation-delay: 0.55s; }
.hero-pills .pill:nth-child(4) { animation-delay: 0.60s; }
.hero-pills .pill:nth-child(5) { animation-delay: 0.65s; }

.about-pills .pill {
  opacity: 1;
  animation: none;
  white-space: normal;
}

.pill:hover {
  border-color: var(--border-hover);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .hero-name {
    font-size: 96px;
  }
  .hero-typewriter {
    font-size: 18px;
    height: 32px;
  }
  .hero-bio {
    font-size: 20px;
    font-weight: 400;
  }
  .hero-content {
    padding: 0;
  }
}

/* --- SHARED SECTION STYLES --- */
.section-container {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  margin-bottom: 3rem;
}

.section-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: letter-spacing 0.4s ease;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-label.is-visible {
  letter-spacing: 4px;
}

.section-header h2 {
  font-size: 28px;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .section-header h2 {
    font-size: 52px;
  }
}

/* --- PROJECTS SECTION --- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.filter-tab {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-tab.active {
  background: var(--accent);
  color: #080808;
  font-weight: 500;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  position: relative;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .project-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 480px;
    margin: 0 auto;
  }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  /* Scroll animation defaults */
  opacity: 0;
  transform: translateY(20px);
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card.is-hidden {
  display: none;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.badge-gold { color: #F5A623; background: rgba(245, 166, 35, 0.1); }
.badge-green { color: #2ECC71; background: rgba(46, 204, 113, 0.1); }
.badge-amber { color: var(--accent); background: var(--accent-soft); }
.badge-blue { color: #3498DB; background: rgba(52, 152, 219, 0.1); }

.card-tag {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  margin-left: auto;
  padding-left: 8px;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 8px;
  margin-top: 12px;
  color: var(--text-primary);
}

.card-desc {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  flex-grow: 1;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.stack-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
}

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

.card-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.25s ease;
}

.card-link:hover {
  color: var(--accent);
}

.card-link svg {
  width: 18px;
  height: 18px;
}

/* --- ABOUT SECTION --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 60% 1fr;
    gap: 4rem;
  }
}

.about-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.about-desc {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.roles-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.roles-list {
  list-style-type: none;
  padding: 0;
}

.roles-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
}

.roles-list li::before {
  content: "●";
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 12px;
}

.role-name {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 4px;
}

.role-details {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- SKILLS SECTION --- */
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.skill-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 400;
}

.skill-tiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px;
  width: 90px;
  cursor: default;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-tile i {
  font-size: 28px;
  transition: transform 0.3s ease;
}

.skill-tile span {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.3s ease;
}

/* Text fallback tile */
.skill-tile-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* Hover animation */
.skill-tile:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-4px);
}

.skill-tile:hover i {
  transform: scale(1.2);
}

.skill-tile:hover span {
  color: var(--text-primary);
}

/* Currently learning tiles */
.skill-tile.learning {
  border-style: dashed;
  opacity: 0.75;
}

.skill-tile.learning:hover {
  opacity: 1;
}

.skill-group-learning {
  margin-top: 1rem;
}

/* --- ACHIEVEMENTS SECTION --- */
.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .achievements-grid {
    flex-direction: row;
    gap: 20px;
  }
}

.achievement-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  text-align: left;
  transition: all 0.25s ease;
}

.achievement-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.achievement-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.achievement-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--text-primary);
}

.achievement-detail {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  margin-top: 6px;
}

.achievement-subtext {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- CONTACT SECTION --- */
.contact-subtext {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  text-align: center;
  margin: 0 auto 40px auto;
  line-height: 1.5;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .contact-grid {
    flex-direction: row;
  }
}

.contact-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.contact-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.contact-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-value {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-primary);
}

/* --- FOOTER --- */
#footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

#footer p {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
}

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  section {
    transition: none;
  }

  section.section-dim {
    opacity: 1;
  }
}

/* --- TEXT SPLIT STAGGER --- */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.word.word-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .word {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- CUSTOM CURSOR --- */
body {
  cursor: none; /* Hide default cursor if custom is active */
}

/* Fallback for devices without hover capability (touch devices) */
@media (hover: none) {
  body {
    cursor: auto;
  }
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: -100px;
  left: -100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  transition: transform 0.15s ease-out; /* scale transition */
}

.cursor-outline {
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  opacity: 0;
  transition: transform 0.12s ease-out, background-color 0.15s ease-out, border-color 0.15s ease-out, width 0.15s ease-out, height 0.15s ease-out, opacity 0.3s ease;
}

/* Hover States applied via JS */
.cursor-hover-state .cursor-dot {
  transform: translate(-50%, -50%) scale(0);
}

.cursor-hover-state .cursor-outline {
  width: 50px;
  height: 50px;
  background-color: var(--accent-soft);
  border-color: transparent;
}
