/* ============================================================
   DANIEL BRANSPIGUEL — BrandBook CSS
   Azul Tinta #2B3059 | Petróleo #1E5D59 | Cobre #C25F20
   Oro #BE9B58 | Carbón #212120 | Vino #7A1E2D | Marfil #F0EFED
   H1/H2: Playfair Display | Body: Inter | Cita: Roboto Condensed
   ============================================================ */

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== CSS VARIABLES ===== */
:root {
    --azul-tinta: #2B3059;
    --petroleo:   #1E5D59;
    --cobre:      #C25F20;
    --oro:        #BE9B58;
    --carbon:     #212120;
    --vino:       #7A1E2D;
    --marfil:     #F0EFED;
    --white:      #ffffff;

    --text-on-light:    #212120;
    --text-mid-light:   #4a4a48;
    --text-soft-light:  #6b6b68;

    --shadow-sm:  0 2px 8px  rgba(33, 33, 32, 0.08);
    --shadow-md:  0 8px 24px rgba(33, 33, 32, 0.12);
    --shadow-lg:  0 20px 40px rgba(33, 33, 32, 0.18);
    --shadow-xl:  0 32px 64px rgba(33, 33, 32, 0.24);

    --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--carbon);
    background: var(--marfil);
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--cobre) 0%, var(--oro) 100%);
    z-index: 9999;
    transition: width 0.08s linear;
    transform-origin: left;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), padding 0.4s;
}

/* Over light hero: no background, dark text */
.header:not(.scrolled) .nav-menu a {
    color: rgba(43, 48, 89, 0.72);
}

.header:not(.scrolled) .nav-menu a:hover {
    color: var(--cobre);
}

.header:not(.scrolled) .nav-menu a::after {
    background: var(--cobre);
}

/* Scrolled: dark navy bar, light text */
.header.scrolled {
    background: rgba(43, 48, 89, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(190, 155, 88, 0.18);
}

.header.scrolled .nav-menu a {
    color: rgba(240, 239, 237, 0.75);
}

.header.scrolled .nav-menu a:hover {
    color: var(--oro);
}

.header.scrolled .nav-menu a::after {
    background: var(--oro);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--marfil);
    box-shadow: 0 0 0 2px rgba(194, 95, 32, 0.3);
    transition: box-shadow 0.4s var(--ease-out), transform 0.3s var(--ease-out);
}

.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--azul-tinta);
    letter-spacing: 0.01em;
    transition: color 0.4s var(--ease-out);
}

.logo:hover .logo-img {
    box-shadow: 0 0 0 2px var(--cobre);
    transform: scale(1.06);
}

/* Scrolled: nav fondo navy → texto e imagen en claro */
.header.scrolled .logo-img {
    box-shadow: 0 0 0 2px rgba(190, 155, 88, 0.3);
}

.header.scrolled .logo-text {
    color: var(--marfil);
}

.header.scrolled .logo:hover .logo-img {
    box-shadow: 0 0 0 2px var(--oro);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.8rem;
}

.nav-menu a {
    text-decoration: none;
    color: rgba(43, 48, 89, 0.72);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--cobre);
    transition: width 0.35s var(--ease-out);
}

.nav-menu a:hover {
    color: var(--cobre);
}

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

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--marfil);
    overflow: hidden;
    padding: 9rem 0 7rem;
}

/* Ambient glow decorations */
.hero::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -8%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(194, 95, 32, 0.06) 0%, transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -25%;
    left: -5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(43, 48, 89, 0.05) 0%, transparent 65%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.2fr 0.85fr;
    gap: 5rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.2rem 0.5rem 1rem;
    border: 1px solid rgba(194, 95, 32, 0.4);
    color: var(--cobre);
    border-radius: 2px;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeSlideUp 0.9s var(--ease-out) 0.2s forwards;
}

.hero-badge::before {
    content: '';
    display: block;
    width: 18px;
    height: 1px;
    background: var(--cobre);
    flex-shrink: 0;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1.18;
    color: var(--azul-tinta);
    margin-bottom: 1.8rem;
    letter-spacing: -0.01em;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 0.45s forwards;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(43, 48, 89, 0.6);
    margin-bottom: 3rem;
    line-height: 1.85;
    max-width: 480px;
    font-weight: 300;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 0.65s forwards;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeSlideUp 1s var(--ease-out) 0.85s forwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 2.2rem;
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.32s var(--ease-out);
    border: 1px solid transparent;
}

.cta-primary {
    background: var(--cobre);
    color: var(--marfil);
    border-color: var(--cobre);
    box-shadow: 0 4px 20px rgba(194, 95, 32, 0.32);
}

.cta-primary:hover {
    background: #d4691f;
    border-color: #d4691f;
    box-shadow: 0 8px 28px rgba(194, 95, 32, 0.46);
    transform: translateY(-2px);
}

.cta-secondary {
    background: transparent;
    color: var(--azul-tinta);
    border-color: rgba(43, 48, 89, 0.3);
}

.cta-secondary:hover {
    border-color: var(--azul-tinta);
    background: rgba(43, 48, 89, 0.06);
    transform: translateY(-2px);
}

/* Hero Image */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeSlideUp 1.1s var(--ease-out) 0.5s forwards;
}

.image-floating {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    max-width: 420px;
    width: 100%;
    aspect-ratio: 1 / 1;
    box-shadow:
        0 0 0 1px rgba(194, 95, 32, 0.3),
        0 0 0 10px var(--marfil),
        0 0 0 12px rgba(194, 95, 32, 0.2),
        var(--shadow-xl);
}

.image-floating img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 62% 35%;
    transition: transform 0.9s var(--ease-out);
}

.image-floating:hover img {
    transform: scale(1.04);
}

/* Scroll indicator */
.hero-decoration {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(194, 95, 32, 0.5), transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scaleY(1); }
    50% { opacity: 1; transform: translateX(-50%) scaleY(0.6) translateY(8px); }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scroll-reveal system */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-36px);
    transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(36px);
    transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger helpers */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }
.delay-7 { transition-delay: 0.7s !important; }

/* ===== SECTION SHARED ===== */
section {
    padding: 7rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4.5rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    padding: 0;
    animation: none;
}

.section-badge::before,
.section-badge::after {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
}

/* About (ahora oscuro) badge */
.about .section-badge {
    color: var(--oro);
}
.about .section-badge::before,
.about .section-badge::after {
    background: var(--oro);
}

/* Contact badge */
.contact .section-badge {
    color: var(--oro);
}
.contact .section-badge::before,
.contact .section-badge::after {
    background: var(--oro);
}

/* Books (ahora claro) badge */
.books .section-badge {
    color: var(--cobre);
}
.books .section-badge::before,
.books .section-badge::after {
    background: var(--cobre);
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    /* Remove auto-animation: handled by IntersectionObserver */
    opacity: 1;
    transform: none;
    animation: none;
}

.section-subtitle {
    font-size: 1.1rem;
    line-height: 1.75;
    margin-top: 1rem;
    font-weight: 300;
}

/* ===== SOBRE MÍ ===== */
.about {
    background: var(--carbon);
}

.about .section-title {
    color: var(--marfil);
}

.about-content {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 6rem;
    align-items: start;
    opacity: 1; /* Reset old default */
    transform: none;
    transition: none;
}

.about-image {
    position: sticky;
    top: 120px;
}

.image-mask {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    box-shadow:
        0 0 0 1px rgba(194, 95, 32, 0.25),
        0 0 0 10px var(--carbon),
        0 0 0 12px rgba(194, 95, 32, 0.18),
        var(--shadow-lg);
}

.image-mask img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 55%;
    transition: transform 0.9s var(--ease-out);
}

.image-mask:hover img {
    transform: scale(1.04);
}

.about-intro {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--marfil);
    margin-bottom: 2rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    padding-left: 1.4rem;
    border-left: 3px solid var(--cobre);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: rgba(240, 239, 237, 0.6);
    font-size: 1.04rem;
    line-height: 1.88;
    font-weight: 300;
}

.about-text p:first-of-type {
    font-size: 1.08rem;
    color: rgba(240, 239, 237, 0.85);
    font-weight: 400;
}

/* ===== LIBROS ===== */
.books {
    background: var(--marfil);
}

.books .section-title {
    color: var(--carbon);
}

.books .section-subtitle {
    color: var(--text-soft-light);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
}

.book-card {
    background: var(--white);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.65s var(--ease-out),
        transform 0.65s var(--ease-out),
        box-shadow 0.4s var(--ease-out);
}

.book-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.book-card.visible:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Staggered card entrance */
.book-card:nth-child(1) { transition-delay: 0.05s; }
.book-card:nth-child(2) { transition-delay: 0.12s; }
.book-card:nth-child(3) { transition-delay: 0.19s; }
.book-card:nth-child(4) { transition-delay: 0.26s; }
.book-card:nth-child(5) { transition-delay: 0.33s; }
.book-card:nth-child(6) { transition-delay: 0.40s; }
.book-card:nth-child(7) { transition-delay: 0.47s; }

.book-cover {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: #1a1a19;
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s var(--ease-out);
}

.book-card:hover .book-image {
    transform: scale(1.06);
}

.book-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(33, 33, 32, 0.88) 0%,
        rgba(33, 33, 32, 0.35) 55%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-action {
    color: var(--marfil);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.65rem 1.5rem;
    border: 1px solid rgba(240, 239, 237, 0.45);
    border-radius: 2px;
    background: rgba(194, 95, 32, 0.75);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.book-card:hover .book-action {
    background: var(--cobre);
    border-color: var(--cobre);
}

.book-info {
    padding: 1.4rem 1.6rem 1.8rem;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.book-genre {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cobre);
    margin-bottom: 0.65rem;
}

.book-info h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--carbon);
    line-height: 1.3;
    margin-bottom: auto;
    min-height: 3.1rem;
}

.book-buy-btn {
    display: inline-block;
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.78rem 1.5rem;
    background: transparent;
    color: var(--cobre);
    text-decoration: none;
    border: 1px solid var(--cobre);
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s var(--ease-out);
}

.book-buy-btn:hover {
    background: var(--cobre);
    color: var(--marfil);
    box-shadow: 0 4px 16px rgba(194, 95, 32, 0.32);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(33, 33, 32, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--marfil);
    border-radius: 3px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.45s var(--ease-spring);
    position: relative;
    /* Remove individual color overrides */
    background: var(--marfil) !important;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 2.5rem 3rem 2rem;
    border-bottom: 1px solid rgba(190, 155, 88, 0.18);
    background: var(--azul-tinta);
}

.modal-genre {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--oro);
    margin-bottom: 0.8rem;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
}

.modal-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--marfil);
    line-height: 1.25;
}

.modal-body {
    padding: 2.5rem 3rem 3rem;
    background: var(--marfil);
}

.modal-body p {
    color: var(--text-mid-light);
    line-height: 1.88;
    margin-bottom: 1.4rem;
    font-size: 1.02rem;
    font-weight: 300;
}

.close {
    position: absolute;
    top: 1.6rem;
    right: 1.8rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 300;
    color: rgba(240, 239, 237, 0.65);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    background: rgba(240, 239, 237, 0.08);
    line-height: 1;
}

.close:hover {
    color: var(--marfil);
    background: rgba(240, 239, 237, 0.18);
    transform: rotate(90deg);
}

/* Override individual modal color rules */
#modal1 .close,
#modal2 .close,
#modal3 .close,
#modal4 .close,
#modal5 .close,
#modal6 .close,
#modal7 .close {
    color: rgba(240, 239, 237, 0.65);
    background: rgba(240, 239, 237, 0.08);
}

#modal1 .close:hover,
#modal2 .close:hover,
#modal3 .close:hover,
#modal4 .close:hover,
#modal5 .close:hover,
#modal6 .close:hover,
#modal7 .close:hover {
    color: var(--marfil);
    background: rgba(240, 239, 237, 0.18);
}

#modal1 .modal-genre,
#modal2 .modal-genre,
#modal3 .modal-genre,
#modal4 .modal-genre,
#modal5 .modal-genre,
#modal6 .modal-genre,
#modal7 .modal-genre {
    color: var(--oro);
}

#modal1 .modal-header h2,
#modal2 .modal-header h2,
#modal3 .modal-header h2,
#modal4 .modal-header h2,
#modal5 .modal-header h2,
#modal6 .modal-header h2,
#modal7 .modal-header h2 {
    color: var(--marfil);
}

#modal1 .modal-body p,
#modal2 .modal-body p,
#modal3 .modal-body p,
#modal4 .modal-body p,
#modal5 .modal-body p,
#modal6 .modal-body p,
#modal7 .modal-body p {
    color: var(--text-mid-light);
}

/* Individual modal content backgrounds */
#modal1 .modal-content,
#modal2 .modal-content,
#modal3 .modal-content,
#modal4 .modal-content,
#modal5 .modal-content,
#modal6 .modal-content,
#modal7 .modal-content {
    background: var(--marfil) !important;
}

.buy-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.88rem 2.5rem;
    background: var(--cobre);
    color: var(--marfil);
    text-decoration: none;
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.32s var(--ease-out);
    box-shadow: 0 4px 16px rgba(194, 95, 32, 0.28);
    border: 1px solid var(--cobre);
}

.buy-button:hover {
    background: #d4691f;
    border-color: #d4691f;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(194, 95, 32, 0.38);
}

/* ===== CONTACTO ===== */
.contact {
    background: var(--petroleo);
}

.contact .section-badge {
    color: var(--oro);
}

.contact .section-badge::before,
.contact .section-badge::after {
    background: var(--oro);
}

.contact-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-text {
    padding: 2rem 0;
    max-width: 600px;
}

.contact-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--marfil);
    margin: 1.2rem 0 1.5rem;
    line-height: 1.2;
}

.contact-description {
    font-size: 1.08rem;
    color: rgba(240, 239, 237, 0.6);
    line-height: 1.75;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.instagram-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid rgba(240, 239, 237, 0.35);
    color: var(--marfil);
    border-radius: 2px;
    font-weight: 500;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: all 0.32s var(--ease-out);
}

.instagram-button:hover {
    background: rgba(240, 239, 237, 0.09);
    border-color: var(--oro);
    color: var(--oro);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--azul-tinta);
    color: rgba(240, 239, 237, 0.38);
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(190, 155, 88, 0.14);
}

.footer p {
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}

/* ===== WHATSAPP ===== */
.whatsapp-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 54px;
    height: 54px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.32);
    transition: all 0.3s var(--ease-out);
    z-index: 999;
    animation: waPulse 3s ease-in-out infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.52);
}

@keyframes waPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.32); }
    50%       { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--carbon);
}

::-webkit-scrollbar-thumb {
    background: var(--cobre);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--oro);
}

/* ===== PASSIONS GRID (unused but keeping for compatibility) ===== */
.passions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.passion-item {
    padding: 1.5rem 2rem;
    background: rgba(194, 95, 32, 0.06);
    border: 1px solid rgba(194, 95, 32, 0.15);
    border-radius: 2px;
    color: var(--carbon);
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-out);
}

.passion-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.passion-item:hover {
    background: rgba(194, 95, 32, 0.1);
    border-color: rgba(194, 95, 32, 0.3);
    transform: translateY(-4px);
}

/* ===== HAMBURGER BUTTON ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 200;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--azul-tinta);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.35s var(--ease-in-out),
                opacity   0.25s ease,
                background 0.4s var(--ease-out);
}

.header.scrolled .nav-toggle span {
    background: var(--marfil);
}

/* X animation */
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-subtitle {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta-group {
        justify-content: center;
    }

    .image-floating {
        max-width: 300px;
        margin: 0 auto;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .about-image {
        position: static;
        max-width: 240px;
        margin: 0 auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    /* Nav */
    .nav-toggle {
        display: flex;
    }

    .nav-content {
        flex-wrap: wrap;
        padding: 1rem 0;
        position: relative;
    }

    .nav-menu {
        /* Collapsed state */
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: rgba(43, 48, 89, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        /* Slide below nav bar */
        position: fixed;
        top: 66px;
        left: 0;
        right: 0;
        z-index: 99;
        transition: max-height 0.42s var(--ease-in-out),
                    opacity    0.35s var(--ease-out);
        opacity: 0;
        pointer-events: none;
    }

    .nav-menu.open {
        max-height: 280px;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(240, 239, 237, 0.06);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a,
    .header:not(.scrolled) .nav-menu a {
        display: block;
        padding: 1.1rem 2rem;
        color: rgba(240, 239, 237, 0.8);
        font-size: 0.85rem;
        letter-spacing: 0.14em;
    }

    .nav-menu a:hover,
    .header:not(.scrolled) .nav-menu a:hover {
        color: var(--oro);
        background: rgba(240, 239, 237, 0.04);
    }

    .nav-menu a::after {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 6.5rem 0 4.5rem;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-badge {
        font-size: 0.7rem;
    }

    /* Sections */
    section {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    /* About */
    .about-intro {
        font-size: 1.1rem;
    }

    /* Books */
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .book-cover {
        height: 320px;
    }

    .book-info {
        padding: 1rem 1.1rem 1.3rem;
    }

    .book-info h3 {
        font-size: 1rem;
        min-height: auto;
    }

    /* Contact */
    .contact-title {
        font-size: 2.1rem;
    }

    .contact-description {
        font-size: 1rem;
    }

    /* Modals */
    .modal {
        padding: 1rem;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 88vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-header {
        padding: 1.8rem 1.5rem 1.4rem;
    }

    .modal-body {
        padding: 1.4rem 1.5rem 2rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
        padding-right: 2rem;
    }

    /* WhatsApp */
    .whatsapp-button {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 50px;
        height: 50px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.85rem;
    }

    .section-title,
    .contact-title {
        font-size: 1.9rem;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .book-cover {
        height: 380px;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }

    .hero-cta-group {
        flex-direction: column;
    }

    .instagram-button {
        width: 100%;
        justify-content: center;
    }

    .close {
        top: 1rem;
        right: 1rem;
    }

    .modal-header h2 {
        font-size: 1.35rem;
    }
}
