/*===== LIGHT MODE VARIABLES =====*/
body.light-mode {
  --bg-primary:   #f5f3ff;
  --bg-secondary: #ede9fe;
  --bg-alt:       #eee8ff;
  --text-primary:   #12121f;
  --text-secondary: rgba(18, 18, 31, 0.65);
  --text-muted:     rgba(18, 18, 31, 0.62);
  --glass-bg:     rgba(255, 255, 255, 0.65);
  --glass-border: rgba(124, 58, 237, 0.15);
  --glass-hover:  rgba(124, 58, 237, 0.08);
  --gradient-card: linear-gradient(145deg, rgba(124,58,237,0.07) 0%, rgba(236,72,153,0.04) 100%);
}

/* Light mode specific overrides */
body.light-mode .l-header {
  background: rgba(245, 243, 255, 0.85);
  border-bottom-color: rgba(124, 58, 237, 0.12);
  box-shadow: 0 4px 30px rgba(124, 58, 237, 0.08);
}
body.light-mode .nav__menu {
  background: rgba(245, 243, 255, 0.98);
  border-left-color: rgba(124, 58, 237, 0.12);
}
body.light-mode .nav__logo {
  /* gradient already looks great on light */
}
body.light-mode .nav__link {
  color: rgba(18, 18, 31, 0.6);
}
body.light-mode .nav__link:hover {
  color: var(--text-primary);
}
body.light-mode .nav__toggle {
  color: var(--text-primary);
}
body.light-mode .home {
  background:
    radial-gradient(ellipse 140% 100% at -20% -20%, rgba(124, 58, 237, 0.12) 0%, transparent 100%),
    radial-gradient(ellipse 120% 90% at 120% 120%, rgba(236, 72, 153, 0.07) 0%, transparent 100%),
    var(--bg-primary);
}
body.light-mode .home__img-ring::after {
  background: var(--bg-primary);
}
body.light-mode .home .home__fade {
  background: linear-gradient(to bottom, transparent, var(--bg-alt));
}
body.light-mode .skills__data {
  box-shadow: 0 2px 16px rgba(124, 58, 237, 0.08);
}
body.light-mode .contact__input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(124, 58, 237, 0.2);
  color: var(--text-primary);
}
body.light-mode .contact__input:focus {
  background: #fff;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
body.light-mode .footer {
  background: var(--bg-secondary);
  border-top-color: rgba(124, 58, 237, 0.12);
}
body.light-mode .about__exp-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(124, 58, 237, 0.15);
}
body.light-mode .work__img {
  border-color: rgba(124, 58, 237, 0.12);
}
body.light-mode .project__card {
  background: rgba(255, 255, 255, 0.7);
}

/*===== CSS VARIABLES =====*/
:root {
  --header-height: 3.5rem;
  --font-semi: 600;

  /* Core colors */
  --first-color: #7c3aed;
  --second-color: #050510;

  /* Backgrounds */
  --bg-primary: #050510;
  --bg-secondary: #0a0a1f;
  --bg-alt: #080820;

  /* Accent colors */
  --color-purple: #7c3aed;
  --color-pink: #ec4899;
  --color-cyan: #06b6d4;
  --color-indigo: #4f46e5;

  /* Text */
  --text-primary: #f0eeff;
  --text-secondary: rgba(240, 238, 255, 0.65);
  --text-muted: rgba(240, 238, 255, 0.55);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(124, 58, 237, 0.1);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --gradient-secondary: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --gradient-card: linear-gradient(145deg, rgba(124,58,237,0.12) 0%, rgba(236,72,153,0.06) 100%);

  /* Typography */
  --body-font: 'Poppins', sans-serif;
  --display-font: 'Space Grotesk', sans-serif;
  --big-font-size: 2.6rem;
  --h2-font-size: 1.5rem;
  --normal-font-size: 0.938rem;

  /* Spacing */
  --mb-1: 0.5rem;
  --mb-2: 1rem;
  --mb-3: 1.5rem;
  --mb-4: 2rem;
  --mb-5: 2.5rem;
  --mb-6: 3rem;

  /* Z-index */
  --z-back: -10;
  --z-normal: 1;
  --z-tooltip: 10;
  --z-fixed: 100;
}

@media screen and (min-width: 768px) {
  :root {
    --big-font-size: 3.8rem;
    --h2-font-size: 2.25rem;
    --normal-font-size: 1rem;
  }
}

/* ===== PROFILE IMAGE FLIP ===== */
.front, .back {
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
}
.front {
  z-index: 2;
  transform: rotateY(0deg);
  transition: all 1s ease;
}
.back {
  transition: all 1s ease;
  transform: rotateY(180deg);
}
.home__img .container {
  position: relative;
  border-radius: 50%;
  width: 280px;
  height: 280px;
  overflow: hidden;
}

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%       { opacity: 0.85; transform: scale(1.06); }
}
@keyframes gradient-pan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ===== BASE ===== */
*, ::before, ::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: var(--header-height) 0 0 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  text-decoration: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== SECTION STYLES ===== */
.section-title {
  position: relative;
  font-size: var(--h2-font-size);
  font-family: var(--display-font);
  font-weight: 800;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-pan 5s ease infinite;
  margin-top: var(--mb-2);
  margin-bottom: var(--mb-4);
  text-align: center;
  letter-spacing: -0.5px;
}
.section-title::after {
  position: absolute;
  content: "";
  width: 60px;
  height: 3px;
  left: 0;
  right: 0;
  margin: auto;
  top: 2.8rem;
  background: var(--gradient-primary);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.7);
}
.section {
  padding-top: 4rem;
  padding-bottom: 3rem;
}

/* ===== LAYOUT ===== */
.bd-grid {
  max-width: 1024px;
  display: grid;
  grid-template-columns: 100%;
  grid-column-gap: 2rem;
  width: calc(100% - 2rem);
  margin-left: auto;
  margin-right: auto;
}

/* ===== HEADER ===== */
.l-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background: rgba(5, 5, 16, 0.8);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

/* ===== NAV ===== */
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-semi);
}
@media screen and (max-width: 768px) {
  .nav__menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 80%;
    bottom: 0;
    padding: 2.5rem 2rem;
    background: rgba(5, 5, 16, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
.nav__item {
  margin-bottom: var(--mb-4);
}
.nav__link {
  position: relative;
  color: var(--text-secondary);
  transition: color 0.3s;
  font-size: 0.9rem;
  letter-spacing: 0.4px;
}
.nav__link:hover {
  color: var(--text-primary);
}
.nav__link:hover::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 2px;
  left: 0;
  top: 1.8rem;
  background: var(--gradient-primary);
  border-radius: 2px;
}
.nav__logo {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-pan 4s ease infinite;
  letter-spacing: -0.5px;
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.3s;
}
.nav__toggle:hover {
  color: var(--color-purple);
}
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.theme-toggle:hover {
  color: var(--color-purple);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.25);
  transform: rotate(20deg);
}

/* Active link */
.active {
  color: var(--text-primary) !important;
}
.active::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 2px;
  left: 0;
  top: 1.8rem;
  background: var(--gradient-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
}

/* Show menu */
.show {
  right: 0;
}

/* ===== HOME ===== */
.home {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow: hidden;
  background:
    radial-gradient(ellipse 140% 100% at -20% -20%, rgba(124, 58, 237, 0.14) 0%, transparent 100%),
    radial-gradient(ellipse 120% 90% at 120% 120%, rgba(236, 72, 153, 0.09) 0%, transparent 100%),
    var(--bg-primary);
  /* Override bd-grid to be full width */
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: center;
  justify-items: center;
  text-align: center;
  gap: 2rem;
  padding: 3rem 2rem 2.5rem;
}

/* Bottom fade to blend into next section */
.home .home__fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg-alt));
  pointer-events: none;
  z-index: 0;
}


/* Available badge */
.home__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(167, 139, 250, 1);
  margin-bottom: var(--mb-3);
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
}
.home__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
  animation: pulse-glow 2s ease-in-out infinite;
  flex-shrink: 0;
}

.home__data {
  z-index: 1;
  order: 2;
}
.home__title {
  font-family: var(--display-font);
  font-size: var(--big-font-size);
  font-weight: 800;
  margin-bottom: var(--mb-4);
  line-height: 1.12;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}
.home__title-color {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-pan 4s ease infinite;
  display: inline-block;
}
.home__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: var(--mb-4);
}

/* Home Social Icons */
.home__social {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  z-index: 1;
}
.home__social .skills__icon {
  font-size: 1.2rem;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}
.home__social .skills__icon:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.55);
  transform: translateY(-3px) scale(1.1);
}

/* Profile Image */
.home__img {
  z-index: 1;
  order: 1;
  display: flex;
  justify-content: center;
}
/* Glow ring wrapper */
.home__img-ring {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Animated conic ring */
.home__img-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7c3aed, #ec4899, #06b6d4, #7c3aed);
  animation: spin-slow 6s linear infinite;
  opacity: 0.9;
  z-index: 0;
}
/* Gap between ring and image — transparent to inherit section bg */
.home__img-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-primary);
  z-index: 1;
  box-shadow: none;
}
.home__img .container {
  z-index: 2;
  position: relative;
  width: 205px;
  height: 205px;
}
/* Outer glow pulse */
.home__img-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, transparent 65%);
  animation: pulse-glow 3s ease-in-out infinite;
  z-index: -1;
}

/* ===== BUTTON ===== */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: #fff;
  padding: 0.85rem 2.5rem;
  font-weight: 700;
  border-radius: 50px;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: gradient-pan 4s ease infinite;
  box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
}
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55);
}
.button:hover::before {
  opacity: 1;
}

/* ===== ABOUT ===== */
.about__container {
  row-gap: 2rem;
  text-align: center;
}
.about__subtitle {
  margin-bottom: var(--mb-2);
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 1.6rem;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.about__img {
  justify-self: center;
}
.about__img img {
  width: 220px;
  border-radius: 1.5rem;
  border: 2px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.25), 0 0 0 6px rgba(124, 58, 237, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.about__img img:hover {
  transform: scale(1.04) translateY(-6px);
  box-shadow: 0 30px 80px rgba(124, 58, 237, 0.4);
}
.about__text {
  color: var(--text-secondary);
  line-height: 1.85;
}
.about__text a {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  position: relative;
}
.about__text a:hover {
  opacity: 0.8;
}

/* Experience cards inside About — full-width row below photo+bio */
.about__experience {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media screen and (min-width: 768px) {
  .about__experience {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0.5rem;
  }
}
.about__exp-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--color-purple);
  border-radius: 0 1rem 1rem 0;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.about__exp-card:hover {
  border-left-color: var(--color-pink);
  background: var(--glass-hover);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.15);
}
.about__exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.about__exp-role {
  display: block;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.about__exp-company {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0.15rem;
  transition: opacity 0.2s;
}
.about__exp-company:hover {
  opacity: 0.75;
}
.about__exp-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.9);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 50px;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}
.about__exp-period {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.about__exp-period i {
  font-size: 0.9rem;
  color: var(--color-purple);
}
.about__exp-desc {
  font-size: 0.845rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* Grouped card (multiple roles, same company) */
.about__exp-group {
  border-left-color: var(--color-cyan);
}
.about__exp-group:hover {
  border-left-color: var(--color-indigo);
}
.about__exp-company-main {
  display: block;
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: opacity 0.2s;
}
.about__exp-company-main:hover {
  opacity: 0.75;
}
.about__exp-duration {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.about__exp-role-item {
  display: flex;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}
.about__exp-role-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-secondary);
  margin-top: 0.35rem;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* ===== SKILLS ===== */
.skills__container {
  row-gap: 2rem;
  text-align: center;
}
.skills__subtitle {
  margin-bottom: var(--mb-2);
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 1.3rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.skills__text {
  margin-bottom: var(--mb-4);
  color: var(--text-secondary);
  line-height: 1.8;
}
.skills__data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  font-weight: var(--font-semi);
  padding: 0.85rem 1.25rem;
  margin-bottom: var(--mb-3);
  border-radius: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.skills__data::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.35s;
}
.skills__data:hover {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.18), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateX(6px);
}
.skills__data:hover::before {
  opacity: 1;
}

/* Skills icons in skills section */
.skills__data .skills__icon,
.skills__names i.skills__icon {
  font-size: 1.9rem;
  margin-right: var(--mb-2);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  z-index: 1;
  border: none;
  padding: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  backdrop-filter: none;
}
.skills__names {
  display: flex;
  align-items: center;
  z-index: 1;
}
.skills__name {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
}
.skills__percentage {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  z-index: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Skill bars */
.skills__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--gradient-primary);
  height: 3px;
  border-radius: 0 3px 3px 0;
  z-index: var(--z-back);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.7), 0 0 20px rgba(236, 72, 153, 0.3);
}
.skills__100 { width: 100%; }
.skills__95  { width: 95%; }
.skills__90  { width: 90%; }
.skills__85  { width: 85%; }
.skills__80  { width: 80%; }
.skills__75  { width: 75%; }
.skills__70  { width: 70%; }
.skills__65  { width: 65%; }
.skills__60  { width: 60%; }

.skills__img {
  border-radius: 1.5rem;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--glass-border);
}

/* ===== WORK ===== */
.work__container {
  row-gap: 1.5rem;
}
.work__img {
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 1 / 1;
}
.work__img::after {
  content: "Ver App ↗";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.9) 0%, rgba(236, 72, 153, 0.85) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--display-font);
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.35s;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.work__img:hover {
  transform: translateY(-10px);
  box-shadow: 0 24px 60px rgba(124, 58, 237, 0.4), 0 0 0 1px rgba(124, 58, 237, 0.3);
}
.work__img:hover::after {
  opacity: 1;
}
.work__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.work__img:hover img {
  transform: scale(1.1);
}

/* Games hover label */
.games .work__img::after {
  content: "Jugar ↗";
  background: linear-gradient(160deg, rgba(6, 182, 212, 0.9) 0%, rgba(79, 70, 229, 0.85) 100%);
  pointer-events: none;
}

/* ===== PERSONAL PROJECTS ===== */
.projects.section {
  background: var(--bg-alt);
}
.projects__container {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.project__card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  color: inherit;
}
.project__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.35s;
}
.project__card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2), 0 0 0 1px rgba(124, 58, 237, 0.15);
}
.project__card:hover::before {
  opacity: 1;
}
.project__icon-wrap {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.35s;
  z-index: 1;
}
.project__card:hover .project__icon-wrap {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}
.project__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.project__body {
  flex: 1;
  z-index: 1;
}
.project__name {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.project__desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
}
.project__card:hover .project__link {
  opacity: 0.8;
}

/* ===== CONTACT ===== */
.contact__container {
  justify-items: center;
}
.contact__form {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.75rem;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.contact__form::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 60%);
  pointer-events: none;
}
.contact__input {
  width: 100%;
  font-size: 1rem;
  font-family: var(--body-font);
  font-weight: 500;
  padding: 1rem 1.25rem;
  border-radius: 0.875rem;
  border: 1.5px solid var(--glass-border);
  outline: none;
  margin-bottom: var(--mb-3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transition: all 0.3s;
}
.contact__input::placeholder {
  color: var(--text-muted);
}
.contact__input:focus {
  border-color: var(--color-purple);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
textarea.contact__input {
  resize: vertical;
  min-height: 140px;
}
.contact__button {
  display: block;
  border: none;
  outline: none;
  font-size: var(--normal-font-size);
  font-family: var(--body-font);
  cursor: pointer;
  margin-left: auto;
  width: 100%;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  font-weight: var(--font-semi);
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 2px;
  background: var(--gradient-primary);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}
.footer__title {
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--mb-4);
  background: var(--gradient-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-pan 4s ease infinite;
}
.footer__social {
  margin-bottom: var(--mb-4);
}
.footer__icon {
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.footer__icon:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

/* ===== SECTION BACKGROUND VARIATIONS ===== */
.about.section {
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}
.about.section::before {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.07) 0%, transparent 65%);
  top: -80px;
  right: -80px;
  border-radius: 50%;
  pointer-events: none;
}
.skills.section {
  background: var(--bg-primary);
}
.work.section {
  background: var(--bg-alt);
}
.games.section {
  background: var(--bg-primary);
}
.projects.section {
  background: var(--bg-alt);
}
.contact.section {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}
.contact.section::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

/* ===== MEDIA QUERIES ===== */
@media screen and (min-width: 768px) {
  body {
    margin: 0;
  }

  .bd-grid {
    max-width: 1024px;
    display: grid;
    grid-template-columns: 100%;
    grid-column-gap: 1rem;
    width: calc(100% - 2rem);
    margin-left: auto;
    margin-right: auto;
  }

  .home__title {
    font-size: 3.5rem;
    letter-spacing: -2px;
  }
  .section {
    padding-top: 5rem;
    padding-bottom: 4rem;
  }
  .section-title {
    margin-bottom: var(--mb-6);
  }
  .section-title::after {
    width: 80px;
    top: 3.2rem;
  }

  .nav {
    height: calc(var(--header-height) + 0.5rem);
  }
  .nav__list {
    display: flex;
    padding-top: 0;
    gap: 0.25rem;
  }
  .nav__item {
    margin-left: var(--mb-5);
    margin-bottom: 0;
  }
  .nav__toggle {
    display: none;
  }
  .nav__link {
    color: var(--text-secondary);
    padding: 0.25rem 0;
  }

  .home {
    min-height: 100vh;
    grid-template-columns: 1fr 1fr !important;
    text-align: left;
    padding: 0 calc((100% - 1024px) / 2 + 2rem);
    gap: 3rem;
  }
  .home__data {
    order: 1;
    align-self: center;
  }
  .home__img {
    order: 2;
    align-self: center;
    justify-content: center;
  }
  .home__actions {
    justify-content: flex-start;
  }
  .home__img-ring {
    width: 360px;
    height: 360px;
  }
  .home__img .container {
    width: 340px;
    height: 340px;
  }

  .about__container,
  .skills__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: initial;
  }
  .about__img img {
    width: 300px;
  }
  .work__container {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 1.5rem;
  }
  .projects__container {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact__form {
    width: 440px;
  }
  .contact__container {
    justify-items: center;
  }
}

@media screen and (min-width: 1024px) {
  .bd-grid {
    margin-left: auto;
    margin-right: auto;
  }
  .home__img-ring {
    width: 420px;
    height: 420px;
  }
  .home__img .container {
    width: 400px;
    height: 400px;
  }
  .home__title {
    font-size: 4rem;
  }
}

/* ===== V3 FIXES ===== */
/* backdrop-filter on .l-header made it the containing block for the fixed mobile menu (menu collapsed to 80px). */
.l-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
/* The .bd-grid rule inside the 768px media query (display:grid) overrode .nav's flex. */
.nav.bd-grid { display: flex; }

.lang-toggle {
  font-family: var(--display-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
html[lang="en"] [lang="es"],
html[lang="es"] [lang="en"] { display: none !important; }

.button--ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  animation: none;
}
.button--ghost:hover { box-shadow: 0 12px 40px rgba(124, 58, 237, 0.25); }



.project__body { min-width: 0; }
.project__link { overflow-wrap: anywhere; }
.project__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.games__hub {
  width: calc(100% - 2rem);
  margin: 0 auto var(--mb-4);
  text-align: center;
  color: var(--text-secondary);
}
/* Delisted games: small and muted on purpose */
.games__legacy { margin-top: var(--mb-5); }
.games__legacy-title {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.games__legacy-note {
  max-width: 46ch;
  margin: 0.25rem auto var(--mb-2);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.games__legacy-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.games__legacy-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass-bg);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.3s, border-color 0.3s;
}
.games__legacy-item:hover { color: var(--text-primary); border-color: rgba(124, 58, 237, 0.35); }
.games__legacy-item img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  filter: grayscale(0.7);
}
.games__legacy-tag { font-size: 0.7rem; color: var(--text-muted); }
.project__logo-fallback { font-size: 1.8rem; color: var(--text-secondary); }

.contact__note {
  max-width: 440px;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--mb-3);
}
.contact__direct {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: var(--mb-4);
}

body.light-mode .home__badge,
body.light-mode .about__exp-badge { color: #6d28d9; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 3px;
}

/* Touch screens keep :hover after a tap; drop the lifts there. */
@media (hover: none) {
  .work__img:hover,
  .project__card:hover,
  .skills__data:hover,
  .home__social .skills__icon:hover,
  .footer__icon:hover,
  .button:hover,
  .about__img img:hover,
  .about__exp-card:hover,
  .theme-toggle:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

.nav__logo,
.nav__link { white-space: nowrap; }
/* Tablets / small laptops: 7 links (longer in Spanish) + 2 buttons don't fit inline, so use the slide-in menu.
   Also covers exactly 768px, where the original hid both the inline links and the toggle. */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .nav__menu {
    position: fixed;
    top: calc(var(--header-height) + 0.5rem);
    right: -100%;
    bottom: 0;
    width: min(80%, 360px);
    padding: 2.5rem 2rem;
    background: rgba(5, 5, 16, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav__menu.show { right: 0; }
  .nav__list { display: block; }
  .nav__item { margin-left: 0; margin-bottom: var(--mb-4); }
  .nav__toggle { display: flex; }
}

/* ===== SKILLS (v3): capabilities, each with proof ===== */
.skills__intro {
  width: calc(100% - 2rem);
  max-width: 60ch;
  margin: 0 auto var(--mb-5);
  text-align: center;
  color: var(--text-secondary);
}
.caps { gap: 1.25rem; }
@media screen and (min-width: 768px) {
  .caps { grid-template-columns: repeat(2, 1fr); }
  .cap--mobile, .cap--wide { grid-column: span 2; }
}
@media screen and (min-width: 1024px) {
  .caps { grid-template-columns: repeat(3, 1fr); }
  .cap.cap--wide { grid-column: span 3; flex-direction: row; align-items: center; gap: 2.5rem; }
  .cap--wide .cap__head { flex: 0 0 30%; }
}
.cap {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  border-radius: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cap:hover { border-color: rgba(124, 58, 237, 0.35); transform: translateY(-4px); }
body.light-mode .cap { background: rgba(255, 255, 255, 0.7); }
.cap__head { display: flex; flex-direction: column; gap: 0.6rem; }
.cap__title {
  font-family: var(--display-font);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}
.cap__text { max-width: 60ch; font-size: 0.92rem; line-height: 1.7; color: var(--text-secondary); }
.cap__icons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cap__icons img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--glass-border);
}
/* margin-top:auto lines the chips up along the bottom of cards that share a row */
.cap__stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }
.cap--wide .cap__stack { margin-top: 0; }
.cap__stack li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}
.cap__stack i { font-size: 1rem; color: #a78bfa; }
body.light-mode .cap__stack i { color: var(--color-purple); }
.cap__where { font-weight: 500; color: var(--text-muted); }
.cap__proof { font-size: 0.82rem; color: var(--text-secondary); }
.cap__proof a,
.cap__more {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-purple);
  text-underline-offset: 3px;
}
.cap__setup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.cap__setup i { font-size: 1.1rem; color: #a78bfa; }
body.light-mode .cap__setup i { color: var(--color-purple); }
.cap__setup strong { font-weight: 600; color: var(--text-primary); }
.cap__more { display: inline-flex; align-items: center; gap: 0.25rem; align-self: flex-start; font-size: 0.85rem; }
.cap--ai {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box, var(--gradient-primary) border-box;
}
body.light-mode .cap--ai { background: linear-gradient(#fff, #fff) padding-box, var(--gradient-primary) border-box; }
.cap__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background: var(--color-purple);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
@media (hover: none) { .cap:hover { transform: none; } }

/* ===== V3 POLISH ===== */
p { text-wrap: pretty; }
.home__title,
.section-title,
.cap__title { text-wrap: balance; }

/* Hero: the original side padding calc() went negative between 768–960px; also clear the fixed header. */
@media screen and (min-width: 768px) {
  .home { padding: calc(var(--header-height) + 2.5rem) max(2rem, calc((100% - 1024px) / 2 + 2rem)) 3rem; }
}
@media screen and (max-width: 767px) {
  .home { gap: 1.25rem; padding-top: 1.5rem; }
  .home__img-ring { width: 160px; height: 160px; }
  .home__img .container { width: 148px; height: 148px; }
  .home__title { font-size: 2.2rem; }
}

/* Section titles: underline under the text, not through descenders (p, g, y). */
.section-title { padding-bottom: 0.75rem; }
.section-title::after { top: auto; bottom: 0; }

/* Alternate backgrounds in the new section order: about, work, skills, projects, games, contact. */
.work.section { background: var(--bg-primary); }
.skills.section { background: var(--bg-alt); }
.projects.section { background: var(--bg-primary); }
.games.section { background: var(--bg-alt); }

/* Same height for filled and outlined buttons. */
.button:not(.button--ghost) { border: 1px solid transparent; }
.contact__direct .button { flex: 1 1 140px; justify-content: center; }

/* About: left-aligned text; experience cards share one shape, no colored side stripe. */
.about__experience,
.about__text { text-align: left; }
.about__exp-card { border-left-width: 1px; border-left-color: var(--glass-border); border-radius: 1rem; }
.about__exp-card:hover { border-color: rgba(124, 58, 237, 0.35); }
body.light-mode .about__exp-card:hover { border-color: rgba(124, 58, 237, 0.35); }

/* Work: role line, and store links as readable pills (gradient text was ~3.4:1). */
.project__role {
  margin: -0.25rem 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.project__stores .project__link {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass-bg);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: #c4b5fd;
  font-size: 0.82rem;
}
body.light-mode .project__stores .project__link { color: var(--color-purple); }
.project__stores .project__link:hover { border-color: rgba(124, 58, 237, 0.45); }
/* Work cards aren't links themselves, so they shouldn't lift like the clickable Projects cards. */
div.project__card:hover { transform: none; box-shadow: none; }
div.project__card:hover::before { opacity: 0; }

/* Skills chips: keep "· App" together instead of orphaning the dot. */
.cap__stack li { flex-wrap: wrap; }
.cap__where { white-space: nowrap; }

/* Games: screenshot tiles. */
.games__grid { gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media screen and (min-width: 768px) {
  .games__grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
}
.game-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  transition: border-color 0.3s;
}
.game-tile__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.game-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 5, 16, 0.92) 0%, rgba(5, 5, 16, 0.55) 38%, transparent 68%);
}
.game-tile__info {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem;
}
.game-tile__icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; }
.game-tile__name {
  display: block;
  font-family: var(--display-font);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}
.game-tile__desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
}
@media (hover: hover) {
  .game-tile:hover { border-color: rgba(124, 58, 237, 0.5); }
  .game-tile:hover .game-tile__shot { transform: scale(1.06); }
}

/* Phones: roomier text in cards. */
@media screen and (max-width: 599px) {
  .project__card { padding: 1.25rem; gap: 1rem; }
  .project__icon-wrap { width: 3rem; height: 3rem; border-radius: 0.85rem; }
  .game-tile__icon { display: none; }
}

/* Drawer menu (below 1024px): bigger links and a WhatsApp button. */
.nav__whatsapp { display: none; }
@media screen and (max-width: 1023px) {
  .nav__item { margin-bottom: 0.25rem; }
  .nav__link { display: inline-block; padding: 0.6rem 0; font-size: 1.1rem; }
  .nav__menu .nav__link.active::after,
  .nav__menu .nav__link:hover::after { top: auto; bottom: 0.3rem; }
  .nav__whatsapp { display: inline-flex; margin-top: var(--mb-3); }
}


/* ===== HERO (v3) ===== */
.home__title { margin-bottom: 0.5rem; }
.home__role {
  max-width: 30ch;
  margin: 0 auto var(--mb-3);
  font-family: var(--display-font);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-secondary);
}
.home__proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.home__proof a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.3s;
}
.home__proof a:hover { border-color: rgba(124, 58, 237, 0.45); }
.home__proof i { font-size: 1rem; color: #a78bfa; }
body.light-mode .home__proof i { color: var(--color-purple); }
.home__actions { margin-top: var(--mb-3); flex-wrap: nowrap; }
.home__links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: var(--mb-2);
  font-size: 0.85rem;
}
.home__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.home__links a:hover { color: var(--text-primary); }
.home__links i { font-size: 1.1rem; }

@media screen and (min-width: 768px) {
  .home__role { margin-left: 0; font-size: 1.35rem; }
  .home__proof,
  .home__links { justify-content: flex-start; }
}
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .home__img-ring { width: 300px; height: 300px; }
  .home__img .container { width: 284px; height: 284px; }
}
@media screen and (max-width: 767px) {
  /* Keep photo and text together instead of spreading the full-height section's leftover space between rows. */
  .home { align-content: center; }
  .home__title { font-size: 2.4rem; }
  .home__img-ring { width: 150px; height: 150px; }
  .home__img .container { width: 138px; height: 138px; }
}

/* Photo: zoom past the purple ring baked into perfil*.png (inner edge at r≈181/256 → 1.44×).
   The cartoon fades in on hover/tap instead of flipping (and squashing) every 5s. */
.home__img .front,
.home__img .back { transform: scale(1.44); transition: opacity 0.6s ease; }
.home__img .back { opacity: 0; }
.home__img-ring.is-flipped .front { opacity: 0; }
.home__img-ring.is-flipped .back { opacity: 1; }
@media (hover: hover) {
  .home__img-ring { cursor: pointer; }
  .home__img-ring:hover .front { opacity: 0; }
  .home__img-ring:hover .back { opacity: 1; }
}

/* Stickers: real app/game icons around the photo. */
.home__sticker {
  position: absolute;
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(18, 18, 31, 0.18), 0 0 0 3px var(--bg-primary);
  pointer-events: none;
  animation: sticker-float 6s ease-in-out infinite;
}
.home__sticker--1 { top: 4%; left: -6%; --r: -10deg; }
.home__sticker--2 { top: 10%; right: -8%; --r: 8deg; animation-delay: -1.5s; }
.home__sticker--3 { bottom: 8%; left: -8%; --r: 6deg; animation-delay: -3s; }
.home__sticker--4 { bottom: 0; right: -2%; --r: -6deg; animation-delay: -4.5s; }
@keyframes sticker-float {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-8px) rotate(var(--r)); }
}
@media screen and (max-width: 767px) {
  .home__sticker { width: 38px; height: 38px; border-radius: 10px; }
}

/* Scroll cue: spinning label around a gradient button, bottom-right corner of the hero. */
.home__scroll {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2;
  width: 104px;
  aspect-ratio: 1;
  /* backwards, not both: once in, the hide transition below must own opacity and transform. */
  animation: scroll-cue-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1s backwards;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}
.home__scroll.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem) scale(0.8);
}
.home__scroll-ring {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #c4b5fd;
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 700;
  animation: spin-slow 14s linear infinite;
}
body.light-mode .home__scroll-ring { fill: var(--color-purple); }
.home__scroll-dot {
  position: absolute;
  inset: 24%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 1.6rem;
  animation: scroll-ping 2.4s ease-out infinite;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.home__scroll:hover .home__scroll-dot { transform: scale(1.08); }
.home__scroll-dot i { animation: scroll-arrow 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.home__scroll-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Arrow drops in from the top, rests, then falls out the bottom. */
@keyframes scroll-arrow {
  0% { transform: translateY(-160%); }
  35%, 65% { transform: translateY(0); }
  100% { transform: translateY(160%); }
}
@keyframes scroll-ping {
  0% { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35), 0 0 0 0 rgba(236, 72, 153, 0.5); }
  70%, 100% { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35), 0 0 0 14px rgba(236, 72, 153, 0); }
}
@keyframes scroll-cue-in {
  from { opacity: 0; transform: translateY(1rem) scale(0.8); }
}
@media screen and (max-width: 767px) {
  /* Sit on the first screen's bottom edge even when the hero runs taller than the screen. */
  .home__scroll { width: 70px; right: 0.6rem; bottom: auto; top: calc(100svh - var(--header-height) - 70px - 0.75rem); }
  .home__scroll-dot { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .home__scroll-ring,
  .home__scroll-dot,
  .home__scroll-dot i { animation: none; }
}

/* Contact: where Eric works from (also in the page's structured data). */
.contact__location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: calc(var(--mb-4) * -0.5);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.contact__location i { font-size: 1.1rem; color: #a78bfa; }
body.light-mode .contact__location i { color: var(--color-purple); }

/* Two-column card grids: an odd last card (Projects has 3) sits centered instead of leaving a hole. */
@media screen and (min-width: 768px) {
  .projects__container > .project__card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 1.5rem) / 2);
  }
}
