/* ============================================
   algoha.com — Investigative Dossier Styles
   ============================================ */

/* === PALETTE ===
   Parchment Base:     #f5eed6
   Ink Dark:           #1a1008
   Evidence Sepia:     #c4a66a
   Redaction Black:    #0d0a06
   Verdict Crimson:    #8b0000
   Annotation Umber:   #5a4a3a
   Exposed Truth Teal: #1a6b5a
   Archive Dust:       #b8a994
   Manila Folder:      #d4b483
   Body Dark:          #2c2416
   Parchment Alt:      #e8dcc8
*/

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 17px;
    line-height: 1.72;
    color: #2c2416;
    background-color: #1a1008;
    overflow-x: hidden;
}

/* === MICROFILM GRAIN OVERLAY === */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* === CASE NAVIGATION (Left sidebar) === */
#case-nav {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#case-nav .nav-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: #c4a66a;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-bottom: 12px;
    opacity: 0.7;
}

.nav-item {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #5a4a3a;
    background: rgba(26, 16, 8, 0.85);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item::before,
.nav-item::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 1px;
    background: #5a4a3a;
}

.nav-item::before {
    left: -5px;
    top: 50%;
}

.nav-item::after {
    right: -5px;
    top: 50%;
}

.nav-item.active {
    border-color: #c4a66a;
    background: rgba(196, 166, 106, 0.15);
}

.nav-item.active .frame-number {
    color: #c4a66a;
}

.frame-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: #5a4a3a;
    transition: color 0.3s ease;
}

/* === HERO SECTION === */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #1a1008;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.desk-lamp-light {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 80vw;
    height: 80vh;
    background: radial-gradient(ellipse at center, rgba(245, 238, 214, 0.12) 0%, rgba(245, 238, 214, 0.05) 30%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1s ease, transform 1.5s ease;
    pointer-events: none;
}

.desk-lamp-light.on {
    opacity: 1;
}

.desk-lamp-light.expanded {
    transform: scale(2.5);
    opacity: 1;
    background: radial-gradient(ellipse at center, rgba(245, 238, 214, 0.08) 0%, rgba(245, 238, 214, 0.03) 40%, transparent 70%);
}

/* Manila Folder */
#manila-folder {
    position: absolute;
    width: 420px;
    max-width: 85vw;
    transform: rotate(-1.5deg);
    opacity: 0;
    transition: opacity 0.6s ease 0.4s;
    z-index: 10;
}

#manila-folder.visible {
    opacity: 1;
}

#manila-folder.opened .folder-flap {
    transform: perspective(600px) rotateX(-160deg);
    opacity: 0.3;
}

#manila-folder.opened .folder-body {
    opacity: 0.2;
    transform: scale(0.95);
}

.folder-flap {
    background: #d4b483;
    height: 60px;
    border-radius: 8px 8px 0 0;
    position: relative;
    transform-origin: top center;
    transform: perspective(600px) rotateX(0deg);
    transition: transform 0.6s ease-out, opacity 0.6s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    box-shadow: 0 2px 8px rgba(26, 16, 8, 0.3);
}

.folder-label {
    font-family: 'Special Elite', monospace;
    font-size: 14px;
    color: #5a4a3a;
    letter-spacing: 0.05em;
}

.folder-body {
    background: #d4b483;
    height: 280px;
    border-radius: 0 0 4px 4px;
    position: relative;
    transition: opacity 0.8s ease, transform 0.8s ease;
    box-shadow: 0 4px 16px rgba(26, 16, 8, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.classified-stamp {
    font-family: 'Special Elite', monospace;
    font-size: 42px;
    color: #8b0000;
    transform: rotate(-8deg);
    opacity: 0.85;
    text-align: center;
    line-height: 1.1;
    filter: url(#stamp-distress);
    text-shadow: 1px 1px 0 rgba(139, 0, 0, 0.3);
    border: 3px solid #8b0000;
    padding: 10px 24px;
    position: relative;
}

.classified-stamp span {
    font-size: 18px;
    letter-spacing: 0.3em;
    display: block;
    margin-top: 4px;
}

/* Hero Document */
#hero-document {
    position: relative;
    z-index: 20;
    text-align: center;
    padding: 0 24px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#hero-document.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #f5eed6;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 24px;
    overflow: hidden;
}

#hero-headline .char {
    display: inline-block;
    opacity: 0;
}

#hero-headline .char.typed {
    opacity: 1;
}

.hero-subtitle {
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    font-weight: 400;
    color: #e8dcc8;
    margin-bottom: 8px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

.hero-subtitle-en {
    font-family: 'Source Serif 4', serif;
    font-size: 15px;
    font-weight: 400;
    color: #b8a994;
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 0.8s ease 0.2s;
}

.hero-subtitle-en.visible {
    opacity: 1;
}

.scroll-indicator {
    margin-top: 48px;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.bebas-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #c4a66a;
}

.scroll-arrow {
    width: 1px;
    height: 40px;
    background: #c4a66a;
    margin: 12px auto 0;
    position: relative;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    width: 9px;
    height: 9px;
    border-right: 1px solid #c4a66a;
    border-bottom: 1px solid #c4a66a;
    transform: rotate(45deg);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(8px); }
}

/* === TORN PAPER DIVIDER === */
.torn-divider {
    position: relative;
    width: 100%;
    height: 40px;
    overflow: hidden;
    z-index: 5;
}

.torn-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tear-path {
    fill: #f5eed6;
    filter: drop-shadow(0 -2px 3px rgba(26, 16, 8, 0.15));
}

/* === CASE SECTIONS === */
.case-section {
    position: relative;
    min-height: 80vh;
    padding: 80px 64px;
    background: #f5eed6;
    overflow: hidden;
}

.case-section:nth-child(odd) {
    background: #f5eed6;
}

#hero {
    padding: 0;
    background: #1a1008;
}

/* Case Header */
.case-header {
    max-width: 800px;
    margin: 0 auto 48px;
    position: relative;
}

.dateline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 0.15em;
    color: #b8a994;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.classified-stamp-small {
    font-family: 'Special Elite', monospace;
    font-size: 18px;
    color: #8b0000;
    transform: rotate(-3deg);
    display: inline-block;
    border: 2px solid #8b0000;
    padding: 2px 12px;
    position: absolute;
    top: -8px;
    right: 0;
    opacity: 0.7;
    transition: opacity 0.8s ease;
}

.classified-stamp-small.faded {
    opacity: 0.1;
}

.case-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #1a1008;
    letter-spacing: -0.02em;
    line-height: 1.15;
    padding-bottom: 16px;
}

.headline-rule {
    width: 100%;
    height: 1px;
    background: #c4a66a;
}

/* === EVIDENCE PANEL (Split Layout) === */
.evidence-panel {
    display: flex;
    max-width: 1000px;
    margin: 0 auto 48px;
    gap: 0;
    position: relative;
    min-height: 250px;
}

.evidence-left {
    flex: 1;
    padding: 32px;
    background: #ffffff;
    position: relative;
}

.evidence-right {
    flex: 1;
    padding: 32px;
    background: #e8dcc8;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23paper)' opacity='0.03'/%3E%3C/svg%3E");
    position: relative;
}

.torn-vertical-divider {
    width: 20px;
    flex-shrink: 0;
    background: linear-gradient(
        to right,
        #ffffff 0%,
        #ffffff 30%,
        transparent 30%,
        transparent 70%,
        #e8dcc8 70%,
        #e8dcc8 100%
    );
    position: relative;
    overflow: hidden;
}

.torn-vertical-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #c4a66a 0px,
        #c4a66a 4px,
        transparent 4px,
        transparent 12px
    );
    opacity: 0.5;
}

.panel-label {
    margin-bottom: 16px;
    color: #5a4a3a;
    font-size: 13px;
}

.conventional-text {
    font-family: 'Source Serif 4', serif;
    font-size: 16px;
    line-height: 1.72;
    color: #2c2416;
    margin-bottom: 12px;
}

.evidence-text {
    font-family: 'Special Elite', monospace;
    font-size: 15px;
    line-height: 1.8;
    color: #5a4a3a;
}

.evidence-text p {
    margin-bottom: 12px;
}

.annotation-note {
    font-family: 'Special Elite', monospace;
    font-size: 13px;
    color: #b8a994;
    transform: rotate(-1deg);
    display: inline-block;
    margin-top: 8px;
}

/* Slide-in animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}

.slide-in-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right.revealed.shake {
    animation: shakeError 0.15s ease 0.7s 1;
}

@keyframes shakeError {
    0% { transform: translateX(0); }
    20% { transform: translateX(2px); }
    40% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    80% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* === REDACTION BARS === */
.redacted {
    position: relative;
    display: inline;
    white-space: nowrap;
}

.redacted::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    background: #0d0a06;
    z-index: 1;
    transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    clip-path: inset(0 0 0 0);
}

.redacted.declassified::before {
    clip-path: inset(0 50% 0 50%);
}

.redacted .reveal-text {
    position: relative;
    z-index: 2;
    color: transparent;
    transition: color 0.3s ease 0.4s;
}

.redacted.declassified .reveal-text {
    color: #1a6b5a;
    text-shadow: 0 0 12px rgba(26, 107, 90, 0.3);
}

/* Exposure flash */
.redacted.declassified .reveal-text {
    animation: exposureFlash 1.2s ease forwards;
}

@keyframes exposureFlash {
    0% { text-shadow: 0 0 20px rgba(26, 107, 90, 0.6); }
    100% { text-shadow: none; color: #1a6b5a; }
}

/* === EVIDENCE PIN === */
.evidence-pin {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #8b0000;
    border-radius: 50%;
    box-shadow: 1px 1px 3px rgba(26, 16, 8, 0.3), inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.pin-line {
    position: absolute;
    top: 6px;
    right: 12px;
    width: 40px;
    height: 0;
    border-top: 1px dashed #c4a66a;
}

/* === VERDICT STRIP === */
.verdict-strip {
    max-width: 1000px;
    margin: 0 auto;
    background: #8b0000;
    padding: 16px 32px;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.verdict-strip.visible {
    transform: translateX(0);
    opacity: 1;
}

.verdict-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #f5eed6;
    display: block;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s;
}

.verdict-strip.visible .verdict-text {
    opacity: 1;
    transform: translateX(0);
}

/* === STRING CONNECTIONS SVG === */
.string-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.string-svg.visible {
    opacity: 1;
}

.string-line {
    stroke: #8b0000;
    stroke-width: 1.5;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.8s ease;
}

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

/* === MICROFILM TRANSITION === */
.microfilm-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0a06;
    z-index: 8000;
    opacity: 0;
    pointer-events: none;
}

.microfilm-flash.active {
    animation: microfilmAdvance 0.3s ease;
}

@keyframes microfilmAdvance {
    0% { opacity: 0; }
    30% { opacity: 0.6; }
    50% { opacity: 0.8; filter: blur(1px); }
    70% { opacity: 0.4; }
    100% { opacity: 0; }
}

/* === FOOTER === */
#case-footer {
    background: #1a1008;
    padding: 80px 64px;
    text-align: center;
    position: relative;
}

.footer-stamp {
    display: inline-block;
    border: 3px solid #c4a66a;
    padding: 16px 40px;
    margin-bottom: 32px;
    transform: rotate(-2deg);
}

.stamp-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 0.2em;
    color: #c4a66a;
    display: block;
}

.stamp-korean {
    font-family: 'Special Elite', monospace;
    font-size: 16px;
    color: #b8a994;
    display: block;
    margin-top: 4px;
}

.footer-message {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #f5eed6;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.footer-message-en {
    font-family: 'Source Serif 4', serif;
    font-size: 16px;
    color: #b8a994;
    margin-bottom: 40px;
}

.footer-line {
    width: 60px;
    height: 1px;
    background: #5a4a3a;
    margin: 0 auto 16px;
}

.footer-domain {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 0.3em;
    color: #5a4a3a;
    text-transform: uppercase;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .case-section {
        padding: 48px 24px;
    }

    #case-nav {
        display: none;
    }

    .evidence-panel {
        flex-direction: column;
    }

    .torn-vertical-divider {
        width: 100%;
        height: 20px;
        background: linear-gradient(
            to bottom,
            #ffffff 0%,
            #ffffff 30%,
            transparent 30%,
            transparent 70%,
            #e8dcc8 70%,
            #e8dcc8 100%
        );
    }

    .torn-vertical-divider::before {
        top: 50%;
        left: 0;
        width: 100%;
        height: 2px;
        background: repeating-linear-gradient(
            to right,
            #c4a66a 0px,
            #c4a66a 4px,
            transparent 4px,
            transparent 12px
        );
    }

    .evidence-left,
    .evidence-right {
        padding: 24px;
    }

    #manila-folder {
        width: 300px;
    }

    .classified-stamp {
        font-size: 28px;
    }

    .classified-stamp span {
        font-size: 14px;
    }

    #case-footer {
        padding: 48px 24px;
    }

    .evidence-pin {
        display: none;
    }
}

@media (max-width: 480px) {
    .case-headline {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .verdict-strip {
        padding: 12px 16px;
    }

    .verdict-text {
        font-size: 14px;
    }
}
