/* =============================================
   VARIABLES
============================================= */
:root {
  --bg: #111111;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --text-sub: rgba(255,255,255,0.4);
  --row-bg: rgba(255,255,255,0.065);
  --row-hover: rgba(255,255,255,0.1);
  --pill-bg: rgba(255,255,255,0.07);
  --pill-border: rgba(255,255,255,0.13);
  --pill-color: rgba(255,255,255,0.75);
  --pill-active-bg: #ffffff;
  --pill-active-color: #111111;
  --tabs-bg: rgba(255,255,255,0.07);
  --tab-active-bg: rgba(255,255,255,0.1);
  --tab-color: rgba(255,255,255,0.4);
  --tab-active-color: #ffffff;
  --divider: rgba(255,255,255,0.08);
  --toggle-track: #3a3a3a;
  --featured-bg: rgba(255,255,255,0.92);
  --featured-color: #111111;
  --featured-sub: rgba(0,0,0,0.5);
  --center-bg: rgba(17, 17, 17, 0.72);
}

[data-theme="light"] {
  --bg: #f5f5f3;
  --text: #111111;
  --text-muted: rgba(0,0,0,0.45);
  --text-sub: rgba(0,0,0,0.4);
  --row-bg: rgba(0,0,0,0.05);
  --row-hover: rgba(0,0,0,0.09);
  --pill-bg: rgba(0,0,0,0.06);
  --pill-border: rgba(0,0,0,0.12);
  --pill-color: rgba(0,0,0,0.65);
  --pill-active-bg: #111111;
  --pill-active-color: #ffffff;
  --tabs-bg: rgba(0,0,0,0.07);
  --tab-active-bg: rgba(0,0,0,0.08);
  --tab-color: rgba(0,0,0,0.35);
  --tab-active-color: #111111;
  --divider: rgba(0,0,0,0.08);
  --toggle-track: #cccccc;
  --featured-bg: rgba(0,0,0,0.85);
  --featured-color: #ffffff;
  --featured-sub: rgba(255,255,255,0.5);
  --center-bg: rgba(245, 245, 243, 0.92);
}

/* =============================================
   BASE
============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; }

body {
  font-family: 'DM Sans', -apple-system, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  transition: background 0.4s ease, color 0.4s ease;
}

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font-family: inherit; color: inherit; }

/* =============================================
   CANVAS LAYERS
============================================= */
#canvas-text, #canvas-mask, #canvas-snake {
  position: fixed;
  inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
#canvas-text  { z-index: 0; }
#canvas-mask  { z-index: 1; }
#canvas-snake { z-index: 2; }

/* =============================================
   TOGGLE
============================================= */
.theme-toggle {
  position: fixed; top: 18px; right: 22px;
  z-index: 200; padding: 4px;
}
.toggle-track {
  width: 46px; height: 26px;
  background: var(--toggle-track);
  border-radius: 999px; padding: 3px;
  display: flex; align-items: center;
  transition: background 0.3s; cursor: pointer;
}
.toggle-thumb {
  width: 20px; height: 20px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transform: translateX(0);
}
[data-theme="light"] .toggle-thumb { transform: translateX(20px); }

/* =============================================
   CONTENEDOR CENTRAL
   — backdrop sólido para tapar el texto de fondo
============================================= */
.center {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 60px 22px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Fondo translúcido con glassmorphism para ver la víbora y la comida con opacidad al pasar por detrás */
  background: var(--center-bg);
  border-radius: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  /* Sombra difuminada para blend suave con el fondo */
  box-shadow:
    0 0 0 40px var(--center-bg),
    0 0 80px 80px var(--center-bg);
}

/* =============================================
   LOGO
============================================= */
.logo-wrap { margin-bottom: 22px; }
.logo-box {
  width: 86px; height: 86px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: logoIn 0.6s cubic-bezier(0.34,1.3,0.64,1) both;
  overflow: hidden;
  background: #000;
}
[data-theme="light"] .logo-box { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* =============================================
   NOMBRE shimmer
============================================= */
.name {
  font-family: 'DM Serif Display', serif;
  font-size: 2.3rem; font-weight: 400;
  letter-spacing: -0.02em; text-align: center; margin-bottom: 10px;
  background: linear-gradient(90deg,
    var(--text) 0%, var(--text) 40%,
    rgba(255,255,255,0.85) 50%,
    var(--text) 60%, var(--text) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameReveal 0.7s ease 0.1s both, nameShimmer 3.5s ease 0.8s 1 forwards;
}
[data-theme="light"] .name {
  background: linear-gradient(90deg,
    #111 0%, #111 40%,
    rgba(80,80,80,0.6) 50%,
    #111 60%, #111 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameReveal 0.7s ease 0.1s both, nameShimmer 3.5s ease 0.8s 1 forwards;
}
@keyframes nameReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes nameShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* =============================================
   TAGLINE
============================================= */
.tagline {
  font-size: 1rem; font-weight: 300; color: var(--text-muted);
  margin-bottom: 26px; text-align: center;
  display: flex; align-items: center; gap: 4px;
  animation: fadeUp 0.5s ease 0.3s both;
}
.typer {
  color: var(--text); font-style: italic;
  font-family: 'DM Serif Display', serif; font-size: 1.1rem;
  border-right: 2px solid var(--text); padding-right: 2px;
  animation: blink 0.8s step-end infinite;
  min-width: 50px; display: inline-block;
}
@keyframes blink { 50% { border-color: transparent; } }

/* =============================================
   PILLS
============================================= */
.pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 28px;
  animation: fadeUp 0.5s ease 0.4s both;
}
.pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg); color: var(--pill-color);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.pill:hover { background: var(--row-hover); }
.pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: var(--pill-active-bg);
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.d-devops  { background: #2496ed; }
.d-backend { background: #68bc71; }
.d-flu     { background: #54c5f8; }
.d-cloud   { background: #ff9900; }

/* =============================================
   DIVISOR
============================================= */
.divider {
  width: 100%; height: 1px; background: var(--divider);
  animation: fadeUp 0.5s ease 0.45s both;
}

/* =============================================
   NAV & SUBMENÚ FLOTANTE (Overlay sin saltos)
============================================= */
.nav-wrapper {
  position: relative;
  width: 100%;
  margin-top: 16px;
  animation: fadeUp 0.5s ease 0.5s both;
}

.tabs-bar {
  display: flex; width: 100%;
  background: var(--tabs-bg); border-radius: 16px;
  padding: 5px;
  position: relative; z-index: 20;
}
.tab-group { flex: 1; position: relative; }
.tab {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; border-radius: 12px;
  font-size: 0.8rem; font-weight: 500; color: var(--tab-color);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab:hover, .tab.active {
  color: var(--tab-active-color);
  background: var(--tab-active-bg);
}
.badge {
  background: #ff3b30; color: #fff;
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 5px; border-radius: 999px; line-height: 1.3;
}
.badge-soon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
}
[data-theme="light"] .badge-soon {
  background: rgba(0, 0, 0, 0.08);
}

/* Submenú flotante overlay — no altera el tamaño de .center */
.panels {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--center-bg);
  border: 1px solid var(--pill-border);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;

  /* Oculto por defecto */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
}

[data-theme="light"] .panels {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.panels.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.panel {
  display: none;
  flex-direction: column;
  gap: 6px;
}
.panel.active {
  display: flex;
  animation: panelFade 0.22s ease both;
}

@keyframes panelFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* =============================================
   ROWS
============================================= */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--row-bg); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  width: 100%; text-align: left;
}
.row:hover { background: var(--row-hover); transform: translateX(3px); }
.row-featured {
  background: var(--featured-bg) !important;
  color: var(--featured-color) !important;
}
.row-featured .row-sub { color: var(--featured-sub) !important; }
.row-coming-soon {
  opacity: 0.55;
  cursor: default;
}
.row-coming-soon:hover {
  background: var(--row-bg) !important;
  transform: none !important;
}
.row-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-name { font-size: 0.88rem; font-weight: 600; }
.row-sub  { font-size: 0.76rem; color: var(--text-sub); }
.chev     { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }

/* =============================================
   ICONOS
============================================= */
.app-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.gh-icon  { background: #1a1a1a; }
.ps-icon  { background: #01875f; }

.soc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.soc-icon svg { width: 20px; height: 20px; }
.s-gh { background: #1a1a1a; }
.s-yt { background: #ff0000; }
.s-x  { background: #000000; }
.s-fb { background: #1877f2; }
.s-ig { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.s-ps { background: #01875f; }
.s-em { background: #4f46e5; }

.stack-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0; background: var(--row-hover);
}

/* =============================================
   TOAST
============================================= */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #fff; color: #111;
  padding: 10px 24px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap; z-index: 300;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================
   UTILS & RESPONSIVE
============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@media (max-width: 480px) {
  .center   { padding: 40px 16px 32px; border-radius: 0; box-shadow: none; }
  .name     { font-size: 1.85rem; }
  .tab      { font-size: 0.72rem; padding: 9px 4px; }
  .logo-box { width: 76px; height: 76px; border-radius: 18px; }
}
