/* heisei.boo - Digital Archaeology of a Lost Era */

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

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

body {
    background: #0A0A0A;
    color: #B0B0B0;
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* Film Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.05;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Glitch Container */
.glitch-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 90;
}

.glitch-band {
    position: absolute;
    left: 0;
    width: 100%;
    opacity: 0.15;
    transition: opacity 50ms;
}

/* Cultural Motif Icons */
.motif-icon {
    position: absolute;
    opacity: 0.18;
    pointer-events: none;
    z-index: 1;
}

/* The Excavation Site */
.section-excavation {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0A0A;
}

/* Collage Frames */
.collage-frame {
    position: absolute;
    border: 1px solid #B0B0B0;
    opacity: 0;
    transition: opacity 150ms ease;
}

.frame-1 { width: 180px; height: 240px; top: 10%; left: 5%; transform: rotate(-3deg); z-index: 1; }
.frame-2 { width: 160px; height: 120px; top: 15%; right: 10%; transform: rotate(2deg); z-index: 2; }
.frame-3 { width: 140px; height: 200px; bottom: 20%; left: 15%; transform: rotate(5deg); z-index: 3; }
.frame-4 { width: 200px; height: 80px; bottom: 25%; right: 20%; transform: rotate(-1deg); z-index: 2; }
.frame-5 { width: 120px; height: 160px; top: 40%; left: 60%; transform: rotate(3deg); z-index: 1; }

.collage-frame.visible { opacity: 1; }

/* Frame Patterns */
.frame-pattern { width: 100%; height: 100%; }

.pattern-stripes {
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(176, 176, 176, 0.1) 4px, rgba(176, 176, 176, 0.1) 5px);
}
.pattern-stripes-v {
    background: repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(176, 176, 176, 0.08) 6px, rgba(176, 176, 176, 0.08) 7px);
}
.pattern-dots {
    background: radial-gradient(circle, rgba(176, 176, 176, 0.15) 1px, transparent 1px);
    background-size: 8px 8px;
}
.pattern-crosshatch {
    background:
        repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(176, 176, 176, 0.08) 4px, rgba(176, 176, 176, 0.08) 5px),
        repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(176, 176, 176, 0.08) 4px, rgba(176, 176, 176, 0.08) 5px);
}

.frame-label {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: #909090;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    letter-spacing: 0.08em;
}

/* Excavation Title */
.excavation-title-wrap {
    position: relative;
    z-index: 10;
    text-align: center;
}

.site-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 52px;
    color: #FFFFFF;
    line-height: 1.1;
    transform: rotate(-2deg);
    opacity: 0;
}

.site-title.visible { opacity: 1; }

.heisei-fragments { position: relative; }

.jp-fragment {
    font-family: 'Noto Serif JP', serif;
    font-size: 14px;
    color: #B0B0B0;
    position: absolute;
    opacity: 0;
    transition: opacity 300ms ease;
}
.jp-fragment.visible { opacity: 0.6; }

/* Artifact Gallery */
.section-gallery {
    position: relative;
    padding: 80px 24px;
    min-height: 300vh;
}

.artifact-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px 16px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Artifact Cards */
.artifact-card {
    border: 1px solid #B0B0B0;
    padding: 24px;
    position: relative;
    background: rgba(10, 10, 10, 0.9);
    transition: transform 200ms ease, border-color 200ms ease, z-index 0ms, box-shadow 200ms ease;
    overflow: hidden;
}

.card-1 { transform: rotate(-1deg); z-index: 2; }
.card-2 { transform: rotate(1.5deg); z-index: 3; }
.card-3 { transform: rotate(-0.5deg); z-index: 4; }
.card-4 { transform: rotate(2deg); z-index: 1; }
.card-5 { transform: rotate(-1.5deg); z-index: 5; }
.card-6 { transform: rotate(0.5deg); z-index: 2; }
.card-7 { transform: rotate(-2deg); z-index: 6; }
.card-8 { transform: rotate(1deg); z-index: 3; }

.artifact-card:hover {
    z-index: 10;
    border-color: #FFFFFF;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
}

.card-label {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: #909090;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 12px;
}

.card-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 12px;
}

.card-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 8px;
}

.card-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 15px;
    color: #B0B0B0;
    line-height: 1.75;
    margin-bottom: 8px;
}

.card-annotation {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: #707070;
    display: block;
    margin-top: 12px;
}

/* Hover glitch effect inside card */
.artifact-card::after {
    content: '';
    position: absolute;
    left: 0; width: 100%;
    height: 2px;
    background: #FF3B3B;
    opacity: 0;
    transition: opacity 100ms;
    top: 50%;
}
.artifact-card:hover::after {
    opacity: 0.5;
    top: calc(30% + var(--glitch-offset, 0px));
}

/* Glitch Archive */
.section-glitch-archive {
    position: relative;
    padding: 120px 24px;
    min-height: 100vh;
    overflow: hidden;
}

.glitch-archive-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.archive-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: 24px;
}

.archive-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 15px;
    color: #B0B0B0;
    line-height: 1.75;
    margin-bottom: 20px;
}

/* Static glitch bands */
.glitch-band-static {
    position: absolute;
    left: 0; width: 100%;
    pointer-events: none;
    animation: glitchPulse 2s ease-in-out infinite;
}

.gb-1 { top: 15%; height: 6px; background: #FF3B3B; opacity: 0.2; animation-delay: 0s; }
.gb-2 { top: 35%; height: 4px; background: #00E5FF; opacity: 0.15; animation-delay: 0.7s; }
.gb-3 { top: 60%; height: 8px; background: #FFE500; opacity: 0.12; animation-delay: 1.3s; }
.gb-4 { top: 82%; height: 5px; background: #FF3B3B; opacity: 0.18; animation-delay: 0.4s; }

@keyframes glitchPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.4; }
}

/* The Moss Floor */
.section-moss {
    position: relative;
    padding: 120px 24px;
    min-height: 100vh;
    background: #0D0F0A;
}

.section-moss .grain-overlay { opacity: 0.08; }

.moss-content {
    max-width: 600px;
    margin: 0 auto;
}

.moss-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: 24px;
}

.moss-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 15px;
    color: #B0B0B0;
    line-height: 1.75;
    margin-bottom: 20px;
}

.moss-annotation {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: #707070;
    display: block;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-title { font-size: 36px; }
    .artifact-grid { grid-template-columns: 1fr; }
    .artifact-card { grid-column: 1 !important; grid-row: auto !important; }
    .section-gallery { padding: 40px 16px; }
    .collage-frame { display: none; }
}
