:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-gold: #d4af37;
    --accent-gold-dim: #8a702a;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

strong {
    color: var(--accent-gold);
    font-weight: 700;
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #000;
    /* Minimalist dark background */
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vh;
    height: 60vh;
    background: url('https://images.unsplash.com/photo-1577083552431-6e5fd01988ec?q=80&w=2000&auto=format&fit=crop') no-repeat center center/cover;
    opacity: 0.9;
    border-radius: 50%;
    box-shadow: 0 0 100px rgba(212, 175, 55, 0.2), inset 0 0 80px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.ancient-circle {
    width: 80%;
    height: 80%;
    border: 8px double rgba(92, 64, 51, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.pi-symbol {
    font-family: 'Times New Roman', serif;
    font-size: 15rem;
    color: #3e2723;
    font-weight: bold;
    opacity: 0.8;
    filter: blur(0.5px);
    mix-blend-mode: multiply;
    transform: translateY(-5%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, #050505 80%);
    /* Dark vignette */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.hero-text {
    font-family: var(--font-heading);
    font-size: 8rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    position: absolute;
    margin: 0;
    opacity: 0;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    letter-spacing: 10px;
}

/* Animation Sequence 
   Cycle: 8 seconds total
   0s: Start
   0-2s: 3:12 Visible (2s)
   2-3s: 3:12 Fade Out
   3-4s: Pause (1s)
   4-6s: Despertar Enter & Visible (2s)
   6-7s: Despertar Fade Out
   7-8s: Pause (1s) -> Loop
*/

.text-312 {
    animation: cycle312 8s infinite ease-in-out;
}

.text-despertar {
    font-size: 5rem;
    /* Different size for variety */
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: cycleDespertar 8s infinite ease-in-out;
}

@keyframes cycle312 {
    0% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(10px);
    }

    10% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
        text-shadow: 0 0 50px rgba(212, 175, 55, 0.8);
    }

    /* Glow effect */
    25% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    30% {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(5px);
    }

    100% {
        opacity: 0;
    }
}

@keyframes cycleDespertar {
    0% {
        opacity: 0;
    }

    45% {
        opacity: 0;
        transform: scale(1.2);
    }

    50% {
        opacity: 1;
        transform: scale(1);
        filter: contrast(2);
    }

    /* Glitch/Scale in */
    75% {
        opacity: 1;
        transform: scale(1);
    }

    85% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(10px);
    }

    100% {
        opacity: 0;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .text-312 {
        font-size: 5rem;
    }

    .text-despertar {
        font-size: 3rem;
    }

    .hero-background {
        width: 80vw;
        height: 50vh;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Content Sections */
.content-section {
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    text-align: center;
}

.container {
    max-width: 800px;
    width: 100%;
}

.number-symbol {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent-gold-dim);
    margin-bottom: 1rem;
    opacity: 0.5;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #cccccc;
}

.secondary-text {
    font-size: 1.1rem;
    color: #999;
    font-style: italic;
}

/* Highlight Section */
.highlight-bg {
    background: linear-gradient(to bottom, #050505, #0f0f0f, #050505);
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
}

.divider {
    height: 1px;
    width: 100px;
    background-color: var(--accent-gold);
    margin: 2rem auto;
}

/* Quote Section */
.quote-section {
    padding: 10rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1551098945-8339cba52602?q=80&w=2069&auto=format&fit=crop') no-repeat center center/cover;
    background-attachment: scroll;
    border-top: 1px solid #333;
    position: relative;
}

/* Animated Indicator */
.animated-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.symbol-item {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--accent-gold);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    opacity: 0;
    animation: cycleSymbols 6s infinite ease-in-out;
}

.item-312 {
    animation-delay: 0s;
}

.item-pi {
    font-size: 4rem;
    /* Slightly larger for Pi */
    animation-delay: 3s;
    /* Half of the 6s duration */
}

@keyframes cycleSymbols {

    0%,
    10% {
        opacity: 0;
        transform: scale(0.8);
    }

    20%,
    40% {
        opacity: 1;
        transform: scale(1);
    }

    50%,
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

blockquote {
    font-family: var(--font-heading);
    font-size: 2rem;
    /* Larger text */
    color: #fff;
    /* White for better contrast on image */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0 auto 3rem auto;
    line-height: 1.6;
    border-left: none;
    /* Remove border for cleaner look on image */
    padding: 0;
    max-width: 900px;
    width: 100%;
    text-align: center;
    /* Explicit center */
}

cite {
    display: block;
    font-size: 1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 3rem;
}

.final-message {
    font-size: 1.4rem;
    font-weight: 300;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-email {
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.contact-email:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.copyright {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 3rem;
    /* Space before image */
}

/* Final Image in Footer */
.final-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.final-image {
    max-width: 100%;
    width: auto;
    max-height: 600px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 2s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-title {
        font-size: 4rem;
    }

    h2 {
        font-size: 2rem;
    }

    blockquote {
        font-size: 1.4rem;
    }
}

/* Navigation Menu */
.top-nav {
    position: absolute;
    top: 2rem;
    right: 3rem;
    z-index: 100;
}

.top-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.top-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
}

.top-nav a:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold-dim);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.admin-link {
    font-size: 0.9rem;
    opacity: 0.5;
}

.admin-link:hover {
    opacity: 1;
}

/* Search Feature */
.search-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    /* Off-white */
    font-family: var(--font-heading);
    /* Cinzel */
    cursor: pointer;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.search-btn:hover {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    transform: scale(1.05);
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* More transparent to see background */
    backdrop-filter: blur(3px);
    /* Blur the background slightly for readability */
    z-index: 2000;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
}

.search-modal.active {
    display: flex;
}

.search-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.close-search {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.search-input-container {
    max-width: 600px;
    margin: 5vh auto 2rem;
    /* Moved much higher up */
    width: 90%;
    position: relative;
    padding: 2rem;

    /* Papyrus Look */
    background: #fdfbf7;
    /* Off-white paper */
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05) 0%, transparent 10%, transparent 90%, rgba(0, 0, 0, 0.05) 100%);
    /* Scroll curvature effect */
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.5),
        /* Deep shadow */
        inset 0 0 40px rgba(160, 140, 100, 0.1);
    /* Inner aging */
    border-radius: 4px;
    /* Slight rounding */
    transform: rotate(-1deg);
    /* Imperfect alignment */
}

.search-input-container::before,
.search-input-container::after {
    /* Wooden Scroll Handles simulation (optional, keep simple for now) */
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    width: 20px;
    background: #5d4037;
    /* Dark wood */
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.search-input-container::before {
    left: -10px;
}

.search-input-container::after {
    right: -10px;
}

#searchInput {
    width: 100%;
    background: transparent;
    border: none;
    font-family: 'Cinzel', serif;
    /* Ensure Cinzel is used */
    font-size: 1.5rem;
    color: #3e2723;
    /* Dark brown ink color */
    padding: 0;
    outline: none;
    text-align: center;
}

#searchInput::placeholder {
    color: #8d6e63;
    /* Lighter brown */
    opacity: 0.7;
    font-style: italic;
}

#searchResults {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    gap: 2rem;
}

/* Re-use post card styles for results but slightly modified if needed */
.search-result-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-left: 3px solid var(--accent-gold);
}

.search-result-item h3 {
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.search-result-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 1rem;
    display: block;
}

/* Mobile Nav adjustments */
@media (max-width: 768px) {

    /* Audio Player */
    .audio-player-container {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid #333;
    }

    audio {
        width: 100%;
        height: 40px;
        border-radius: 4px;
        outline: none;
    }

    audio::-webkit-media-controls-panel {
        background-color: #222;
    }

    audio::-webkit-media-controls-play-button,
    audio::-webkit-media-controls-mute-button {
        filter: invert(1);
        /* Make icons white/gold roughly */
    }
}