:root {
    --bg-color: #0B0D10;
    --bg-soft: #12151B;
    --card-bg: #14181E;
    --primary: #87CEEB; /* Azul cielo */
    --primary-hover: #A8DCF5;
    --secondary: #5A9BC0;
    --beige: #EDE3D0; /* Beige */
    --beige-dim: #C9BFA9;
    --text: #EDE3D0;
    --muted: #A9A294;
    --glass: rgba(237, 227, 208, 0.045);
    --glass-border: rgba(135, 206, 235, 0.22);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-sky: 0 8px 24px rgba(135, 206, 235, 0.15);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(900px 500px at 85% -5%, rgba(135, 206, 235, 0.10), transparent 60%),
        radial-gradient(700px 500px at 0% 20%, rgba(237, 227, 208, 0.05), transparent 60%);
    color: var(--text);
    font-family: 'Fira Code', monospace;
    overflow-x: hidden;
    line-height: 1.65;
}

#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.22;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(11,13,16,0.2), rgba(11,13,16,0.85));
    z-index: -1;
    pointer-events: none;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 50px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 16, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    opacity: 1;
    pointer-events: auto;
}

.header-visible,
header.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Contenido del header siempre visible, aparición suave */
header .logo,
header .nav-link,
header .hamburger {
    opacity: 1;
    transform: none;
    transition: color 0.25s ease;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--beige);
    display: flex;
    align-items: center;
    gap: 10px;
}
a.logo-link {
    text-decoration: none;
    color: inherit;
}

.nav-link {
    color: var(--beige-dim);
    text-decoration: none;
    margin-left: 28px;
    transition: color 0.25s ease;
    position: relative;
    font-size: 0.95rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

main {
    padding: 110px 20px 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    min-height: 88vh;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 40px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 2;
    max-width: 640px;
}

/* --- Emoji hero (sustituye al PNG) --- */
.hero-image-container {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 420px;
    height: 420px;
    max-width: 38vw;
    z-index: 1;
    opacity: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    border: none;
}

.hero-rook {
    font-size: min(300px, 26vw);
    line-height: 1;
    color: var(--primary);
    text-shadow: 0 10px 40px rgba(135, 206, 235, 0.25);
    user-select: none;
}

.hero-image-container::before,
.hero-image-container::after {
    display: none;
}

/* Clase compatibilidad: mostrar la imagen */
.hero-image-container.visible {
    opacity: 1;
    transform: none;
}

/* Ocultar imagen en móvil y ajustar layout */
@media (max-width: 1100px) {
    .hero {
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .hero-image-container {
        display: none;
    }
}

.glitch {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--beige);
    position: relative;
    font-family: 'Orbitron', sans-serif;
    opacity: 1;
    letter-spacing: 1px;
}

/* Sin efecto glitch: ocultamos las capas duplicadas */
.glitch::before,
.glitch::after {
    display: none;
}

.glitch.visible {
    opacity: 1;
}

.typewriter {
    font-size: 1.25rem;
    margin: 18px 0 6px 0;
    color: var(--primary);
    min-height: 2rem;
    font-weight: 400;
}

.cursor {
    animation: blink 1.1s ease-in-out infinite;
    color: var(--primary);
    font-weight: 300;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.btn-neon {
    padding: 13px 30px;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: #0B0D10;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sky);
    margin-top: 24px;
    display: inline-block;
    cursor: pointer;
}

.btn-neon:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(135, 206, 235, 0.25);
    color: #0B0D10;
}

.btn-neon:active {
    transform: translateY(0);
}

.btn-neon:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.section {
    margin-bottom: 110px;
    scroll-margin-top: 100px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 1.7rem;
    margin-bottom: 28px;
    display: inline-block;
    padding-bottom: 8px;
    color: var(--beige);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: var(--shadow-soft);
}

.card:hover {
    border-color: rgba(135, 206, 235, 0.5);
    box-shadow: var(--shadow-soft), var(--shadow-sky);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.skill-item {
    padding: 8px 16px;
    border: 1px solid rgba(135, 206, 235, 0.35);
    background: rgba(135, 206, 235, 0.08);
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--beige);
    transition: background 0.2s ease;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.project-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.project-card p {
    color: var(--beige-dim);
    font-size: 0.96rem;
}

.tags span {
    font-size: 0.8rem;
    margin-right: 10px;
    color: var(--muted);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    position: relative;
    margin-bottom: 28px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3A4149;
    color: var(--beige);
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.25s ease;
    resize: vertical;
}

.input-group textarea {
    min-height: 110px;
}

.input-group label {
    position: absolute;
    top: 12px;
    left: 0;
    color: var(--muted);
    pointer-events: none;
    transition: 0.25s ease;
}

.input-group input:focus~label,
.input-group input:valid~label,
.input-group textarea:focus~label,
.input-group textarea:valid~label {
    top: -18px;
    color: var(--primary);
    font-size: 0.8rem;
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom: 1px solid var(--primary);
}

/* --- System Footer --- */
.system-footer {
    border-top: 1px solid var(--glass-border);
    background: #0E1116;
    padding: 14px 20px;
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.system-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.led-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(135, 206, 235, 0.8);
    animation: led-blink 2.5s ease-in-out infinite;
}

@keyframes led-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-separator {
    color: #333;
}

.copyright p {
    margin: 0;
    opacity: 0.8;
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--card-bg);
    border: 1px solid rgba(135, 206, 235, 0.4);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    color: #0B0D10;
}

.about-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.about-img-wrapper {
    flex-shrink: 0;
}

.about-text h3 {
    color: var(--primary) !important;
    font-size: 1.05rem;
}

.profile-img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid rgba(135, 206, 235, 0.4);
    box-shadow: var(--shadow-soft);
    filter: saturate(0.9);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.profile-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-soft), var(--shadow-sky);
}

@media (max-width: 850px) {
    .about-container {
        flex-direction: column;
        text-align: left;
        align-items: center;
    }

    .skills-grid {
        justify-content: flex-start;
    }
}

.tech-list {
    list-style: none;
    margin-left: 5px;
}

.tech-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 22px;
    color: var(--beige-dim);
}

.tech-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.map-container {
    padding: 12px;
}

.map-container iframe {
    width: 100%;
    border-radius: 10px;
    border: 0;
    filter: saturate(0.85);
}

/* --- Menú Hamburguesa y Sidebar --- */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--beige);
    transition: 0.3s ease;
}

@media (max-width: 768px) {
    header {
        padding: 14px 20px;
    }

    .hamburger {
        display: flex;
    }

    /* Clase que añadiremos con JS al contenedor de links */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: rgba(14, 17, 22, 0.97);
        backdrop-filter: blur(12px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        border-left: 1px solid var(--glass-border);
        display: flex;
        z-index: 1000;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        margin: 16px 0;
        font-size: 1.05rem;
        margin-left: 0;
    }

    .nav-link::after {
        display: none;
    }

    /* Animación del icono hamburguesa a X */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* Código volador desactivado (se eliminó la intro) */
.flying-code {
    display: none;
}

/* --- Software Grid --- */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.software-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.software-card:hover {
    border-color: rgba(135, 206, 235, 0.55);
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft), var(--shadow-sky);
    background: #171C23;
}

.software-icon {
    width: 50px;
    height: 50px;
    fill: var(--text);
    transition: 0.25s ease;
}

.software-icon-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    transition: transform 0.22s ease;
}

.software-card:hover .software-icon-img {
    transform: scale(1.06);
}

.software-name {
    color: var(--beige-dim);
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s ease;
    margin: 0 15px;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--beige);
}

.software-card:hover .software-name {
    color: var(--primary);
}

/* --- Torre logo (sin glitch) --- */
.rook {
    position: relative;
    font-size: 1.6rem;
    color: var(--primary);
    display: inline-block;
}

.rook::before,
.rook::after {
    display: none;
}

/* --- Timeline suave --- */
.timeline-container {
    padding: 20px 0;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline {
    list-style: none;
    padding: 0;
    position: relative;
}

/* Línea central */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, rgba(135,206,235,0.1), var(--primary), rgba(135,206,235,0.1));
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    margin-bottom: 36px;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 40px;
}

.timeline-content {
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Flecha de conexión */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 24px;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--glass-border);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--glass-border) transparent transparent;
}

/* Puntos centrales */
.timeline-dot {
    position: absolute;
    top: 22px;
    right: -9px;
    width: 18px;
    height: 18px;
    background: var(--bg-color);
    border: 2px solid var(--primary);
    border-radius: 50%;
    z-index: 2;
    transition: background 0.25s ease, transform 0.25s ease;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -9px;
}

.timeline-item:hover .timeline-dot {
    background: var(--primary);
    transform: scale(1.1);
}

.timeline-date {
    position: absolute;
    top: -26px;
    color: var(--primary);
    font-weight: 400;
    font-family: 'Fira Code', monospace;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.timeline-item:nth-child(odd) .timeline-date {
    right: 40px;
}

.timeline-item:nth-child(even) .timeline-date {
    left: 40px;
}

/* Responsive para Timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--glass-border) transparent transparent;
    }

    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 12px;
        right: auto;
    }

    .timeline-date {
        top: -22px;
        left: 50px !important;
        right: auto !important;
        font-size: 0.85em;
    }
}

/* =========================================
   ESTILOS ESPECÍFICOS DEL CURRICULUM
   ========================================= */

.cv-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 900px) {
    .cv-layout {
        grid-template-columns: 300px 1fr;
    }
}

.cv-sidebar .card {
    margin-bottom: 20px;
    background: var(--card-bg);
}

.cv-photo {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto 15px auto;
    border-radius: 12px;
    border: 1px solid rgba(135, 206, 235, 0.4);
}

.cv-section {
    margin-bottom: 28px;
}

ul.cv-list {
    list-style: none;
    padding-left: 0;
}

ul.cv-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    color: var(--beige-dim);
}

ul.cv-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Ajuste para que el header fijo no tape el contenido al navegar en CV */
.cv-page .card[id] {
    scroll-margin-top: 120px;
}

/* --- NAVEGACIÓN EXCLUSIVA PARA CV (.cv-page) --- */

.cv-page header .hamburger {
    display: flex !important;
}

.cv-page nav {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: rgba(14, 17, 22, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    border-left: 1px solid var(--glass-border);
    display: flex !important;
    z-index: 1000;
}

.cv-page nav.active {
    right: 0;
}

.cv-page nav .nav-link {
    margin: 16px 0;
    font-size: 1.05rem;
    margin-left: 0;
}

.cv-page .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.cv-page .hamburger.active span:nth-child(2) {
    opacity: 0;
}

.cv-page .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* =========================================
   RESPONSIVE TOTAL - todos los móviles
   ========================================= */

/* Grids que no rompen en pantallas estrechas */
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.software-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 44vw), 1fr));
}

img, iframe {
    max-width: 100%;
}

/* Tablets */
@media (max-width: 900px) {
    main {
        padding: 100px 16px 30px 16px;
    }
    .section {
        margin-bottom: 80px;
    }
    .hero {
        min-height: auto;
        padding: 40px 0 20px 0;
    }
}

@media (max-width: 768px) {
    .nav-menu,
    .cv-page nav {
        width: min(260px, 82vw);
        overflow-y: auto;
        padding: 70px 20px 30px 20px;
    }
}

/* Móviles */
@media (max-width: 600px) {
    .logo {
        font-size: 1.05rem;
    }

    .hero-text {
        max-width: 100%;
        width: 100%;
    }

    .glitch {
        font-size: clamp(1.7rem, 9vw, 2.4rem);
        word-break: break-word;
    }

    .typewriter {
        font-size: 1.02rem;
        width: 100%;
    }

    .btn-neon {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }

    .card {
        padding: 20px 18px;
    }

    .section-title {
        font-size: 1.3rem;
        width: 100%;
    }

    .about-container {
        gap: 24px;
    }

    .profile-img {
        width: min(220px, 62vw);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .software-card {
        padding: 16px 10px;
    }

    .software-icon-img {
        width: 48px;
        height: 48px;
    }

    .map-container iframe {
        height: 320px;
    }

    .system-status {
        font-size: 0.68rem;
        gap: 10px;
    }

    .back-to-top {
        bottom: 18px;
        right: 18px;
        width: 46px;
        height: 46px;
    }

    /* Email largo del formulario que no desborde */
    .contact-form p {
        word-break: break-word;
        font-size: 0.92rem;
    }

    .input-group input,
    .input-group textarea {
        font-size: 16px; /* evita zoom automático en iOS */
    }
}

/* Móviles muy pequeños */
@media (max-width: 380px) {
    main {
        padding: 92px 12px 24px 12px;
    }

    .card {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .skills-grid {
        gap: 8px;
    }

    .skill-item {
        font-size: 0.8rem;
        padding: 7px 12px;
    }

    .software-grid {
        gap: 12px;
    }

    .timeline-content {
        padding: 20px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .section {
        transition: none;
        opacity: 1;
        transform: none;
    }
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============ MODO CLARO (colores invertidos) ============ */
html.light {
    --bg-color: #FBF9F3;
    --bg-soft: #F1ECE0;
    --card-bg: #FFFFFF;
    --primary: #A5853F;
    --primary-hover: #C0A45C;
    --secondary: #8A713D;
    --beige: #174A68;
    --beige-dim: #4A7A99;
    --text: #174A68;
    --muted: #68798A;
    --glass: rgba(23, 74, 104, 0.05);
    --glass-border: rgba(165, 133, 63, 0.38);
    --shadow-soft: 0 10px 30px rgba(60, 50, 20, 0.16);
    --shadow-sky: 0 8px 24px rgba(165, 133, 63, 0.22);
}
html.light body {
    background-image:
        radial-gradient(900px 500px at 85% -5%, rgba(165, 133, 63, 0.12), transparent 60%),
        radial-gradient(700px 500px at 0% 20%, rgba(23, 74, 104, 0.06), transparent 60%);
}
html.light .overlay {
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(235,232,220,0.85));
}
html.light #matrix {
    opacity: 0.16;
    filter: invert(1);
}
html.light .input-group input,
html.light .input-group textarea {
    border-bottom-color: #C9C2B0;
}
html.light .btn-neon:hover {
    box-shadow: 0 12px 28px rgba(165, 133, 63, 0.30);
}
html.light header {
    background: rgba(251, 249, 243, 0.88);
}
html.light .hero-rook {
    text-shadow:
        0 0 12px rgba(165, 133, 63, 0.6),
        0 0 38px rgba(165, 133, 63, 0.38),
        0 10px 60px rgba(165, 133, 63, 0.3);
}
.theme-toggle {
    margin-left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 auto;
}
.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sky);
}
