/* =======================
   🎨 COLOR VARIABLES
======================= */
:root {
  /* --color-bg-primary: #0f0c05;
  --color-bg-secondary: rgba(234, 179, 8, 0.08);

  --color-text-primary: #fef9c3;
  --color-text-secondary: #7a6f4e; */
  --color-text-inverse: #1c1917;
  --color-text-white: #ffffff;

  --color-accent-primary: #eab308;

  --color-border-subtle: rgba(234, 179, 8, 0.25);
  /* --color-shadow: rgba(0, 0, 0, 0.5); */

  /* Layout tokens */
  --nav-height: 68px;
  --section-padding-x: clamp(1.25rem, 5vw, 5rem);

  --color-bg-primary: #08080f;
  --color-bg-secondary: rgba(99, 102, 241, 0.08);
  --color-text-primary: #e0e7ff;
  --color-text-secondary: #a5b4fc;
  --color-accent-primary: #6366f1;
  --color-border-subtle: rgba(99, 102, 241, 0.2);
}

/* =======================
   RESET
======================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* =======================
   BODY
======================= */
body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: "Open Sans", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =======================
   NAVBAR
======================= */
header {
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 16px var(--section-padding-x);
  isolation: isolate; /* prevents backdrop-filter from creating a rogue stacking context */
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-height);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: 20px;
}

/* Logo */
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links li a {
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    color 0.25s ease,
    transform 0.25s ease;
  display: inline-block;
}

.nav-links li a:hover {
  color: var(--color-accent-primary);
  transform: scale(1.1);
}

/* Hamburger Button */
.menu-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.menu-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  transform-origin: center;
}

/* Hamburger → X animation */
.menu-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav Overlay (mobile backdrop) */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* =======================
   MOBILE NAV
======================= */
@media (max-width: 768px) {
  header {
    padding: 12px 1rem;
  }

  .menu-hamburger {
    display: flex;
  }

  .nav-right {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(75vw, 300px);
    background: var(--color-bg-primary);
    border-left: 1px solid var(--color-border-subtle);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transform: translateX(
      110%
    ); /* 110% ensures no visible edge peeks through */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden; /* fully hidden when off-screen */
  }

  .nav-right.active {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
  }

  .nav-links li a {
    font-size: 1.25rem;
  }
}

/* =======================
   HERO SECTION
======================= */
.hero {
  display: grid;
  /* col 1: social bar | col 2: text | col 3: animation */
  grid-template-columns: 80px 1fr 1fr;
  grid-template-areas: "social text animation";
  align-items: center;
  min-height: calc(100vh - var(--nav-height) - 32px);
  padding: 3rem var(--section-padding-x);
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* =======================
   SOCIAL SIDEBAR
======================= */
.social-bar {
  grid-area: social;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  /* Vertical line below icons */
  padding-bottom: 2rem;
  position: relative;
}

.social-bar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 60px;
  background: var(--color-border-subtle);
}

.social-bar a {
  width: 46px;
  height: 46px;
  background: var(--color-bg-secondary);
  color: var(--color-text-white);
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

.social-bar a:hover {
  background: var(--color-accent-primary);
  color: var(--color-text-inverse);
  transform: translateY(-3px) scale(1.08);
}

/* Hide desktop social bar on mobile — shown separately */
@media (max-width: 768px) {
  .social-bar {
    display: none;
  }
}

/* =======================
   HERO TEXT
======================= */
.hero-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-greeting {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-role {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 400;
  color: var(--color-text-secondary);
}

.hero-summary {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 500px;
  margin-top: 0.5rem;
}

.hero-typed {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.typed-label {
  font-weight: 500;
}

#element {
  color: var(--color-accent-primary);
  font-weight: 600;
  min-width: 120px;
}

.accent {
  color: var(--color-accent-primary);
}

/* =======================
   HERO ANIMATION
======================= */
.hero-animation {
  grid-area: animation;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-animation lottie-player {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.nav-panel-label {
  display: none;
}
/* =======================
   TABLET HERO (768px–1024px)
======================= */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero {
    grid-template-columns: 60px 1fr 1fr;
    padding: 2rem 2rem;
    gap: 1.5rem;
  }

  .hero-animation lottie-player {
    max-width: 380px;
  }
}

/* =======================
   MOBILE HERO (≤768px)
======================= */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "animation"
      "text";
    min-height: auto;
    padding: 2rem 1.25rem 1.5rem;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-text {
    align-items: center;
  }

  .hero-summary {
    max-width: 100%;
  }

  .hero-typed {
    justify-content: center;
  }

  .hero-animation {
    order: -1;
  }

  .hero-animation lottie-player {
    max-width: 260px;
  }
}

/* =======================
   MOBILE SOCIAL BAR (bottom)
======================= */
.social-bar-mobile {
  display: none;
}

@media (max-width: 768px) {
  .social-bar-mobile {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem 1rem 2rem;
  }

  .social-bar-mobile a {
    width: 44px;
    height: 44px;
    background: var(--color-bg-secondary);
    color: var(--color-text-white);
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    text-decoration: none;
    transition:
      background 0.3s ease,
      transform 0.3s ease;
  }

  .social-bar-mobile a:hover {
    background: var(--color-accent-primary);
    color: var(--color-text-inverse);
    transform: scale(1.1);
  }
}

@media (max-width: 768px) {
  .nav-links li a:hover {
    color: var(--color-accent-primary);
    letter-spacing: 0.12em;
  }
}

@media (max-width: 768px) {
  .nav-right {
    position: absolute;
    top: calc(100% + 12px);
    right: -5;
    height: auto;
    width: 220px;
    /* position: fixed; 
    top: 90px; 
    right: 16px; /
    left: auto; 
    width: 220px; */
    border-radius: 16px; /* rounded ALL sides */
    border: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-bg-primary) 92%, transparent);
    backdrop-filter: blur(24px);
    padding: 1rem 0;

    transform: translateY(-10px) scale(0.97); /* starts slightly up + small */
    opacity: 0;
    visibility: hidden;
    transform-origin: top right;
    transition:
      transform 0.25s ease,
      opacity 0.25s ease,
      visibility 0.25s;
  }

  .nav-right.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
  }
}
/* =======================
   SECTION DIVIDER
======================= */
.section-divider {
  border: none;
  height: 1px;
  background: var(--color-border-subtle);
  margin: 2.5rem var(--section-padding-x);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .section-divider {
    margin: 1.5rem 1.25rem;
  }
}

/* =======================
   WORK EXPERIENCE SECTION
======================= */
.work-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem var(--section-padding-x) 4rem;
}

.section-eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .work-section {
    padding: 1.5rem 1.25rem 3rem;
  }
}

/* =======================
   THEME SWITCHER
======================= */
.theme-switcher {
  position: fixed;
  top: 30%;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  align-items: flex-end;
}

.theme-item {
  position: relative;
  width: 28px;
  height: 36px;
  background: #1e293b;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  transition: width 0.3s ease;
}

.theme-item::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
}

.theme-item::before {
  content: attr(data-name);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.theme-item:hover {
  width: 90px;
}

.theme-item:hover::before {
  opacity: 1;
}

.theme-item:nth-child(1)::after {
  background: #38bdf8;
}
.theme-item:nth-child(2)::after {
  background: #a855f7;
}
.theme-item:nth-child(3)::after {
  background: #22c55e;
}
.theme-item:nth-child(4)::after {
  background: #ef4444;
}
.theme-item:nth-child(5)::after {
  background: #f97316;
}

/* On small screens: smaller theme dots */
@media (max-width: 480px) {
  .theme-switcher {
    gap: 7px;
    top: auto;
    bottom: 80px; /* above mobile social bar space */
  }

  .theme-item {
    width: 22px;
    height: 28px;
  }

  .theme-item:hover {
    width: 80px;
  }

  .theme-item::before {
    font-size: 0.7rem;
  }
}

/* hide strip on desktop, show only in mobile menu */
.nav-theme-strip {
  display: none;
}

@media (max-width: 768px) {
  /* hide the old right-edge switcher */
  .theme-switcher {
    display: none;
  }

  /* show strip inside the card */
  .nav-theme-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
  }

  .nav-theme-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
  }

  .nav-theme-dots {
    display: flex;
    gap: 12px;
  }

  .theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition:
      transform 0.2s ease,
      border-color 0.2s ease;
    padding: 0;
  }

  .theme-dot:hover,
  .theme-dot:focus {
    transform: scale(1.3);
    border-color: rgba(255, 255, 255, 0.45);
    outline: none;
  }
}
