:root {
  --bg1: #fdf6ff;
  --bg2: #f6efff;
  --card: #ffffff;
  --accent: #b487ff;
  --accent-soft: #d7c3ff;
  --text-muted: #7c6b8d;

  --radius: 20px;
  --shadow: 0 10px 35px rgba(150, 120, 255, 0.15);

  font-family: "Nunito", sans-serif;
}

/* DEFAULT DARK THEME */
.dark {
  --bg1: #0d0a10;
  --bg2: #1a1520;
  
  --card: #50449f;
  
  --accent: #a05bff;
  --accent-soft: #5c3a72;

  --text-muted: #bba3c9;
}

.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
  color: #ffffff;
}



/* LIGHT THEME */
.light {
  --bg1: #fff9fe;
  --bg2: #ffeefe;

  --card: #ffffff;
  --accent: #cf91ff;
  --accent-soft: #f2d9ff;

  --text-muted: #7a6a97;
}

.light h1,
.light h2,
.light h3,
.light h4,
.light h5,
.light h6 {
  color: #000000;
}

/* Theme transitions */
body, .page, .accordion-item, .avatar, .btn {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}

.dark .text,
.dark .soft-list,
.dark .muted,
.dark .footer,
.dark .accordion-content {
  color: #e9e0f3;   /* Blanco violeta suave */
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  display: flex;
  justify-content: center;
  padding: 30px;
}

.dark .page {
  background: rgba(20, 14, 28, 0.72);  /* Oscuro, translúcido, cozy */
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 45px rgba(80, 50, 120, 0.35); /* Sombra violeta oscura */
}

.page {
  width: 100%;
  max-width: 880px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(6px);
  position: relative;
}

.fade-in {
  animation: fade .8s ease forwards;
  opacity: 0;
}

@keyframes fade {
  to { opacity: 1; }
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Tablet hacia abajo: apilar contenido y ampliar toques */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;   /* Avatar arriba, texto y controles debajo */
    align-items: stretch;
    gap: 16px;
  }

  .title-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero .controls {
    justify-content: stretch;
  }

  .hero .controls .btn {
    flex: 1 1 45%;      /* Dos por fila aprox. si cabe */
    min-width: 140px;   /* Botón cómodo */
  }
}

/* Móvil pequeño: 1 por fila si el ancho lo exige */
@media (max-width: 420px) {
  .hero .controls .btn {
    flex: 1 1 100%;
    min-width: 0;       /* Permite 1 por línea sin overflow */
  }
}

/* Avatar SIEMPRE cuadrado y fluido */
.avatar {
  width: clamp(88px, 22vw, 120px);  /* Escala con pantalla, con límites */
  aspect-ratio: 1 / 1;              /* Cuadrado perfecto */
  border-radius: var(--radius);
  overflow: hidden;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

/* La imagen rellena el cuadrado sin deformarse */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* Centrado y recorte natural, sin “aplastar” */
  object-position: center;
}

.name {
  margin: 0;
  font-size: 28px;
  display: flex;
  gap: 8px;
}

.heart {
  color: var(--accent);
}

.subtitle {
  margin-top: 6px;
  color: var(--text-muted);
}

.dark .btn {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(140, 90, 255, 0.35);
}

.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 700;
}

.btn.small {
  padding: 6px 12px;
  font-size: 14px;
}

/* Sections */
.section { margin-top: 26px; }
.text { color: var(--text-muted); line-height: 1.6; }

/* Lists */
.soft-list {
  list-style: "✦ ";
  padding-left: 22px;
  color: var(--text-muted);
}

.soft-list li { margin: 6px 0; }

.muted {
  color: var(--text-muted);
  font-size: 14px;
}

/* Accordion */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.dark .accordion-item {
  background: var(--card);
  box-shadow: 0 6px 20px rgba(60, 40, 90, 0.35);
}

.accordion-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  cursor: pointer;
  transition: transform .15s ease;
}

.accordion-item:hover { transform: translateY(-4px); }

.accordion-header {
  font-weight: 700;
  font-size: 18px;
}

.accordion-content {
  display: none;
  margin-top: 10px;
  color: var(--text-muted);
}

.accordion-item.open .accordion-content {
  display: block;
}

/* Sparkles */

.dark .sparkle-layer::before {
  opacity: 0.1;
  color: #caa6ff;
}

.sparkle-layer::before {
  content: "✦ ✧ ✦ ✧ ✦ ✧";
  position: fixed;
  top: 10%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  opacity: 0.15;
  animation: float 6s infinite ease-in-out;
  pointer-events: none;
}

.dark .fade-in {
  animation: fadeDark .8s ease forwards;
  opacity: 0;
}

@keyframes fadeDark {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes float {
  50% { transform: translateY(14px); }
}

/* Footer */
.footer {
  margin-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Contenedor de controles: permite salto de línea y espacios cómodos */
.hero .controls {
  display: flex;
  flex-wrap: wrap;       /* Permite que los botones salten de línea */
  gap: 10px;             /* Espacio constante entre botones */
  align-items: center;
}

/* Botones: tamaño flexible y táctil */
.hero .controls .btn {
  flex: 1 1 auto;              /* Se expanden para ocupar huecos disponibles */
  min-width: 120px;            /* Evita botones demasiado estrechos */
  max-width: 220px;            /* Evita botones gigantes en tablet */
  text-align: center;
  line-height: 1.2;
  padding: 10px 14px;          /* Tamaño táctil amigable */
}

@media (max-width: 768px) {
  body {
    padding: 18px;
  }
  .page {
    padding: 18px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 14px;
  }
  .page {
    padding: 14px;
  }
}

.spotlight-section {
  margin-top: 22px;
}

.spotlight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(180, 135, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(180, 135, 255, 0.18);
  box-shadow: var(--shadow);
  max-width: 100%;
}

.spotlight-text {
  min-width: 0;
}

.spotlight-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.spotlight-title {
  margin: 0;
  font-size: 22px;
}

.spotlight-desc {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 62ch;
  overflow-wrap: anywhere;
}

.spotlight-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 768px) {
  .spotlight-card {
    grid-template-columns: 1fr;
  }

  .spotlight-btn {
    width: 100%;
    white-space: normal;
  }
}

body {
  overflow-x: hidden;
}