/* ============================================
   mujun.wiki - Neomorphic Horizontal Gallery
   ============================================ */
:root {
    --sandstone: #F2E6D9;
    --sunlit-cream: #FFF8F0;
    --terracotta-shade: #C4A882;
    --dusk-umber: #3D2B1F;
    --sunset-coral: #E07A5F;
    --twilight-plum: #6B3A5B;
    --golden-hour: #F4A261;
    --dusk-rose: #D4726A;
    --neo-light: -8px -8px 20px #FFF8F0;
    --neo-dark: 8px 8px 20px #C4A882;
    --neo-inset-light: inset -4px -4px 12px #FFF8F0;
    --neo-inset-dark: inset 4px 4px 12px #C4A882;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    background: var(--sandstone);
    color: var(--dusk-umber);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.8;
    letter-spacing: 0.01em;
    overflow: hidden;
    height: 100vh;
}

/* --- Progress Bar --- */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--sunset-coral);
    z-index: 100;
    transition: width 0.1s linear;
}

/* --- Panel Counter --- */
.panel-counter {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dusk-umber);
    opacity: 0.6;
    z-index: 100;
}

/* --- Horizontal Gallery --- */
.gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }

/* --- Panel Base --- */
.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    padding: clamp(2rem, 4vw, 4rem);
    overflow: hidden;
}

/* --- Herringbone Background --- */
.herringbone-bg {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent 0px,
        transparent 3px,
        rgba(196, 168, 130, 0.08) 3px,
        rgba(196, 168, 130, 0.08) 4px
    );
    background-size: 8px 8px;
    pointer-events: none;
    animation: herringboneDrift 60s linear infinite;
}
@keyframes herringboneDrift {
    0% { background-position: 0 0; }
    100% { background-position: -200px 0; }
}

/* --- Neomorphic Card --- */
.neo-card {
    background: var(--sandstone);
    border-radius: 24px;
    box-shadow: var(--neo-light), var(--neo-dark);
    padding: clamp(2rem, 4vw, 3.5rem);
    transition: box-shadow 600ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 600ms ease, transform 600ms ease;
    opacity: 0;
    transform: translateY(20px);
}
.neo-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Meta Label --- */
.meta-label {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dusk-umber);
    opacity: 0.6;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Typography --- */
.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--dusk-umber);
    margin-bottom: 0.8rem;
}
.hero-sub {
    font-family: 'Source Serif 4', serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--dusk-umber);
    opacity: 0.7;
}
.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--dusk-umber);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.section-heading.visible { opacity: 1; transform: translateY(0); }
.card-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    letter-spacing: 0;
    line-height: 1.3;
    color: var(--dusk-umber);
    margin-bottom: 0.8rem;
}
.card-body {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.8;
    color: var(--dusk-umber);
    margin-bottom: 1rem;
}

/* --- Dotted Divider --- */
.dotted-divider {
    display: flex;
    gap: 12px;
    margin: 1.5rem 0;
    justify-content: flex-start;
}
.dotted-divider::before {
    content: '● ● ● ● ● ● ● ● ●';
    font-size: 4px;
    letter-spacing: 8px;
    color: var(--terracotta-shade);
}

/* --- Scroll Hint --- */
.scroll-hint {
    position: absolute;
    bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: hintPulse 2s ease-in-out infinite;
}
.scroll-hint svg {
    transform: rotate(-90deg);
}
@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 0.8; transform: translateX(5px); }
}
.hint-text {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sunset-coral);
}

/* --- Zigzag Border --- */
.zigzag-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 16px;
    background: linear-gradient(135deg, var(--sunset-coral) 25%, transparent 25%) -8px 0,
                linear-gradient(225deg, var(--sunset-coral) 25%, transparent 25%) -8px 0,
                linear-gradient(315deg, var(--sunset-coral) 25%, transparent 25%),
                linear-gradient(45deg, var(--sunset-coral) 25%, transparent 25%);
    background-size: 16px 16px;
    opacity: 0.15;
}

/* ============================
   PANEL 1: ENTRANCE
   ============================ */
.neo-card--hero {
    max-width: 600px;
    text-align: center;
}

/* ============================
   PANEL 2: READING ROOM
   ============================ */
.reading-cards {
    display: flex;
    gap: 3rem;
    max-width: 900px;
}
.neo-card--tilted-left {
    transform: rotate(-2deg) translateY(20px);
    max-width: 400px;
}
.neo-card--tilted-left.visible {
    transform: rotate(-2deg) translateY(0);
}
.neo-card--tilted-right {
    transform: rotate(2deg) translateY(20px);
    max-width: 400px;
    margin-top: 3rem;
}
.neo-card--tilted-right.visible {
    transform: rotate(2deg) translateY(0);
}

/* ============================
   PANEL 3: CARD CATALOG
   ============================ */
.panel-catalog {
    padding: clamp(2rem, 4vw, 4rem);
}
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 900px;
}
.flip-card {
    perspective: 1200px;
    aspect-ratio: 1 / 1.4;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.flip-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.flip-card:hover .flip-inner,
.flip-card.flipped .flip-inner {
    transform: rotateY(180deg);
}
.flip-front, .flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.flip-front {
    background: var(--sandstone);
    box-shadow: var(--neo-light), var(--neo-dark);
    border: 2px inset var(--terracotta-shade);
}
.flip-back {
    background: var(--sunset-coral);
    transform: rotateY(180deg);
    border: 4px solid var(--twilight-plum);
}
.flip-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    color: var(--dusk-umber);
}
.flip-content {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.6;
    color: var(--sunlit-cream);
    text-align: center;
}

/* ============================
   PANEL 4: EXHIBITION
   ============================ */
.neo-card--exhibition {
    max-width: 800px;
    width: 80%;
    padding: 0;
    overflow: hidden;
}
.exhibition-photo {
    height: 40%;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}
.photo-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(175deg, var(--dusk-umber) 0%, var(--terracotta-shade) 40%, var(--golden-hour) 70%, var(--sandstone) 100%);
    filter: sepia(15%) saturate(120%) brightness(105%);
}
.photo-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(244, 162, 97, 0.25), transparent 60%);
    mix-blend-mode: multiply;
}
.exhibition-text {
    padding: clamp(1.5rem, 3vw, 3rem);
}

/* ============================
   PANEL 5: WORKSHOP
   ============================ */
.panel-workshop {
    align-items: center;
}
.workshop-strips {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    width: 100%;
}
.workshop-strip {
    border-radius: 16px;
    padding: 1.5rem 2rem;
}
.strip-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dusk-umber);
    margin-bottom: 0.5rem;
}
.strip-text {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.7;
    color: var(--dusk-umber);
    opacity: 0.85;
}

/* ============================
   PANEL 6: SUNSET TERRACE
   ============================ */
.panel-terrace {
    background: linear-gradient(135deg, var(--dusk-rose) 0%, var(--twilight-plum) 100%);
}
.terrace-content {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}
.terrace-content.visible {
    opacity: 1;
    transform: translateY(0);
}
.terrace-text {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--sunlit-cream);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}
.terrace-content .meta-label {
    color: var(--sunlit-cream);
    opacity: 0.5;
    margin-top: 2rem;
}
.neo-btn {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sunlit-cream);
    background: transparent;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: -6px -6px 16px rgba(255, 248, 240, 0.15), 6px 6px 16px rgba(107, 58, 91, 0.4);
    transition: box-shadow 0.3s ease, transform 0.15s ease;
}
.neo-btn:hover {
    box-shadow: var(--neo-inset-light), var(--neo-inset-dark);
}
.neo-btn:active {
    transform: scale(0.98);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
    .reading-cards { flex-direction: column; gap: 1.5rem; }
    .neo-card--tilted-left, .neo-card--tilted-right { max-width: 100%; }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .neo-card--exhibition { width: 95%; }
}
