:root {
    --color-bg: #f4ece1;
    /* Light parchment */
    --color-paper: #fdf6e3;
    --color-accent: #8b4513;
    /* Saddlebrown */
    --color-highlight: #d4af37;
    /* Gold */
    --color-text: #2c1e13;
    /* Dark brown */
    --color-wood: #3d2b1f;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Playfair Display', serif;
    --font-clean: 'Montserrat', sans-serif;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #fdf6e3 0%, #f4ece1 50%, #e6d7b8 100%);
    background-attachment: fixed;
    /* Keeps the gradient stable while scrolling */
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Texture overlay for the whole page */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
    opacity: 0.3;
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.highlight {
    color: var(--color-accent);
    font-weight: 700;
}

/* Sticky Nav */
.sticky-nav {
    position: sticky;
    top: 0;
    background: rgba(44, 30, 19, 0.98);
    backdrop-filter: blur(10px);
    color: #fff;
    z-index: 1000;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--color-highlight);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    margin-right: 2rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--color-highlight);
}

.social-icons a {
    color: #fff;
    font-size: 1rem;
    margin-left: 1.2rem;
    transition: transform 0.3s, color 0.3s;
}

.social-icons a:hover {
    color: var(--color-highlight);
    transform: scale(1.1);
}

/* Hero - Ultra Compressed as per reference */
.hero {
    height: auto;
    min-height: 120px;
    /* Further refined */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 15px;
    padding-bottom: 15px;
    /* Precise 20px gap between text and border as requested */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://www.metodoquimico.com/styles/prosilver/theme/images/site_logo.png') no-repeat center center;
    background-size: contain;
    background-color: var(--color-wood);
    color: #fff;
    border-bottom: 3px solid var(--color-highlight);
    /* Yellowish gold as per reference hints */
}

.hero-content h1 {
    font-size: 3rem;
    margin-top: 5px;
    margin-bottom: -5px;
    /* Extremely tight */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    line-height: 1;

    /* Parchment gradient effect */
    background: linear-gradient(to bottom, #f4ece1 0%, #d9c5a3 50%, #b8a078 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    /* Required for background-clip: text in some browsers */
}

.hero .highlight {
    color: var(--color-highlight);
    background: none;
    -webkit-text-fill-color: var(--color-highlight);
}

.subtitle {
    font-size: 1.2rem;
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 1px;
    opacity: 0.95;
    margin-top: 5px;
    margin-bottom: 0;
    text-transform: none;

    /* Parchment gradient effect */
    background: linear-gradient(to bottom, #f4ece1 0%, #d9c5a3 50%, #b8a078 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

/* Sections - More compact */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.section-v {
    min-height: auto;
    /* Roughly 33% of a scrolling page on PC view */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.2rem 0;
    /* Ultra-minimal */
}

.section-l {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 1rem 2rem 1rem;
    /* Matched 15px top spacing */
    border-top: 3px solid var(--color-highlight);
    /* Added identical line */
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    margin-top: 0;
    /* Minimized vertical space */
    margin-bottom: 0.1rem;
    position: relative;
}

.section-title::after {
    display: none;
    /* Removed decorative line to save space as requested */
}

.section-subtitle {
    text-align: center;
    font-style: italic;
    font-size: 1.28rem;
    /* Reduced by ~1px */
    margin-bottom: 2rem;
    color: #4a3728;
}

/* Refining Section 1: Camino Layout - More Compressed */
.video-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    /* Reduced from 3rem */
    padding: 0.2rem 0;
    /* Reduced from 1rem */
    position: relative;
}

@media (min-width: 1024px) {
    .video-path {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .video-step:nth-child(even) {
        margin-top: 2rem;
        /* Reduced from 4rem for tighter feel */
    }
}

.video-step {
    max-width: 360px;
    /* Reduced from 400px */
    width: 100%;
}

/* Authentic Wood Frame */
.video-frame {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border: 15px solid transparent;
    border-image: url('https://img.freepik.com/free-photo/dark-brown-wooden-textured-background_53876-110023.jpg?t=st=1710000000&exp=1710003600&hmac=...placeholder...') 30 round;
    /* Wood texture placeholder */
    background: #000;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 20px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

/* Using a solid color fallback with grain for wood if image fails or for simplicity */
.video-frame {
    border: 12px solid #3d2b1f;
    border-style: ridge;
    outline: 2px solid #5a3e2a;
}

.step-marker {
    width: 50px;
    /* Reduced from 70px */
    height: 50px;
    background: #8b0000;
    color: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    border: 4px double #d4af37;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset -5px -5px 10px rgba(0, 0, 0, 0.3),
        inset 5px 5px 10px rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: default;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    opacity: 0.8;
}

.video-placeholder i {
    position: absolute;
    font-size: 4rem;
    color: #fff;
    opacity: 0.9;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s, color 0.3s;
    z-index: 2;
}

.video-frame:hover .video-placeholder img {
    transform: scale(1.1);
    opacity: 1;
}

.video-frame:hover .video-placeholder i {
    color: #ff0000;
    transform: scale(1.2);
}

/* Wax Seal Detail */
.step-marker::after {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
}

/* Refining Section 2: Topics Grid (1x3 Layout) */
.topics-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 1rem 0;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .topics-grid {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 3rem;
    }

    .topic-step {
        width: 32%;
        /* Matches the 33% roughly feel */
    }
}

.topic-step {
    max-width: 360px;
    width: 100%;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.topic-card {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1.5rem;
}

/* Parchment 16:9 for topics - matching video section vibe and wood frames */
.topic-parchment {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background-color: transparent;
    background-size: cover;
    background-position: center;
    border: 12px solid #3d2b1f;
    border-style: ridge;
    outline: 2px solid #5a3e2a;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s, background-color 0.4s;
    overflow: hidden;
}

.topic-parchment::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    /* Darken background slightly for text readability */
    z-index: 1;
    transition: background 0.4s;
}

.topic-step:hover .topic-parchment::before {
    background: rgba(0, 0, 0, 0.05);
}

.topic-parchment h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    margin: 0;
    z-index: 2;
    font-family: var(--font-heading);
}

.topic-parchment i {
    position: absolute;
    bottom: 10%;
    font-size: 2.5rem;
    opacity: 0.6;
    color: var(--color-highlight);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s, transform 0.4s;
    z-index: 3;
}

#tema-1-card,
#tema-2-card,
#tema-3-card {
    background-size: 106% auto;
    /* Scaled up ~6% to crop out internal image margins */
    background-position: center center;
}

.topic-step:hover #tema-1-card,
.topic-step:hover #tema-2-card,
.topic-step:hover #tema-3-card {
    background-size: 125% auto;
    /* Increased zoom effect on hover */
}

.topic-step:hover .topic-parchment i {
    opacity: 0.3;
    transform: scale(1.2);
}

.video-caption,
.topic-caption {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    width: 100%;
    padding: 0 1rem;
}

/* Common focus dimming for sections */
.video-path:hover .video-step:not(:hover),
.topics-grid:hover .topic-step:not(:hover) {
    opacity: 0.5;
    filter: grayscale(0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float {
    animation: pulse 2s infinite;
}

/* Transition Ribbon - Explicit Centering */
.transition-arrow {
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 20px;
    /* Added 20px extra distance as requested */
    width: 100%;
}

.parchment-ribbon {
    display: inline-block;
    padding: 1rem 3rem;
    background: #e6d7b8;
    border: 1px solid #c9b084;
    position: relative;
    font-family: var(--font-heading);
    font-weight: 700;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
    text-align: center;
}

/* Lectura Section - Strict Centering */
.section-l {
    text-align: center;
}

/* Section 2 technical manuscript feel */
.parchment-card h3 {
    font-size: 1.4rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-highlight);
    display: inline-block;
    padding-bottom: 0.3rem;
}

.parchment-card p {
    font-size: 1rem;
    text-align: justify;
    color: #4a3728;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
}

/* Section 3 Redesign - 3x2 Grid Buttons */
.section-c {
    background: url('https://www.transparenttextures.com/patterns/aged-paper.png'), var(--color-bg);
    padding: 15px 1rem 3rem 1rem;
    /* Precise 15px top padding as requested */
    border-top: 3px solid var(--color-highlight);
    text-align: center;
}

.section-c .section-title {
    margin-top: 0;
    /* Ensures the padding is the only distance */
}

.section-c .section-subtitle {
    margin-bottom: 2.5rem;
    font-style: italic;
    color: #4a3728;
    font-size: 1.2rem;
}

.contact-grid-3x2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-btn {
    text-decoration: none !important;
    background: #fff;
    background-image: url('https://www.transparenttextures.com/patterns/old-map.png');
    border: 8px solid #3d2b1f;
    border-style: ridge;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    color: var(--color-accent) !important;
}

.contact-btn i {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    color: var(--color-accent);
}

.contact-btn span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Animations and Responsive fixes */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .video-step {
        max-width: 100%;
    }

    .contact-container {
        padding: 1.5rem;
    }
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 0.5rem 1rem;
    /* Minimum padding */
    background: var(--color-wood);
    color: #fff;
    margin-top: 1rem;
    /* Minimal top margin */
}

.main-footer p {
    margin: 0;
    /* Zero default text margins */
    font-size: 1.1rem;
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 1px;
    opacity: 0.95;

    /* Parchment gradient effect matching the hero subtitle */
    background: linear-gradient(to bottom, #f4ece1 0%, #d9c5a3 50%, #b8a078 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Responsive PC Layout - 33% parts */
@media (min-width: 1200px) {

    .section-v,
    .section-l {
        padding-left: 5%;
        padding-right: 5%;
    }
}