/* ================================================================
   TALEGRAPHER.COM - CSS STYLES
   Victorian cartography of stories with frosted glass aesthetic
   ================================================================ */

/* Color Palette */
:root {
    --bg-frost: #f0f2f5;
    --bg-parchment: #eee8e0;
    --bg-etched: #e6eaef;
    --text-ink: #2c2c3a;
    --text-dusk: #3d3d50;
    --text-frost-steel: #7a8b9a;
    --accent-gaslight: #c8a87e;
    --accent-pale-carte: #a0b4c8;
    --shadow-chimney: #1a1a28;
    --vellum-mist: rgba(240, 242, 245, 0.72);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    background: var(--bg-frost);
    color: var(--text-dusk);
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* ================================================================
   CARTOUCHE SECTION
   ================================================================ */

.cartouche-section {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-frost);
    position: relative;
    overflow: hidden;
}

.cartouche-frame {
    position: relative;
    width: 70%;
    max-width: 600px;
    aspect-ratio: 4/3;
    background: var(--vellum-mist);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 2px solid rgba(44, 44, 58, 0.3);
    border-radius: 2px;
    padding: 60px 40px;
    box-shadow: 0 4px 30px rgba(26, 26, 40, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    animation: cartouche-fade 1.2s ease-out;
}

@keyframes cartouche-fade {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cartouche-ornament-top,
.cartouche-ornament-bottom {
    width: 80%;
    height: 40px;
    background: linear-gradient(90deg, transparent 0%, var(--text-ink) 15%, var(--text-ink) 85%, transparent 100%);
    opacity: 0.15;
    position: relative;
}

.cartouche-ornament-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--text-ink), var(--text-ink) 8px, transparent 8px, transparent 16px);
    opacity: 0.2;
}

.cartouche-ornament-bottom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--text-ink), var(--text-ink) 8px, transparent 8px, transparent 16px);
    opacity: 0.2;
}

.cartouche-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.08em;
    color: var(--text-ink);
    text-align: center;
    line-height: 1.1;
}

.cartouche-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-frost-steel);
    text-align: center;
}

/* ================================================================
   CONTOUR NARRATIVE SECTION
   ================================================================ */

.contour-narrative {
    width: 100%;
    min-height: 250vh;
    position: relative;
    background: linear-gradient(180deg, var(--bg-frost) 0%, var(--bg-parchment) 50%, var(--bg-frost) 100%);
}

.contour-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.contour-lines {
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.content-narrative {
    position: relative;
    z-index: 10;
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.narrative-block {
    background: var(--vellum-mist);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    padding: 40px;
    margin: 6.854rem 0;
    box-shadow: 0 4px 30px rgba(26, 26, 40, 0.06);
    opacity: 0;
    animation: narrative-fade 0.9s ease-out forwards;
}

.block-1 { animation-delay: 0.5s; }
.block-2 { animation-delay: 0.7s; }
.block-3 { animation-delay: 0.9s; }
.block-4 { animation-delay: 1.1s; }

@keyframes narrative-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.narrative-block h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-ink);
    margin-bottom: 16px;
    letter-spacing: 0.04em;
}

.narrative-block p {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.8;
    color: var(--text-dusk);
    text-align: justify;
}

/* ================================================================
   ORNAMENTAL DIVIDERS
   ================================================================ */

.divider-ornamental {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 4.236rem 0;
    opacity: 0;
    animation: divider-appear 0.8s ease-out forwards;
}

.block-1 ~ .divider-ornamental:first-of-type { animation-delay: 0.7s; }
.block-2 ~ .divider-ornamental { animation-delay: 0.85s; }
.block-3 ~ .divider-ornamental { animation-delay: 1.05s; }

@keyframes divider-appear {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.divider-ornamental svg {
    width: 80%;
    max-width: 400px;
    height: auto;
}

/* ================================================================
   COMPASS ORNAMENT
   ================================================================ */

.compass-ornament {
    width: 120px;
    height: 120px;
    margin: 4.236rem auto;
    opacity: 0;
    animation: compass-appear 1s ease-out 1.2s forwards;
}

@keyframes compass-appear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-45deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.compass-ornament svg {
    width: 100%;
    height: 100%;
    animation: compass-rotate 120s linear infinite;
}

@keyframes compass-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
   LEGEND SECTION
   ================================================================ */

.legend-section {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-frost) 0%, var(--bg-etched) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 5%;
    position: relative;
    z-index: 5;
}

.legend-container {
    max-width: 900px;
    width: 100%;
    background: var(--vellum-mist);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    padding: 60px 40px;
    box-shadow: 0 4px 30px rgba(26, 26, 40, 0.06);
    opacity: 0;
    animation: legend-appear 0.9s ease-out 0.3s forwards;
}

@keyframes legend-appear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legend-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-ink);
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: 0.04em;
}

.legend-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    animation: legend-item-appear 0.7s ease-out forwards;
}

.legend-item:nth-child(1) { animation-delay: 0.5s; }
.legend-item:nth-child(2) { animation-delay: 0.65s; }
.legend-item:nth-child(3) { animation-delay: 0.8s; }
.legend-item:nth-child(4) { animation-delay: 0.95s; }

@keyframes legend-item-appear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legend-symbol {
    font-size: 2.5rem;
    color: var(--accent-gaslight);
    margin-bottom: 12px;
    font-family: 'Playfair Display', serif;
}

.legend-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-frost-steel);
    margin-bottom: 8px;
}

.legend-item p {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.6;
    color: var(--text-dusk);
}

/* ================================================================
   MERIDIAN FOOTER
   ================================================================ */

.meridian-footer {
    width: 100%;
    background: var(--shadow-chimney);
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.meridian-content {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.05em;
    color: var(--accent-pale-carte);
}

.meridian-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-frost-steel);
    margin: 0 8px;
}

.meridian-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--accent-pale-carte);
}

.meridian-divider {
    margin: 0 16px;
    opacity: 0.5;
}

/* ================================================================
   CURSOR-FOLLOW INTERACTIONS
   ================================================================ */

.narrative-block,
.legend-item {
    transition: all 0.3s ease-out;
}

.narrative-block:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 0 8px 40px rgba(26, 26, 40, 0.12);
}

.divider-ornamental:hover {
    opacity: 0.8;
}

.compass-ornament:hover {
    filter: drop-shadow(0 0 8px rgba(200, 168, 126, 0.4));
}

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

@media (max-width: 768px) {
    .cartouche-frame {
        width: 90%;
        padding: 40px 30px;
    }

    .content-narrative {
        padding: 60px 5%;
    }

    .narrative-block {
        margin: 4.236rem 0;
        padding: 30px;
    }

    .legend-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .meridian-content {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .cartouche-frame {
        width: 95%;
        padding: 30px 20px;
    }

    .cartouche-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .narrative-block {
        padding: 20px;
        text-align: left;
    }

    .compass-ornament {
        width: 80px;
        height: 80px;
    }
}
