/* ====== RESET SUAVE ====== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

/* ====== TEMAS (SUMMER / WINTER) ====== */

/* Variables por defecto */
body {
    --bg: #0f172a;
    --bg-soft: #111827;
    --bg-softer: #020617;
    --border-subtle: rgba(148, 163, 184, 0.25);
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.15);
    --accent-text: #0f172a;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.6);
}

/* Tema verano */
body[data-theme="summer"] {
    --bg: #fff7ed;
    --bg-soft: #fffbf5;
    --bg-softer: #ffffff;
    --border-subtle: rgba(251, 146, 60, 0.25);
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.12);
    --accent-text: #111827;
    --text-main: #0f172a;
    --text-muted: #6b7280;
    --shadow-soft: 0 18px 40px rgba(248, 171, 103, 0.35);
}

/* Tema invierno */
body[data-theme="winter"] {
    --bg: #020617;
    --bg-soft: #020617;
    --bg-softer: #020617;
    --border-subtle: rgba(148, 163, 184, 0.35);
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --accent-text: #0f172a;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);
}

/* ====== ESTRUCTURA GENERAL ====== */

body {
    background: radial-gradient(circle at top, var(--accent-soft), transparent 55%),
                linear-gradient(135deg, var(--bg-soft), var(--bg));
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.page {
    max-width: 1120px;
    width: 100%;
    padding: 2.5rem 1.5rem 3rem;
}

/* ====== TOPBAR ====== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent-soft);
}

.topbar-title {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Botones chip (idioma/tema) */
.chip-button {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.9rem;
    background: rgba(15, 23, 42, 0.02);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.chip-button:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-icon {
    font-size: 1rem;
}

/* ====== LAYOUT PRINCIPAL ====== */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
    gap: 2rem;
}

/* ====== HERO (COLUMNA IZQUIERDA) ====== */

.hero-name {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.hero-role {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 1.3rem;
}

.hero-text {
    font-size: 0.98rem;
    color: var(--text-muted);
    max-width: 36rem;
    margin-bottom: 1.8rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Botones generales */

.btn {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.55rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
                transform 0.12s ease, box-shadow 0.12s ease;
}

.btn.primary {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 12px 24px var(--accent-soft);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px var(--accent-soft);
}

.btn.ghost {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.btn.ghost:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.btn.small {
    padding: 0.45rem 1.05rem;
    font-size: 0.82rem;
}

.btn.disabled,
.btn.disabled:hover {
    opacity: 0.5;
    pointer-events: none;
}

/* ====== COLUMNA DERECHA ====== */

.side-column {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Tarjetas genéricas */

.card {
    background: rgba(15, 23, 42, 0.04);
    border-radius: 1.1rem;
    border: 1px solid var(--border-subtle);
    padding: 1.1rem 1.15rem 1rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

body[data-theme="summer"] .card {
    background: rgba(255, 255, 255, 0.85);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

/* ====== EDUCACIÓN ====== */

.education-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.education-item-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.education-item-detail {
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* ====== TAGS TECNOLOGÍAS ====== */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.02);
}

/* ====== TARJETAS DE PROYECTO ====== */

.project-card {
    border-radius: 0.9rem;
    border: 1px dashed var(--border-subtle);
    padding: 0.8rem 0.8rem 0.85rem;
    background: rgba(15, 23, 42, 0.02);
}

.project-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.project-text {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Meta extra en proyectos clave */
.project-meta {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.project-meta-item + .project-meta-item {
    margin-top: 0.25rem;
}

/* ====== PROYECTOS CLAVE (ancho completo) ====== */

#key-projects.key-projects-wide {
    width: 100%;
    max-width: 1120px;
    margin: 2.5rem auto 0;
}

#key-projects .project-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.2rem 1.4rem;
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.18);
}

/* Cabecera de tarjetas clave */
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.project-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    white-space: nowrap;
}

.badge-wip {
    background: rgba(255, 166, 0, 0.15);
    border: 1px solid rgba(255, 166, 0, 0.6);
    color: #ffb347;
}

.badge-priority {
    background: rgba(0, 188, 255, 0.15);
    border: 1px solid rgba(0, 188, 255, 0.7);
    color: #4fd2ff;
}

/* ====== CONTACTO ====== */

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.contact-label {
    display: inline-block;
    min-width: 72px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-list a {
    font-size: 0.86rem;
    color: var(--accent);
    text-decoration: none;
}

.contact-list a:hover {
    text-decoration: underline;
}

/* ====== HERO: IMAGEN PERFIL ====== */

.hero-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ====== RESPONSIVE ====== */

@media (max-width: 820px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side-column {
        order: -1;
    }

    .page {
        padding-top: 1.8rem;
    }

    .topbar {
        margin-bottom: 1.6rem;
    }
}

@media (max-width: 520px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .topbar-right {
        align-self: stretch;
        justify-content: space-between;
        width: 100%;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ===========================
   CHAT WIDGET – COLORES NEUTROS (TEMPORAL)
   - Mismos valores en summer y winter para evitar cambios incorrectos
   =========================== */

body[data-theme="summer"],
body[data-theme="winter"] {
  --chat-primary: #64748b;                /* burbuja / accent neutro */
  --chat-secondary: rgba(255,255,255,0.10);
  --chat-bg: rgba(15, 23, 42, 0.94);      /* ventana conversación */
  --chat-text: rgba(255,255,255,0.92);
  --chat-border: rgba(255,255,255,0.14);
}

/* Si el widget respeta variables de marca */
:root {
  --brand-primary: var(--chat-primary);
  --brand-secondary: var(--chat-secondary);
}

/* Integración visual */
.chat-widget-button,
.chatWidget__button {
  box-shadow: var(--shadow-soft) !important;
  border-radius: 999px !important;
}

.chat-widget-window,
.chatWidget__window {
  border-radius: 16px !important;
  box-shadow: var(--shadow-soft) !important;
  font-family: inherit !important;
}

/* Fijar burbuja abajo derecha (iframe o contenedor) */
iframe[src*="nocodeveloper"],
iframe[src*="chat.js"] {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 999999 !important;
  border: 0 !important;
}

#chat-widget,
#chatWidget,
.chat-widget,
.chatWidget,
.chat-widget-container,
.chatWidget__container {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 999999 !important;
}

/* Evita líneas/outlines extraños por resets */
#chat-widget::before,
#chat-widget::after,
.chat-widget::before,
.chat-widget::after,
.chatWidget::before,
.chatWidget::after {
  content: none !important;
}

#chat-widget,
.chat-widget,
.chatWidget {
  outline: none !important;
  box-shadow: none !important;
}

/* avatar circular si usa tu imagen */
img[src$="img/perfil.png"],
img[src*="img/perfil.png"] {
  border-radius: 999px !important;
  object-fit: cover !important;

  /* Badge: En producción */
.badge-live {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.65);
    color: #4ade80;
}

}
