:root {
   --mx: 50%;
   --my: 40%;
   --navbar-safe-top: 116px; /* si queda mucha separación baja a 108-112 */
   --rails-bottom: 0px;
}

body {
   background-color: #0a0a0a;
}

/* ===== Fondos alternados ===== */
#perfil,
#formacion,
#objetivos,
#contacto {
   background-color: var(--bg-mid, #0F1218);
}


/* ===== Section label (dorado) ===== */
.section-label {
   font-size: 0.85rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 3px;
   color: var(--accent-gold, #F0A830);
   margin-top: 0;
   margin-bottom: 0.5rem;
}

.section-title {
   font-size: clamp(1.8rem, 3.5vw, 2.5rem);
   font-weight: 800;
   color: var(--text-header, #E6F1FF);
   margin: 0.3rem 0;
   letter-spacing: -0.5px;
}

.section-subtitle {
   font-size: clamp(0.9rem, 1.5vw, 1rem);
   color: var(--text-muted, #6B7A94);
   margin: 0;
   font-weight: 400;
}

/* ===== Bio migrada desde Hero ===== */
.perfil-bio-migrada {
   color: var(--text-body);
   line-height: 1.7;
   margin-bottom: 1rem;
   font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}
.perfil-bio-migrada strong,
#perfil .sr-slide-left strong {
   color: var(--accent-gold, #F0A830);
}

/* ===== Bullets dorados en todas las listas ===== */
#experiencia ul li::marker,
#perfil ul li::marker,
#objetivos ul li::marker {
   color: var(--accent-gold, #F0A830);
}

/* ===== Experiencia Card ===== */
.exp-card {
   background: rgba(15, 18, 24, 0.7);
   border: 1px solid rgba(255, 255, 255, 0.08);
   border-left: 3px solid var(--accent-gold, #F0A830);
   border-radius: 16px;
   padding: 1.5rem;
   display: flex;
   flex-direction: column;
   gap: 1.2rem;
   transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.exp-card:hover {
   border-color: rgba(240, 168, 48, 0.35);
   box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.exp-card__header {
   display: flex;
   justify-content: space-between;
   align-items: center;
}
.exp-card__period {
   display: flex;
   align-items: center;
   gap: 1rem;
}
.exp-card__date {
   font-family: 'Fira Code', monospace;
   font-size: 0.85rem;
   color: var(--accent-gold, #F0A830);
   font-weight: 500;
}
.exp-card__badge {
   font-size: 0.7rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 1px;
   padding: 0.25rem 0.75rem;
   border-radius: 20px;
   background: rgba(240, 168, 48, 0.1);
   color: var(--accent-gold, #F0A830);
   border: 1px solid rgba(240, 168, 48, 0.2);
}
.exp-card__body {
   display: flex;
   flex-direction: column;
   gap: 0.3rem;
}
.exp-card__org-row {
   display: flex;
   flex-direction: column;
   align-items: flex-start;
   gap: 0.75rem;
}

@media (min-width: 768px) {
   .exp-card__org-row {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
   }
}
.exp-card__logo {
   height: 47px;
   width: auto;
   max-width: 208px;
   object-fit: contain;
   flex-shrink: 0;
}

@media (min-width: 768px) {
   .exp-card__logo {
      height: 65px;
      max-width: 325px;
   }
}
.exp-card__org {
   font-size: 1.1rem;
   font-weight: 700;
   color: var(--text-header, #E6F1FF);
   margin: 0;
}
.exp-card__dept {
   font-size: 0.9rem;
   color: var(--text-body, #ECEBF3);
   margin: 0;
}
.exp-card__role {
   font-size: 0.95rem;
   color: var(--text-body, #ECEBF3);
   margin: 0.5rem 0 0 0;
   line-height: 1.6;
}
.exp-card__achievements {
   padding-top: 0.5rem;
   border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.exp-card__achievements-title {
   font-size: 0.8rem;
   font-weight: 600;
   color: var(--text-muted, #6B7A94);
   text-transform: uppercase;
   letter-spacing: 1px;
   margin: 0 0 0.6rem 0;
}
.exp-card__list {
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
   padding-left: 1.2rem;
   margin: 0;
   color: var(--text-body, #ECEBF3);
   font-size: 0.9rem;
   line-height: 1.6;
}
.exp-card__list li::marker {
   color: var(--accent-gold, #F0A830);
}
@media (min-width: 768px) {
   .exp-card {
      padding: 2rem 2.5rem;
   }
   .exp-card__org {
      font-size: 1.3rem;
   }
}

/* ===== Cursor spotlight — DESACTIVADO ===== */
.cursor-spotlight {
   display: none;
}

/* ===== Global stars canvas (debe ir al fondo, pero visible) ===== */
#site-stars {
   position: fixed;
   inset: 0;
   pointer-events: none;
   z-index: 0;
   overflow: hidden;

   /* opcional: no ensucia el extremo inferior */
   -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 92%, transparent 100%);
   mask-image: linear-gradient(to bottom, #000 0%, #000 92%, transparent 100%);

   opacity: 1;
   transition: opacity 180ms ease;
}

#site-stars canvas {
   width: 100%;
   height: 100%;
   display: block;
}

/* Drawer abierto: baja protagonismo */
:root[data-drawer-open="true"] #site-stars {
   opacity: 0.28;
}

/* ===== Scroll container (SIEMPRE arriba del canvas) ===== */
.scroll-container {
   height: 100vh;
   overflow-y: auto;
   position: relative;
   z-index: 2;

   /* clave: si por alguna razón te quedó un fondo opaco aquí, mata el canvas */
   background: transparent !important;
}

.section {
   scroll-snap-align: start;
   position: relative;
   z-index: 2;
}

#inicio {
   padding-top: var(--navbar-safe-top, 116px);
   padding-bottom: 3.5rem;
   padding-left: clamp(1.5rem, 5vw, 5.5rem);
   padding-right: clamp(1.5rem, 5vw, 5.5rem);
   min-height: 100vh;
   display: flex;
   align-items: center;
   scroll-margin-top: 6rem;
   box-sizing: border-box;
   overflow-x: hidden;
}

/* ===== Navbar ===== */
.navbar-wrapper {
   pointer-events: none;
   position: relative;
   z-index: 1101;
}

.navbar-center {
   display: flex;
   justify-content: center;
   padding-top: 1rem;
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   z-index: 1101;
   pointer-events: none;
}

#navbar-mobile {
   display: flex;
   justify-content: flex-end;
   padding: 1rem 1.5rem;
   position: fixed;
   top: 0;
   right: 0;
   z-index: 1101;
   pointer-events: auto;
}

.navbar-close-btn {
   align-self: flex-end;
   background: transparent;
   border: 1px solid var(--color-border);
   color: var(--text-body);
   width: 36px;
   height: 36px;
   border-radius: 999px;
   font-size: 1.1rem;
}

.navbar-pill {
   pointer-events: auto;
   gap: 1rem;
   background: rgba(10, 25, 47, 0.35);
   border: 2px solid rgba(35, 53, 84, 0.5);
   border-radius: 9999px;
   padding: 0.85rem 1.25rem;
   box-shadow: 0 8px 20px rgba(2, 12, 27, 0.2);
   transition:
      background 200ms ease,
      border-color 200ms ease,
      box-shadow 200ms ease;
   backdrop-filter: blur(10px);
   overflow: visible;
}
/* Cuando el drawer está abierto: el pill no debe verse (evita “círculo” detrás de la X) */
:root[data-drawer-open="true"] .navbar-pill {
   background: transparent !important;
   border-color: transparent !important;
   box-shadow: none !important;
   backdrop-filter: none !important;
}

:root[data-in-hero="false"] .navbar-pill {
   background: rgba(16, 16, 16, 0.72);
   border-color: rgba(255, 255, 255, 0.1);
   box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

:root[data-in-hero="true"] .navbar-pill {
   background: transparent;
   border-color: transparent;
   box-shadow: none;
   backdrop-filter: none;
}
.navbar-link {
   background: transparent;
   border: none;
   padding: 0;
   font-size: 0.95rem;
   font-weight: 500;
   color: var(--text-body);
   cursor: pointer;

   position: relative;
   display: inline-flex;
   align-items: center;

   /* Reserva espacio para la barra arriba */
   padding-top: 10px;

   /* Evita difuminado por compositing GPU del spotlight animado */
   transform: translateZ(0);
   -webkit-font-smoothing: antialiased;
}

.navbar-link::before {
   content: "";
   position: absolute;
   top: 0; /* dentro del link */
   left: 50%;
   width: 62%;
   height: 3px;
   border-radius: 999px;
   background: var(--accent-gold, #F0A830);

   opacity: 0;
   transform: translateX(-50%) scaleX(0);
   transform-origin: center;
   transition:
      opacity 150ms ease,
      transform 150ms ease;
}

.navbar-link.is-active::before {
   opacity: 1;
   transform: translateX(-50%) scaleX(1);
}

.navbar-link--projects {
   font-weight: 600;
   margin-left: 0.35rem;
}

@media (min-width: 1024px) {
   .navbar-pill {
      padding: 0.65rem 1.25rem;
   }
}

/* ===== Mobile hamburger button ===== */
.navbar-hamburger {
   background: rgba(26, 31, 42, 0.9);
   border: 1px solid rgba(240, 168, 48, 0.25);
   border-radius: 999px;
   padding: 0.6rem 1rem;
   color: var(--text-body, rgba(230, 241, 255, 0.92));
   backdrop-filter: blur(8px);
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
}

/* ===== Mobile drawer menu ===== */
.mobile-menu-overlay {
   position: fixed;
   inset: 0;
   z-index: 2000;

   /* CERRADO por defecto (overlay siempre montado) */
   visibility: hidden;
   pointer-events: none;

   /* espera a que termine el slide-out antes de ocultar */
   transition: visibility 0s linear 500ms;
}

.mobile-menu-overlay.is-open {
   visibility: visible;
   pointer-events: auto;
   transition: visibility 0s linear 0ms;
}

.mobile-menu-backdrop {
   position: absolute;
   inset: 0;
   background: rgba(0, 0, 0, 0.6);
   backdrop-filter: blur(2px);

   opacity: 0;
   transition: opacity 240ms ease;
}

.mobile-menu-overlay.is-open .mobile-menu-backdrop {
   opacity: 1;
}

.mobile-menu-panel {
   position: absolute;
   top: 0;
   right: 1rem;
   height: 100vh;
   width: min(78vw, 300px);
   background: rgba(16, 16, 16, 0.72);
   border-left: 1px solid rgba(255, 255, 255, 0.08);
   padding: 1rem;
   display: flex;
   flex-direction: column;
   gap: 0.8rem;
   overflow-y: auto;
   overscroll-behavior: contain;
   box-shadow: -16px 0 50px rgba(2, 12, 27, 0.45);

   /* SLIDE (cerrado por defecto) */
   transform: translateX(120%);
   transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
   will-change: transform;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
   transform: translateX(0);
}

@media (max-width: 400px) {
   .mobile-menu-panel {
      width: 85vw;
      border-left: none;
   }
}


.mobile-menu-link {
   display: flex;
   width: 100%;
   box-sizing: border-box;
   padding: 0.6rem 0.75rem !important;
   border-radius: 14px !important;
   text-decoration: none;
   background: transparent;
   border: 1px solid transparent;
   font-size: 1rem;
   font-weight: 600;
   color: var(--text-header);
   cursor: pointer;
   align-items: center;
   justify-content: flex-end !important;
   text-align: right !important;
   margin: 0 !important;
}

.mobile-menu-panel button.mobile-menu-link {
   justify-content: flex-end !important;
   padding-right: 0.75rem !important;
}

.mobile-menu-link:hover {
   background: rgba(240, 168, 48, 0.08);
   border-color: rgba(240, 168, 48, 0.25);
}

/* ===== Mobile hamburger (hamburguesa ⇄ X) ===== */
.hamburger {
   width: 24px;
   height: 24px;
   display: flex;
   flex-direction: column;
   justify-content: center;
   gap: 5px;
   -webkit-user-select: none;
   user-select: none;
}

.hamburger-line {
   display: block;
   width: 22px;
   height: 2px;
   background: currentColor;
   border-radius: 999px;

   transform-origin: 4px 0px;
   transition:
      transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
      opacity 0.55s ease;
}

.hamburger-line:nth-child(1) {
   transform-origin: 0% 0%;
}
.hamburger-line:nth-child(3) {
   transform-origin: 0% 100%;
}

.hamburger.is-open .hamburger-line:nth-child(1) {
   transform: rotate(45deg) translate(2px, 1px);
}

.hamburger.is-open .hamburger-line:nth-child(2) {
   opacity: 0;
   transform: scale(0.2);
}

.hamburger.is-open .hamburger-line:nth-child(3) {
   transform: rotate(-45deg) translate(1px, -1px);
}

/* ===== Cards & effects ===== */
.card {
   transition:
      transform 200ms ease,
      box-shadow 200ms ease,
      border-color 200ms ease,
      background-color 200ms ease;
   background: transparent;
   border-color: transparent;
   box-shadow: none;
}

.card:hover,
.card:focus-within {
   transform: translateY(-2px);
   background: rgba(16, 16, 16, 0.72);
   border-color: rgba(240, 168, 48, 0.35);
   box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

/* Perfil card: fondo oscuro siempre visible, hover solo agrega borde dorado */
#perfil .card {
   background: rgba(16, 16, 16, 0.72);
   border: 1px solid rgba(255, 255, 255, 0.06);
}
#perfil .card:hover {
   border-color: rgba(240, 168, 48, 0.35);
   box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Skills & Objectives cards have their own hover — exclude from global */
#habilidades .card,
#habilidades .card:hover,
#habilidades .card:focus-within {
   background: unset;
   border-color: unset;
   box-shadow: unset;
   transform: unset;
}
#objetivos .card,
#objetivos .card:hover,
#objetivos .card:focus-within {
   background: unset;
   border-color: unset;
   box-shadow: unset;
   /* NO unset transform — tilt JS needs it */
}

.avatar-wrap {
   flex-shrink: 0;
   transform-style: preserve-3d;
}

/* ===== Scroll indicator ===== */
.scroll-indicator {
   position: absolute;
   left: 50%;
   bottom: 2rem;
   transform: translateX(-50%);
   color: rgba(240, 168, 48, 0.5);
   opacity: 1;
   display: none;
   flex-direction: column;
   align-items: center;
   gap: 0.35rem;
   font-size: 0.85rem;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   animation: scroll-bounce 1.6s ease-in-out infinite;
   z-index: 2;
   transition: opacity 150ms ease;
}
@media (min-width: 768px) {
   .scroll-indicator {
      display: flex;
   }
}

.scroll-indicator::after {
   content: "Scroll";
   font-family: "Fira Code", monospace;
   color: rgba(240, 168, 48, 0.5);
}

/* Fuera del hero: se apaga (y se corta la animación para que no “reviva” opacity) */
:root[data-in-hero="false"] .scroll-indicator {
   opacity: 0 !important;
   pointer-events: none !important;
   visibility: hidden !important;
   animation: none !important;
}
:root:not([data-in-hero="true"]) .scroll-indicator {
   opacity: 0 !important;
   pointer-events: none !important;
   visibility: hidden !important;
   animation: none !important;
}

/* ===== Contact overlay ===== */
#contact-overlay {
   position: fixed;
   inset: 0;
   z-index: 2000;
   pointer-events: none;
   visibility: hidden;
   opacity: 0;
   transition: visibility 0s linear 300ms, opacity 200ms ease;
}

#contact-overlay.is-open {
   visibility: visible;
   opacity: 1;
   pointer-events: auto;
   transition: visibility 0s linear 0ms, opacity 200ms ease;
}

#contact-backdrop {
   position: absolute;
   inset: 0;
   background: rgba(0, 0, 0, 0.6);
   pointer-events: auto;
}

.contact-phone {
   position: absolute;
   right: 0;
   top: 0;
   bottom: 0;
   width: min(380px, 90vw);
   background: #0a192f;
   padding: 2rem;
   display: flex;
   flex-direction: column;
   gap: 1rem;
   pointer-events: auto;
   animation: phone-enter 200ms ease;
}

.contact-phone__header {
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.contact-phone__title {
   font-size: 1.4rem;
   font-weight: 600;
}

.contact-phone__close {
   background: transparent;
   border: 1px solid rgba(35, 53, 84, 0.65);
   color: rgba(230, 241, 255, 0.92);
   width: 36px;
   height: 36px;
   border-radius: 999px;
   cursor: pointer;
}

.contact-phone__desc {
   color: rgba(230, 241, 255, 0.92);
}

.contact-phone__links {
   display: flex;
   flex-direction: column;
   gap: 0.75rem;
   align-items: flex-start;
}

.contact-phone__btn-primary {
   display: inline-block;
   background-color: #64ffda;
   color: #0a0a0a;
   padding: 0.75rem 1.5rem;
   font-weight: 600;
   border-radius: 999px;
}

.contact-phone__link {
   color: #64ffda;
}

@keyframes phone-enter {
   from {
      opacity: 0;
      transform: translateY(10px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes scroll-bounce {
   0%,
   100% {
      transform: translate(-50%, 0);
      opacity: 0.9;
   }
   50% {
      transform: translate(-50%, 10px);
      opacity: 0.5;
   }
}

@media (prefers-reduced-motion: reduce) {
   .scroll-indicator,
   .contact-phone,
   .mobile-menu-panel {
      animation: none;
   }
}

@media (pointer: coarse), (hover: none) {
   .cursor-spotlight {
      display: none;
   }

   .scroll-indicator {
      display: none;
   }
}

/* ===== Side rails ===== */
.side-rail {
   position: fixed;
   bottom: var(--rails-bottom, 0px);
   width: 40px;
   z-index: 3;
   display: none;
   flex-direction: column;
   align-items: center;
   gap: 0.75rem;
   color: #a8b2d1;
   transition: opacity 200ms ease;
   will-change: bottom;
}

.side-rail::after {
   content: "";
   display: block;
   width: 1px;
   height: 120px;
   background: rgba(136, 146, 176, 0.4);
   margin-top: 0.75rem;
   transition: opacity 150ms ease;
}

.side-rail.left {
   left: 32px;
}

.side-rail.right {
   right: 32px;
}

.side-rail a {
   color: inherit;
   text-decoration: none;
   transition:
      color 150ms ease,
      transform 150ms ease;
}

.side-rail a:hover {
   color: var(--accent-gold);
   transform: translateY(-2px);
}

.side-rail .email {
   writing-mode: vertical-rl;
   font-family: "Fira Code", monospace;
   font-size: 0.85rem;
   letter-spacing: 0.08em;
}

:root[data-in-hero="true"] .side-rail {
   opacity: 0;
   pointer-events: none;
}

/* Logo esquina: visible en hero, desaparece en el mismo instante que aparecen las side rails */
:root[data-in-hero="false"] .cno-logo-wrap {
   opacity: 0;
   pointer-events: none;
}

@media (min-width: 1280px) {
   .side-rail {
      display: flex;
   }
}
/* ===== Scrollbar (solo para el contenedor real de scroll) ===== */
#page-scroll {
   /* Firefox */
   scrollbar-width: 14px;
   scrollbar-color: rgba(180, 190, 200, 0.35) rgba(10, 10, 10, 0.55);

   /* Evita saltos cuando aparece/desaparece la scrollbar (Chrome/Edge modernos) */
   scrollbar-gutter: stable;
}

/* Chrome / Edge / Safari */
#page-scroll::-webkit-scrollbar {
   width: 14px;
}

#page-scroll::-webkit-scrollbar-track {
   background: rgba(10, 10, 10, 0.55);
   border-left: 1px solid rgba(180, 190, 200, 0.08);
}

#page-scroll::-webkit-scrollbar-thumb {
   background: rgba(16, 16, 16, 0.72);
   border: 1px solid rgba(180, 190, 200, 0.22);
   border-radius: 999px;
}

#page-scroll::-webkit-scrollbar-thumb:hover {
   background: rgba(16, 16, 16, 0.86);
   border-color: rgba(180, 190, 200, 0.35);
}

#page-scroll::-webkit-scrollbar-corner {
   background: transparent;
}

/* ── Avatar wrap ── */
#cris-avatar-wrap {
   position: relative;
   z-index: 2;
}

/* ── Secciones del sitio ── */
.site-section {
   padding: 5rem clamp(1.5rem, 5vw, 5.5rem);
   scroll-margin-top: 6rem;
   box-sizing: border-box;
   position: relative;
}
