/* ============================================================
   mystical.boo - Styles
   Light-academia aesthetic meets mystical exploration
   Split-screen duality: scholarly (left) / arcane (right)
   ============================================================ */

/* --- Palette ---
   Academy cream:     #FAF5E8
   Mystical plum:     #2A1028
   Gold scholarly:    #B8962E
   Marble classical:  #D8D0C0
   Ink black:         #1A1810
   Spirit silver:     #C8C0D0
   Vector teal:       #4A9088
   ------------------------------------------------------------ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: #1A1810;
    background: #FAF5E8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Kinetic Letter-Spacing Animation === */
@keyframes breathe {
    0%, 100% { letter-spacing: 0.02em; }
    50% { letter-spacing: 0.06em; }
}

@keyframes breatheSlow {
    0%, 100% { letter-spacing: 0.01em; }
    50% { letter-spacing: 0.04em; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes drawLine {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

@keyframes wobble {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes symbolRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(5deg); }
}

@keyframes floatGently {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes clipMerge {
    from { clip-path: inset(0 50% 0 50%); }
    to { clip-path: inset(0 0 0 0); }
}

/* === Dual Gateway Hero === */
#dual-gateway {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#center-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#gold-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawLine 1000ms ease-out forwards;
}

.gateway-half {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    min-height: 100vh;
}

.gateway-left {
    background: #FAF5E8;
}

.gateway-right {
    background: #2A1028;
}

.gateway-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    animation: breathe 3s ease-in-out infinite, fadeIn 800ms ease-out forwards;
    opacity: 0;
    animation-delay: 800ms, 800ms;
    animation-fill-mode: none, forwards;
}

.gateway-title-left {
    color: #1A1810;
    animation: breathe 3s ease-in-out infinite, fadeIn 800ms 800ms ease-out forwards;
}

.gateway-title-right {
    color: #FAF5E8;
    animation: breathe 3s ease-in-out infinite, fadeIn 800ms 800ms ease-out forwards;
}

.gateway-symbol {
    width: 120px;
    height: 120px;
    margin: 30px 0;
    opacity: 0;
    animation: fadeIn 600ms 1500ms ease-out forwards;
}

.gateway-symbol-left .symbol-svg {
    width: 100%;
    height: 100%;
}

.gateway-symbol-right .symbol-svg {
    width: 100%;
    height: 100%;
    animation: floatGently 4s ease-in-out infinite;
}

.gateway-excerpt {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 16px);
    line-height: 1.85;
    color: #1A1810;
    text-align: center;
    max-width: 320px;
    opacity: 0;
    animation: fadeInUp 600ms 1500ms ease-out forwards;
}

.gateway-excerpt-dark {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(15px, 1vw, 16px);
    line-height: 1.85;
    color: #C8C0D0;
    text-align: center;
    max-width: 320px;
    opacity: 0;
    animation: fadeInUp 600ms 1500ms ease-out forwards;
}

/* Scroll Indicators */
.scroll-indicator-left,
.scroll-indicator-right {
    position: absolute;
    top: 0;
    width: 2px;
    height: 0%;
    background: #B8962E;
    z-index: 11;
    transition: height 0.15s ease-out;
}

.scroll-indicator-left {
    right: calc(50% + 2px);
}

.scroll-indicator-right {
    left: calc(50% + 2px);
}

/* === Split Study Panels === */
#study-panels,
#study-panels-2 {
    display: block;
}

.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.panel {
    overflow-y: auto;
}

.panel-academic {
    background: #FAF5E8;
}

.panel-mystical {
    background: #2A1028;
}

.panel-inner {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Study Cards */
.study-card {
    padding: 40px;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.study-card-light {
    background: #FAF5E8;
    border-left: 2px solid #B8962E;
}

.study-card-dark {
    background: rgba(42, 16, 40, 0.6);
    border-left: 2px solid #4A9088;
}

.card-label {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #B8962E;
    display: block;
    margin-bottom: 16px;
    font-variant: small-caps;
}

.card-label-dark {
    color: #4A9088;
}

.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 32px);
    color: #1A1810;
    margin-bottom: 20px;
    animation: breatheSlow 4s ease-in-out infinite;
}

.card-title-dark {
    color: #C8C0D0;
}

.card-body-academic {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 16px);
    line-height: 1.85;
    color: #1A1810;
    margin-bottom: 16px;
}

.card-body-academic:last-child {
    margin-bottom: 0;
}

.card-body-mystical {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(15px, 1vw, 16px);
    line-height: 1.85;
    color: #C8C0D0;
}

.card-symbol {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.arcane-symbol {
    width: 140px;
    height: 140px;
    transition: transform 0.4s ease-out;
}

.arcane-symbol:hover {
    transform: rotate(5deg);
}

/* Hover effects: light side gets plum text-shadow, dark side gets cream */
.study-card-light:hover .card-title {
    text-shadow: 1px 1px 4px rgba(42, 16, 40, 0.15);
    transition: text-shadow 0.3s ease;
}

.study-card-light:hover .card-body-academic {
    text-shadow: 0.5px 0.5px 2px rgba(42, 16, 40, 0.1);
    transition: text-shadow 0.3s ease;
}

.study-card-dark:hover .card-title-dark {
    text-shadow: 1px 1px 4px rgba(250, 245, 232, 0.15);
    transition: text-shadow 0.3s ease;
}

.study-card-dark:hover .card-body-mystical {
    text-shadow: 0.5px 0.5px 2px rgba(250, 245, 232, 0.1);
    transition: text-shadow 0.3s ease;
}

/* Center line wobble on panel hover */
.gateway-left:hover ~ #center-line,
.gateway-right:hover ~ #center-line {
    animation: wobble 0.5s ease-in-out;
}

/* === Convergence Sections === */
.convergence {
    background: #D8D0C0;
    padding: 80px 40px;
    position: relative;
    overflow: hidden;
}

.convergence::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(184, 150, 46, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(74, 144, 136, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.convergence-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.convergence-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.convergence-decoration {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.convergence-ornament {
    width: 280px;
    height: 40px;
}

.convergence-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(28px, 3vw, 44px);
    color: #1A1810;
    text-align: center;
    margin-bottom: 30px;
    animation: breatheSlow 4s ease-in-out infinite;
}

.convergence-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 16px);
    line-height: 1.85;
    color: #1A1810;
    text-align: center;
    margin-bottom: 20px;
}

.convergence-text:last-child {
    margin-bottom: 0;
}

.marble-filter {
    position: absolute;
}

/* === Arcana Gallery === */
#arcana-gallery {
    background: #2A1028;
    padding: 80px 0 80px 0;
    overflow: hidden;
}

.gallery-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(28px, 3vw, 44px);
    color: #C8C0D0;
    text-align: center;
    margin-bottom: 12px;
    animation: breatheSlow 4s ease-in-out infinite;
}

.gallery-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 0.9vw, 15px);
    color: #C8C0D0;
    text-align: center;
    opacity: 0.7;
    margin-bottom: 50px;
    letter-spacing: 0.05em;
}

.gallery-track {
    display: flex;
    gap: 30px;
    padding: 0 60px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #B8962E #2A1028;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.gallery-track:active {
    cursor: grabbing;
}

.gallery-track::-webkit-scrollbar {
    height: 4px;
}

.gallery-track::-webkit-scrollbar-track {
    background: #2A1028;
}

.gallery-track::-webkit-scrollbar-thumb {
    background: #B8962E;
    border-radius: 2px;
}

.gallery-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.gallery-card.visible {
    opacity: 1;
    transform: scale(1);
}

.gallery-card-inner {
    background: rgba(42, 16, 40, 0.5);
    border: 1px solid rgba(184, 150, 46, 0.2);
    border-radius: 4px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.gallery-card-inner:hover {
    border-color: rgba(184, 150, 46, 0.5);
    transform: translateY(-4px);
}

.gallery-symbol {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
    transition: transform 0.4s ease-out;
}

.gallery-card-inner:hover .gallery-symbol {
    transform: rotate(5deg);
}

.gallery-card-label {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #B8962E;
    display: block;
    margin-bottom: 10px;
    font-variant: small-caps;
}

.gallery-card-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: #C8C0D0;
    opacity: 0.8;
}

/* === Final Convergence === */
.convergence-final {
    background: linear-gradient(180deg, #D8D0C0 0%, #FAF5E8 100%);
    padding: 100px 40px;
    text-align: center;
}

.final-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    color: #1A1810;
    animation: breathe 3s ease-in-out infinite;
    margin-bottom: 16px;
}

.final-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.85;
    color: #1A1810;
    opacity: 0.7;
    margin-bottom: 40px;
}

.final-symbol {
    display: flex;
    justify-content: center;
    align-items: center;
}

.symbol-svg-final {
    width: 100px;
    height: 100px;
    animation: floatGently 5s ease-in-out infinite;
}

/* === Responsive (Mobile) === */
@media (max-width: 768px) {
    #dual-gateway {
        grid-template-columns: 1fr;
    }

    .gateway-half {
        min-height: 50vh;
        padding: 40px 24px;
    }

    #center-line {
        display: none;
    }

    .scroll-indicator-left,
    .scroll-indicator-right {
        display: none;
    }

    .split-container {
        grid-template-columns: 1fr;
    }

    .panel-inner {
        padding: 40px 24px;
    }

    .study-card {
        padding: 24px;
    }

    .convergence {
        padding: 60px 24px;
    }

    .convergence-final {
        padding: 60px 24px;
    }

    #arcana-gallery {
        padding: 60px 0;
    }

    .gallery-track {
        padding: 0 24px;
        gap: 20px;
    }

    .gallery-card {
        flex: 0 0 240px;
    }

    .arcane-symbol {
        width: 100px;
        height: 100px;
    }

    .gateway-symbol {
        width: 80px;
        height: 80px;
    }
}

/* === Selection Styling === */
::selection {
    background: rgba(184, 150, 46, 0.25);
    color: #1A1810;
}

.panel-mystical ::selection {
    background: rgba(74, 144, 136, 0.3);
    color: #C8C0D0;
}

/* === Link Styles (for any future links) === */
a {
    color: #4A9088;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

a:hover {
    border-bottom-color: #4A9088;
}

.panel-academic a {
    color: #4A9088;
}

.panel-mystical a {
    color: #B8962E;
}
