/* ============================================
   adhoc.quest - Holographic Shrine Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #2A2438;
    background: #FFF8F0;
    overflow-x: hidden;
}

/* --- Noise Texture Overlay (Photocopied zine feel) --- */
.panel-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    z-index: 1;
}

/* --- Sidebar Navigation Spine --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 72px;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar:hover {
    width: 200px;
}

.sidebar-holographic-bg {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from var(--holo-angle, 0deg),
        #FFB3D9,
        #A3E8E0,
        #FFE4A0,
        #FFB3D9,
        #A3E8E0,
        #FFE4A0,
        #FFB3D9
    );
    mix-blend-mode: normal;
    will-change: transform;
    animation: holoSpin 8s linear infinite;
    opacity: 0.92;
}

@keyframes holoSpin {
    from { --holo-angle: 0deg; }
    to { --holo-angle: 360deg; }
}

/* Fallback for browsers that don't support @property */
@property --holo-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.sidebar-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 20px 0;
}

.sidebar-motif {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.sidebar-motif:hover {
    transform: scale(1.12);
}

.motif-icon {
    width: 32px;
    height: 32px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.sidebar-motif:hover .motif-icon {
    opacity: 1;
}

.sidebar-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3D2645;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.sidebar:hover .sidebar-label {
    opacity: 0.9;
    transform: translateX(0);
    writing-mode: horizontal-tb;
}

/* --- Mobile Navigation --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(255, 248, 240, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 10px 24px;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(61, 38, 69, 0.15);
}

.mobile-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #3D2645;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.mobile-nav-dot.active {
    background: #3D2645;
    transform: scale(1.2);
}

/* --- Main Content Area --- */
.main-content {
    margin-left: 72px;
    position: relative;
}

/* --- Opening Scene --- */
.opening-scene {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.opening-bg {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from 0deg at 50% 50%,
        #FFB3D9,
        #A3E8E0,
        #FFE4A0,
        #E8DFF5,
        #FFB3D9
    );
    opacity: 0.3;
    animation: bgRotate 12s linear infinite;
}

@keyframes bgRotate {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

.opening-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 12vw;
    letter-spacing: 0.06em;
    color: #3D2645;
    position: relative;
    z-index: 2;
    display: flex;
    overflow: hidden;
}

.letter {
    display: inline-block;
    opacity: 0;
}

.letter-a {
    animation: slideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

.letter-d {
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s forwards;
}

.letter-h {
    animation: scaleIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s forwards;
}

.letter-o {
    animation: rotateIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.9s forwards;
}

.letter-c {
    animation: drawIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s forwards;
}

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

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

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

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(360deg); }
    to { opacity: 1; transform: rotate(0deg); }
}

@keyframes drawIn {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 1; transform: scaleX(1); }
}

.opening-subtitle {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 3vw;
    color: #8B7E97;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 0.6s ease 1.9s forwards;
    border-bottom: 2px solid transparent;
    background-image: linear-gradient(90deg, #FFB3D9, #A3E8E0, #FFE4A0, #FFB3D9);
    background-size: 200% 2px;
    background-repeat: no-repeat;
    background-position: bottom;
    animation: fadeIn 0.6s ease 1.9s forwards, holoUnderline 3s linear 2.5s infinite;
}

@keyframes holoUnderline {
    from { background-position: bottom left 200%; }
    to { background-position: bottom left -200%; }
}

.sankofa-bird {
    position: absolute;
    bottom: 40px;
    right: 60px;
    width: 120px;
    height: 120px;
    z-index: 2;
}

.sankofa-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawPath 2.5s ease 1.5s forwards;
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

/* --- Panel Base Styles --- */
.panel {
    position: relative;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(42, 36, 56, 0.08), 0 2px 12px rgba(42, 36, 56, 0.04);
    overflow: hidden;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--panel-rotate, 0deg));
}

.panel-inner {
    position: relative;
    z-index: 2;
    padding: 60px 80px;
}

/* Panel Colors */
.panel-lavender {
    background-color: #E8DFF5;
    min-height: 80vh;
    margin-top: -60px;
    transform: rotate(-1.2deg);
    --panel-rotate: -1.2deg;
}

.panel-mint {
    background-color: #D5F0E8;
    min-height: 90vh;
    transform: rotate(0.8deg);
    --panel-rotate: 0.8deg;
}

.panel-rose {
    background-color: #F5DFE0;
    min-height: 70vh;
    transform: rotate(1.5deg);
    --panel-rotate: 1.5deg;
}

/* Panel Variants */
.panel-fullwidth {
    width: 100%;
}

.panel-inset {
    margin-left: 80px;
    margin-right: 80px;
}

/* Panel entrance animation */
.panel {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Typography --- */
.panel-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(36px, 5vw, 72px);
    letter-spacing: 0.06em;
    color: #3D2645;
    margin-bottom: 32px;
    line-height: 1.15;
}

.panel-heading-center {
    text-align: center;
}

.panel-subheading {
    font-family: 'Spectral', serif;
    font-weight: 500;
    font-size: clamp(20px, 2.5vw, 32px);
    color: #7FBFB8;
    text-align: center;
    margin-bottom: 48px;
    font-style: italic;
}

.panel-body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #2A2438;
    max-width: 640px;
    margin-bottom: 24px;
}

.panel-body em {
    font-style: italic;
    color: #C4869B;
}

/* --- Panel 1: Collage Layout --- */
.panel-lavender .panel-inner {
    display: flex;
    align-items: flex-start;
    gap: 60px;
}

.panel-text {
    flex: 1;
    min-width: 0;
}

.panel-collage {
    flex: 0 0 40%;
    position: relative;
    min-height: 400px;
}

.collage-photo {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #E8DFF5 0%, #D5F0E8 50%, #F5DFE0 100%);
    filter: saturate(0.3);
    border-radius: 3px;
    position: relative;
}

.collage-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(232, 223, 245, 0.4);
    mix-blend-mode: overlay;
}

.collage-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.celtic-spiral,
.celtic-spiral-2,
.celtic-spiral-3 {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease;
}

.panel-lavender.visible .celtic-spiral,
.panel-lavender.visible .celtic-spiral-2,
.panel-lavender.visible .celtic-spiral-3 {
    stroke-dashoffset: 0;
}

.panel-lavender.visible .celtic-spiral-2 {
    transition-delay: 0.3s;
}

.panel-lavender.visible .celtic-spiral-3 {
    transition-delay: 0.6s;
}

/* --- Interstitial Zones --- */
.interstitial {
    height: 200px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.interstitial-bg {
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        #FFB3D9 0%,
        #A3E8E0 33%,
        #FFE4A0 66%,
        #FFB3D9 100%
    );
    opacity: 0.35;
    animation: interstitialRotate 15s linear infinite;
}

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

/* Holographic Stickers */
.holo-sticker {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        from 0deg,
        #FFB3D9,
        #A3E8E0,
        #FFE4A0,
        #FFB3D9
    );
    filter: brightness(1.1) contrast(1.05);
    will-change: transform;
    animation: holoShimmer 8s linear infinite;
}

@keyframes holoShimmer {
    from { filter: brightness(1.1) contrast(1.05) hue-rotate(0deg); }
    to { filter: brightness(1.1) contrast(1.05) hue-rotate(360deg); }
}

.holo-sticker svg {
    width: 36px;
    height: 36px;
}

.sticker-1 {
    top: 30px;
    left: 15%;
}

.sticker-2 {
    top: 60px;
    left: 48%;
}

.sticker-3 {
    top: 20px;
    right: 15%;
}

.sticker-4 {
    top: 40px;
    left: 25%;
}

.sticker-5 {
    top: 50px;
    right: 30%;
}

/* --- Panel 2: Motifs Grid --- */
.motifs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.motif-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: transform 0.4s ease;
    cursor: default;
}

.motif-card:hover {
    transform: scale(1.08);
}

.motif-card:hover .cultural-motif {
    filter: hue-rotate(15deg) drop-shadow(0 0 6px currentColor);
}

.motif-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.motif-circle-lavender { background: rgba(232, 223, 245, 0.7); }
.motif-circle-rose { background: rgba(245, 223, 224, 0.7); }
.motif-circle-mint { background: rgba(213, 240, 232, 0.7); }
.motif-circle-butter { background: #FFF3D6; }

.cultural-motif {
    width: 64px;
    height: 64px;
    transition: filter 0.4s ease;
}

.motif-name {
    font-family: 'Spectral', serif;
    font-weight: 500;
    font-size: 20px;
    color: #3D2645;
    font-style: italic;
}

.motif-origin {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: #8B7E97;
}

/* --- Panel 3: Text with Washi Tape --- */
.text-section {
    max-width: 700px;
}

.washi-tape {
    position: relative;
    margin: 36px -20px;
    padding: 18px 28px;
    height: auto;
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.panel-rose.visible .washi-tape {
    opacity: 1;
    transform: translateX(0);
}

.panel-rose.visible .washi-tape-2 {
    transition-delay: 0.1s;
}

.washi-tape::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.5;
    clip-path: polygon(0% 8%, 3% 0%, 8% 6%, 14% 1%, 20% 5%, 27% 0%, 33% 4%, 40% 1%, 46% 7%, 53% 0%, 59% 3%, 65% 0%, 72% 6%, 78% 1%, 84% 5%, 90% 0%, 95% 4%, 100% 0%, 100% 92%, 97% 100%, 92% 94%, 86% 99%, 80% 95%, 73% 100%, 67% 96%, 60% 99%, 54% 93%, 47% 100%, 41% 97%, 35% 100%, 28% 94%, 22% 99%, 16% 95%, 10% 100%, 5% 96%, 0% 100%);
    z-index: -1;
}

.washi-tape-1::before {
    background: #F5DFE0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(196, 134, 155, 0.15) 10px, rgba(196, 134, 155, 0.15) 12px);
}

.washi-tape-2::before {
    background: #E8DFF5;
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(127, 191, 184, 0.15) 10px, rgba(127, 191, 184, 0.15) 12px);
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    font-size: 24px;
    line-height: 1.5;
    color: #C4869B;
}

/* --- Closing Scene --- */
.closing-scene {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.closing-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #FFF8F0 0%, #E8DFF5 50%, #D5F0E8 100%);
    opacity: 0.5;
}

.closing-mandala {
    position: relative;
    width: 320px;
    height: 320px;
    z-index: 2;
    margin-bottom: 48px;
}

.mandala-motif {
    position: absolute;
    width: 70px;
    height: 70px;
    opacity: 0;
    transition: opacity 1s ease, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.closing-scene.visible .mandala-motif {
    opacity: 1;
}

.mandala-motif-1 {
    top: 0;
    left: 50%;
    transform: translate(-50%, 50px) rotate(0deg);
}

.closing-scene.visible .mandala-motif-1 {
    transform: translate(-50%, 0) rotate(0deg);
    animation: mandalaOrbit 20s linear 1s infinite;
}

.mandala-motif-2 {
    top: 25%;
    right: 0;
    transform: translate(-50px, 0) rotate(60deg);
}

.closing-scene.visible .mandala-motif-2 {
    transform: translate(0, 0) rotate(60deg);
    animation: mandalaOrbit 20s linear 1.3s infinite reverse;
}

.mandala-motif-3 {
    bottom: 25%;
    right: 5%;
    transform: translate(-50px, 50px) rotate(120deg);
}

.closing-scene.visible .mandala-motif-3 {
    transform: translate(0, 0) rotate(120deg);
    animation: mandalaOrbit 20s linear 1.6s infinite;
}

.mandala-motif-4 {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, -50px) rotate(180deg);
}

.closing-scene.visible .mandala-motif-4 {
    transform: translate(-50%, 0) rotate(180deg);
    animation: mandalaOrbit 20s linear 1.9s infinite reverse;
}

.mandala-motif-5 {
    bottom: 25%;
    left: 0;
    transform: translate(50px, 50px) rotate(240deg);
}

.closing-scene.visible .mandala-motif-5 {
    transform: translate(0, 0) rotate(240deg);
    animation: mandalaOrbit 20s linear 2.2s infinite;
}

.mandala-motif-6 {
    top: 25%;
    left: 5%;
    transform: translate(50px, 0) rotate(300deg);
}

.closing-scene.visible .mandala-motif-6 {
    transform: translate(0, 0) rotate(300deg);
    animation: mandalaOrbit 20s linear 2.5s infinite reverse;
}

@keyframes mandalaOrbit {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

.closing-text {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 18px;
    color: #8B7E97;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 1.2s ease 0.5s;
}

.closing-scene.visible .closing-text {
    opacity: 1;
}

/* --- Sidebar Pulse on Closing --- */
.sidebar.pulse .sidebar-holographic-bg {
    animation: holoSpin 8s linear infinite, sidebarPulse 1.5s ease-in-out;
}

@keyframes sidebarPulse {
    0% { opacity: 0.92; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.4) saturate(1.3); }
    100% { opacity: 0.92; filter: brightness(1); }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        width: 8px;
        pointer-events: none;
    }

    .sidebar:hover {
        width: 8px;
    }

    .sidebar-content {
        display: none;
    }

    .sidebar-holographic-bg {
        opacity: 0.6;
    }

    .mobile-nav {
        display: flex;
    }

    .main-content {
        margin-left: 8px;
    }

    .opening-title {
        font-size: 18vw;
    }

    .opening-subtitle {
        font-size: 5vw;
    }

    .panel {
        transform: none !important;
    }

    .panel.visible {
        transform: translateY(0) !important;
    }

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

    .panel-lavender .panel-inner {
        flex-direction: column;
    }

    .panel-collage {
        flex: none;
        width: 100%;
        min-height: 250px;
    }

    .panel-inset {
        margin-left: 12px;
        margin-right: 12px;
    }

    .motifs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .motif-circle {
        width: 90px;
        height: 90px;
    }

    .cultural-motif {
        width: 48px;
        height: 48px;
    }

    .panel-heading {
        font-size: clamp(28px, 6vw, 48px);
    }

    .panel-body {
        font-size: 16px;
    }

    .pull-quote {
        font-size: 20px;
    }

    .closing-mandala {
        width: 240px;
        height: 240px;
    }

    .mandala-motif {
        width: 50px;
        height: 50px;
    }

    .sankofa-bird {
        width: 80px;
        height: 80px;
        right: 20px;
        bottom: 20px;
    }

    .holo-sticker {
        width: 48px;
        height: 48px;
    }

    .holo-sticker svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .motifs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .opening-title {
        font-size: 22vw;
    }
}
