:root {
    --bg: #050816;
    /* fondo principal oscuro */
    --bg-alt: #0f172a;
    --surface: #0b1120;
    --surface-soft: #020617;
    --light: #f8fafc;
    --muted: #cbd5f5;
    --muted-soft: #94a3b8;
    --accent: #fbbf77;
    /* dorado suave */
    --accent-soft: #f97316;
    --accent-deep: #fb923c;
    --border: rgba(148, 163, 184, 0.36);
    --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.85);

    --font-serif: 'Crimson Pro', "Georgia", serif;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --space-xs: 6px;
    --space-sm: 14px;
    --space-md: 28px;
    --space-lg: 56px;
    --space-xl: 88px;

    --max-width: 1080px;
    --max-width-wide: 1080px;
}

/* RESET BÁSICO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.18), transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(251, 191, 80, 0.16), transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.12), transparent 55%),
        linear-gradient(135deg, #020617 0%, #020617 45%, #0f172a 100%);
    color: var(--light);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    letter-spacing: -0.02em;
    font-weight: 600;
    color: #e5e7eb;
}

h1 {
    font-size: 2.7rem;
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: 1.9rem;
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

/* UTILIDADES */
.mt-lg {
    margin-top: var(--space-lg);
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* =========================
   HEADER
========================= */
header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.82));
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.header-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--light);
}

nav a {
    margin-left: 20px;
    font-size: 0.9rem;
    color: var(--muted-soft);
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-deep));
    transition: width 0.22s ease;
}

nav a:hover {
    color: var(--light);
}

nav a:hover::after {
    width: 100%;
}

/* =========================
   HERO
========================= */
.hero {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: var(--space-xl) 20px var(--space-lg);
}

.hero-content {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.hero-text {
    max-width: 40rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted-soft);
    padding: 6px 14px;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.4), transparent 55%),
        rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    margin-bottom: var(--space-md);
}

.hero-title {
    font-size: 3rem;
    line-height: 1.05;
}

.hero-title-accent {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent);
    margin-top: var(--space-xs);
}

.hero-intro {
    margin-top: var(--space-md);
    max-width: 34rem;
}

/* HERO STATS */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: var(--space-md);
}

.stat-item {
    min-width: 90px;
}

.stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted-soft);
}

/* BOTONES */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 26px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    cursor: pointer;
    background: transparent;
    color: var(--light);
    transition: all 0.2s ease-out;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: radial-gradient(circle at 0 0, rgba(251, 191, 80, 0.4), transparent 55%),
        linear-gradient(135deg, #fbbf24, #fb923c);
    border-color: transparent;
    color: #0b1120;
    box-shadow: 0 18px 40px rgba(251, 191, 36, 0.45);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 55px rgba(251, 191, 36, 0.6);
}

.btn-secondary,
.btn.secondary {
    background: rgba(15, 23, 42, 0.75);
}

.btn-secondary:hover,
.btn.secondary:hover {
    background: rgba(30, 64, 175, 0.9);
}

/* HERO VISUAL */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-book-card {
    background: radial-gradient(circle at 0 0, rgba(251, 191, 80, 0.18), transparent 60%),
        rgba(15, 23, 42, 0.98);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: var(--shadow-soft);
    max-width: 320px;
}

.hero-book-image {
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.95);
    margin-bottom: var(--space-sm);
}

.hero-book-info h3 {
    font-size: 1rem;
    color: var(--accent);
}

.hero-book-info p {
    font-size: 0.9rem;
}

.hero-book-meta {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--muted-soft);
}

/* HERO SCROLL INDICATOR */
.hero-scroll-indicator {
    margin-top: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted-soft);
}

/* =========================
   SECCIONES BÁSICAS
========================= */
section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) 20px;
}

section.wide {
    max-width: var(--max-width-wide);
}

.lead {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: var(--space-md);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted-soft);
    margin-bottom: var(--space-md);
}

.section-label::before {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

/* =========================
   BOOK SHOWCASE
========================= */
.book-showcase {
    display: grid;
    grid-template-columns: 0.9fr 1.5fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border-radius: 24px;
    background:
        radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.35), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(251, 191, 80, 0.28), transparent 60%),
        rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.65);
    box-shadow: var(--shadow-soft);
}

.book-showcase-visual {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.book-showcase-image {
    border-radius: 18px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 1);
    transform-origin: center;
    transition: transform 0.28s ease-out;
}

.book-showcase-image:hover {
    transform: translateY(-6px) rotate(-1.5deg);
}

.book-showcase-badge {
    position: absolute;
    top: -10px;
    right: -6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #022c22;
    box-shadow: 0 16px 30px rgba(22, 163, 74, 0.65);
}

.book-showcase-content h3 {
    font-size: 1.7rem;
}

.book-description {
    margin-top: var(--space-sm);
}

/* DESTACADOS DEL LIBRO */
.book-highlights {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: 18px 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.55);
}

.highlight-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 14px;
    align-items: flex-start;
}

.highlight-item+.highlight-item {
    margin-top: 10px;
}

.highlight-icon {
    font-size: 1.2rem;
}

.highlight-item strong {
    font-size: 0.9rem;
    color: var(--accent);
}

.highlight-item p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.book-cta {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    border-top: 1px solid rgba(148, 163, 184, 0.5);
}

.book-price {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--muted-soft);
}

/* =========================
   CARDS / LISTAS
========================= */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.cards.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 20px;
    padding: var(--space-md);
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.card h3 {
    margin-bottom: var(--space-sm);
}

.card p {
    font-size: 0.9rem;
}

ul.simple-list {
    list-style: none;
}

ul.simple-list li {
    position: relative;
    padding-left: 18px;
    font-size: 0.9rem;
    color: var(--muted);
}

ul.simple-list li+li {
    margin-top: 4px;
}

ul.simple-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
}

/* =========================
   CITA DEL LIBRO
========================= */
.book-quote {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    border-left: 3px solid var(--accent);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.book-quote p {
    font-size: 1rem;
    font-style: italic;
    color: #e5e7eb;
    margin-bottom: var(--space-sm);
}

.book-quote cite {
    font-size: 0.9rem;
    color: var(--muted-soft);
}

/* =========================
   REVIEWS / COMENTARIOS
========================= */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}

.review-item {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.review-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: var(--space-xs);
}

.review-author {
    font-size: 0.8rem;
    color: var(--muted-soft);
}

/* =========================
   TIMELINE / BIO
========================= */
.timeline {
    margin-top: var(--space-md);
    display: grid;
    gap: var(--space-md);
}

.timeline-item {
    position: relative;
    padding-left: 36px;
    margin-left: 4px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    opacity: 0.7;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.9);
    background: radial-gradient(circle at 30% 0, var(--accent), #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

.timeline-icon {
    font-size: 1rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--muted-soft);
    margin-bottom: 4px;
}

.timeline-content {
    padding: var(--space-md);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.9);
}

.timeline-content p {
    font-size: 0.9rem;
}

.timeline-present {
    margin-top: var(--space-sm);
    color: var(--muted);
}

.timeline-highlight .timeline-content {
    border-color: rgba(251, 191, 80, 0.75);
}

/* BIO STATS */
.bio-stats {
    margin-top: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
}

.bio-stat-item {
    text-align: center;
}

.bio-stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.bio-stat-label {
    font-size: 0.8rem;
    color: var(--muted-soft);
}

/* =========================
   GALERÍA
========================= */
.photo-gallery-modern {
    margin-top: var(--space-md);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 200px;
    gap: 14px;
}

.photo-item-modern {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.photo-item-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.photo-item-modern:hover img {
    transform: scale(1.04);
    opacity: 0.95;
}

.photo-tall {
    grid-row: span 2;
}

.photo-wide {
    grid-column: span 2;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.2s ease-out;
    display: flex;
    align-items: flex-end;
}

.photo-item-modern:hover .photo-overlay {
    opacity: 1;
}

.photo-caption-modern {
    padding: 12px 14px;
}

.photo-caption-modern h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.photo-caption-modern p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.gallery-note {
    margin-top: var(--space-md);
    font-size: 0.9rem;
}

/* =========================
   ESCRITOS (CARD SIMPLE)
========================= */
/* Usa .card y .btn ya definidos, solo ajustamos si hace falta */

#escritos .card h3 {
    margin-bottom: var(--space-sm);
}

/* =========================
   FORMULARIO CONTACTO
========================= */
#contacto p {
    font-size: 0.9rem;
}

#contacto strong {
    color: var(--accent);
}

form {
    margin-top: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted-soft);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
    color: var(--light);
    padding: 10px 12px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(251, 191, 80, 0.4);
    background: rgba(15, 23, 42, 1);
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: var(--space-sm) 0 var(--space-md);
    font-size: 0.8rem;
    color: var(--muted-soft);
}

.checkbox-wrapper input[type="checkbox"] {
    margin-top: 3px;
}

/* Honeypot (oculto) */
.hp {
    display: none;
}

/* ALERTAS FORMULARIO */
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

.alert.success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.6);
    color: #bbf7d0;
}

.alert.error {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.7);
    color: #fecaca;
}

/* =========================
   FOOTER
========================= */
footer {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: var(--space-lg) 20px var(--space-md);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    margin-top: var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: flex-end;
    font-size: 0.85rem;
    color: var(--muted-soft);
}

.footer-links a {
    position: relative;
}

.footer-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-deep));
    transition: width 0.2s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.divider {
    height: 1px;
    width: 100%;
    background: rgba(148, 163, 184, 0.35);
    margin-bottom: 10px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: var(--space-lg);
    }

    .hero-book-card {
        max-width: 320px;
    }

    .book-showcase {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .photo-gallery-modern {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 180px;
    }

    .bio-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    html {
        font-size: 16px;
    }

    .header-inner {
        padding-inline: 16px;
    }

    nav a {
        margin-left: 14px;
        font-size: 0.8rem;
    }

    section,
    section.wide {
        padding-inline: 16px;
    }

    .cards.two-col {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .photo-gallery-modern {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 160px;
    }
}