/* === daitoua.quest - Blobitecture Historical Exhibit === */
/* Duotone: #1A2838 (Ocean Ink) + #C87040 (Amber Clay) */
/* Full palette: #0E1820, #1A2838, #C87040, #E09050, #F0E8E0, #A08A70 */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0E1820;
    color: #F0E8E0;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION - Glassmorphic Topic Pills
   ============================================ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(14, 24, 32, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(200, 112, 64, 0.08);
}

.nav-pills {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #A08A70;
    text-decoration: none;
    padding: 7px 20px;
    border-radius: 24px;
    border: 1px solid rgba(200, 112, 64, 0.15);
    background: rgba(200, 112, 64, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.pill.active {
    color: #F0E8E0;
    background: rgba(200, 112, 64, 0.15);
    border-color: rgba(200, 112, 64, 0.35);
    box-shadow: 0 0 12px rgba(200, 112, 64, 0.1);
}

.pill:hover {
    color: #E09050;
    border-color: rgba(200, 112, 64, 0.3);
    background: rgba(200, 112, 64, 0.08);
}

/* ============================================
   HERO / QUEST PORTAL (100vh)
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Duotone background with mix-blend-mode */
.duotone-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.duotone-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.duotone-dark {
    background: radial-gradient(ellipse at 30% 40%, #1A2838 0%, #0E1820 70%);
}

.duotone-warm {
    background: radial-gradient(ellipse at 70% 60%, #C87040 0%, transparent 50%);
    mix-blend-mode: soft-light;
    opacity: 0.6;
}

/* Hero blob SVG background */
.hero-blob-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Portal: circle-to-blob morph */
.hero-portal {
    position: relative;
    z-index: 10;
    width: 60vw;
    max-width: 620px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 1.5s cubic-bezier(0.23, 1, 0.32, 1),
                transform 1.5s cubic-bezier(0.23, 1, 0.32, 1),
                border-radius 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-portal.visible {
    opacity: 1;
    transform: scale(1);
    border-radius: 42% 58% 53% 47% / 52% 43% 57% 48%;
}

/* Glassmorphic portal interior */
.portal-glass {
    width: 100%;
    padding: 64px 48px;
    text-align: center;
    background: rgba(200, 112, 64, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 112, 64, 0.15);
    border-radius: inherit;
    box-shadow: 0 16px 64px rgba(14, 24, 32, 0.4),
                inset 0 1px 0 rgba(240, 232, 224, 0.03);
    transition: border-color 1.5s ease, background 1.5s ease;
}

.hero-portal.visible .portal-glass {
    border-color: rgba(200, 112, 64, 0.2);
    background: rgba(200, 112, 64, 0.1);
}

/* Kanji title */
.portal-kanji {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: clamp(3rem, 7vw, 5rem);
    color: #F0E8E0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(14, 24, 32, 0.5);
}

.portal-kanji.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Domain title with scatter animation */
.portal-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #C87040;
    margin-bottom: 16px;
    display: inline-block;
}

.scatter-char {
    display: inline-block;
    opacity: 0;
    transform: translate(
        calc((var(--rx, 0) - 0.5) * 20px),
        calc((var(--ry, 0) - 0.5) * 20px)
    );
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: calc(var(--i) * 0.06s);
}

.scatter-char.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Subtitle */
.portal-sub {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: #A08A70;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
    letter-spacing: 0.02em;
}

.portal-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   MOSAIC STRIP (Hero bottom + Footer top)
   ============================================ */
.mosaic-strip {
    position: absolute;
    left: 0;
    width: 100%;
    height: 32px;
    overflow: hidden;
}

.hero-mosaic {
    bottom: 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(200, 112, 64, 0.05) 0px,
            rgba(200, 112, 64, 0.05) 8px,
            rgba(200, 112, 64, 0.10) 8px,
            rgba(200, 112, 64, 0.10) 16px,
            rgba(200, 112, 64, 0.15) 16px,
            rgba(200, 112, 64, 0.15) 24px,
            rgba(200, 112, 64, 0.05) 24px,
            rgba(200, 112, 64, 0.05) 32px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(26, 40, 56, 0.3) 8px,
            rgba(26, 40, 56, 0.3) 9px
        );
    mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}

.footer-mosaic {
    position: relative;
    height: 32px;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(200, 112, 64, 0.05) 0px,
            rgba(200, 112, 64, 0.05) 8px,
            rgba(200, 112, 64, 0.10) 8px,
            rgba(200, 112, 64, 0.10) 16px,
            rgba(200, 112, 64, 0.15) 16px,
            rgba(200, 112, 64, 0.15) 24px,
            rgba(200, 112, 64, 0.05) 24px,
            rgba(200, 112, 64, 0.05) 32px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(26, 40, 56, 0.3) 8px,
            rgba(26, 40, 56, 0.3) 9px
        );
    mask-image: linear-gradient(to top, transparent, black 30%, black 70%, transparent);
    -webkit-mask-image: linear-gradient(to top, transparent, black 30%, black 70%, transparent);
}

/* ============================================
   MORPH BLOBS (Background animation)
   ============================================ */
.morph-blob {
    transform-origin: center center;
}

.blob-1 {
    animation: blobMorph1 15s ease-in-out infinite alternate;
}

.blob-2 {
    animation: blobMorph2 18s ease-in-out infinite alternate;
}

.blob-3 {
    animation: blobMorph3 20s ease-in-out infinite alternate;
}

.blob-4 {
    animation: blobMorph2 14s ease-in-out infinite alternate;
}

.blob-5 {
    animation: blobMorph1 17s ease-in-out infinite alternate;
}

.blob-6 {
    animation: blobMorph3 13s ease-in-out infinite alternate;
}

@keyframes blobMorph1 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    25%  { transform: translate(12px, -18px) scale(1.06) rotate(2deg); }
    50%  { transform: translate(-6px, 8px) scale(0.97) rotate(-1deg); }
    75%  { transform: translate(8px, -4px) scale(1.03) rotate(1.5deg); }
    100% { transform: translate(-10px, 14px) scale(0.98) rotate(-2deg); }
}

@keyframes blobMorph2 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    25%  { transform: translate(-14px, 10px) scale(0.95) rotate(-2deg); }
    50%  { transform: translate(16px, -12px) scale(1.05) rotate(1deg); }
    75%  { transform: translate(-8px, 16px) scale(0.99) rotate(-1.5deg); }
    100% { transform: translate(6px, -8px) scale(1.02) rotate(2deg); }
}

@keyframes blobMorph3 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    25%  { transform: translate(10px, 12px) scale(1.04) rotate(1.5deg); }
    50%  { transform: translate(-14px, -6px) scale(0.96) rotate(-2deg); }
    75%  { transform: translate(4px, -14px) scale(1.01) rotate(0.5deg); }
    100% { transform: translate(-8px, 10px) scale(1.05) rotate(-1deg); }
}

/* ============================================
   EXHIBIT / MAIN CONTENT AREA
   ============================================ */
#exhibit {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

.bg-blobs {
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Connection Lines SVG overlay */
.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

.conn-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.conn-line.drawn {
    stroke-dashoffset: 0;
}

.conn-dot {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.conn-dot.drawn {
    opacity: 0.4;
}

/* ============================================
   EXHIBIT SECTIONS
   ============================================ */
.exhibit-section {
    margin-bottom: 72px;
    position: relative;
    z-index: 3;
}

/* ============================================
   MASONRY GRID
   ============================================ */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* ============================================
   GLASSMORPHIC CARDS
   ============================================ */
.glass-card {
    background: rgba(200, 112, 64, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(200, 112, 64, 0.15);
    border-radius: 50%;
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(14, 24, 32, 0.3);
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                border-radius 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.3s ease,
                background 0.3s ease,
                box-shadow 0.3s ease;
}

.glass-card.visible {
    opacity: 1;
    transform: scale(1);
    border-radius: 32px;
}

.glass-card:hover {
    border-color: rgba(200, 112, 64, 0.3);
    background: rgba(200, 112, 64, 0.12);
    box-shadow: 0 12px 40px rgba(14, 24, 32, 0.35),
                0 0 20px rgba(200, 112, 64, 0.05);
}

/* Card size variants */
.glass-card.small {
    min-height: 200px;
}

.glass-card.medium {
    min-height: 280px;
}

.glass-card.large {
    min-height: 350px;
    grid-column: span 2;
}

/* Conflict section glow */
.conflict-glow {
    box-shadow: 0 8px 32px rgba(14, 24, 32, 0.3),
                inset 0 0 40px rgba(200, 112, 64, 0.06);
}

.conflict-glow:hover {
    box-shadow: 0 12px 40px rgba(14, 24, 32, 0.35),
                inset 0 0 50px rgba(200, 112, 64, 0.1),
                0 0 24px rgba(200, 112, 64, 0.08);
}

/* Card internal elements */
.card-date {
    display: inline-block;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: #A08A70;
    margin-bottom: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(200, 112, 64, 0.06);
    border: 1px solid rgba(200, 112, 64, 0.1);
}

.glass-card h2 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #F0E8E0;
    margin-bottom: 14px;
    text-shadow: 0 2px 8px rgba(14, 24, 32, 0.4);
    line-height: 1.3;
}

.glass-card p {
    color: rgba(240, 232, 224, 0.9);
    margin-bottom: 12px;
}

.glass-card p:last-child {
    margin-bottom: 0;
}

/* Subtle glow line at card top */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 112, 64, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.glass-card.visible::before {
    opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
    padding: 0;
    border-top: 1px solid rgba(200, 112, 64, 0.06);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
}

.footer-brand {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 14px;
    color: #C87040;
}

.footer-sep {
    color: rgba(200, 112, 64, 0.3);
    font-size: 18px;
}

.footer-meta {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: #A08A70;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .glass-card.large {
        grid-column: span 2;
    }
    .hero-portal {
        width: 70vw;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }
    .glass-card.large {
        grid-column: span 1;
    }
    .hero-portal {
        width: 90vw;
        max-width: none;
        min-height: 260px;
    }
    .portal-glass {
        padding: 40px 24px;
    }
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
    .footer-sep {
        display: none;
    }
    .nav-pills {
        gap: 8px;
    }
    #exhibit {
        padding: 48px 16px 80px;
    }
    .exhibit-section {
        margin-bottom: 48px;
    }
    .glass-card {
        padding: 24px 20px;
    }
}
