/* ============================================
   archetype.moe — Editorial Fashion Lookbook
   ============================================ */

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

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

body {
    background: #0A0A12;
    color: #B8B8CC;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Halftone SVG Pattern Definition (inline via CSS) --- */
.halftone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.04;
    background-image: radial-gradient(circle, #FF3366 1px, transparent 1px);
    background-size: 6px 6px;
    mix-blend-mode: multiply;
}

[data-bg="void"] .halftone-overlay {
    mix-blend-mode: screen;
}

/* --- Scroll Snap Container --- */
.spreads-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
}

/* --- Spread Base --- */
.spread {
    position: relative;
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

.spread[data-bg="void"] {
    background-color: #0A0A12;
}

.spread[data-bg="bruised"] {
    background-color: #1A1428;
}

.spread[data-bg="split"] {
    background-color: #1A1428;
}

/* --- Kanji Watermarks --- */
.kanji-watermark {
    position: absolute;
    font-family: 'Shippori Mincho', serif;
    font-weight: 400;
    font-size: clamp(200px, 30vw, 400px);
    color: #FF3366;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    transition: opacity 4s ease;
    animation: kanjiDrift 30s ease-in-out infinite alternate;
}

.kanji-1 {
    top: 5%;
    right: 10%;
}

.kanji-2 {
    bottom: 10%;
    left: 5%;
}

.kanji-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
}

.kanji-4 {
    top: 5%;
    left: 15%;
    opacity: 0.05;
}

.kanji-5 {
    top: 20%;
    right: 15%;
    animation: kanjiPulse 4s ease-in-out infinite;
}

@keyframes kanjiDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10px, -10px); }
}

@keyframes kanjiPulse {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.08; }
}

/* --- Margin Gloss Strip --- */
.margin-gloss {
    position: fixed;
    left: 0;
    top: 0;
    width: 60px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 100;
    pointer-events: none;
}

.margin-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 400;
    color: #555566;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.1em;
    transition: color 0.4s ease, transform 0.4s ease;
}

.margin-spread-num {
    font-size: 10px;
    letter-spacing: 0.15em;
}

.margin-spread-num.active {
    color: #FFD700;
}

.margin-tag {
    font-family: 'Shippori Mincho', serif;
    font-size: 14px;
    color: #555566;
    opacity: 0.6;
}

/* --- Dot Navigation --- */
.dot-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #555566;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dot:hover {
    transform: scale(1.5);
}

.dot.active {
    background: #FFD700;
}

/* --- Diagonal Cuts --- */
.diagonal-cut {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cut-down-left {
    background: linear-gradient(
        to bottom right,
        #0A0A12 0%,
        #0A0A12 3%,
        transparent 3.1%
    );
    clip-path: polygon(0 0, 100% 0, 100% 7%, 0 0);
    background-color: #0A0A12;
    height: 12%;
}

.cut-up-right {
    background-color: #1A1428;
    clip-path: polygon(0 0, 100% 7%, 100% 0);
    height: 12%;
}

/* --- Gutter Between Spreads --- */
.gutter {
    position: relative;
    height: 8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0A0A12;
    overflow: hidden;
    scroll-snap-align: none;
}

.gutter-line {
    width: 80%;
    height: 20px;
}

.gutter-stroke {
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.gutter.visible .gutter-stroke {
    stroke-dashoffset: 0;
}

.gutter-jewel {
    transition: opacity 0.6s ease 0.8s;
    opacity: 0;
}

.gutter.visible .gutter-jewel {
    opacity: 1;
}

/* --- Glitch Slices --- */
.glitch-slices {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.glitch-slice {
    position: absolute;
    width: 100%;
    height: 3px;
    background: #00E5CC;
    opacity: 0;
    transition: opacity 0.2s;
}

.glitch-slices .glitch-slice:nth-child(1) { top: 8%; }
.glitch-slices .glitch-slice:nth-child(2) { top: 15%; }
.glitch-slices .glitch-slice:nth-child(3) { top: 22%; }

.glitch-slices-heavy .glitch-slice:nth-child(1) { top: 5%; }
.glitch-slices-heavy .glitch-slice:nth-child(2) { top: 12%; }
.glitch-slices-heavy .glitch-slice:nth-child(3) { top: 25%; }
.glitch-slices-heavy .glitch-slice:nth-child(4) { top: 38%; }
.glitch-slices-heavy .glitch-slice:nth-child(5) { top: 52%; }
.glitch-slices-heavy .glitch-slice:nth-child(6) { top: 65%; }
.glitch-slices-heavy .glitch-slice:nth-child(7) { top: 78%; }
.glitch-slices-heavy .glitch-slice:nth-child(8) { top: 90%; }

.glitch-slice.active {
    opacity: 0.7;
    animation: glitchShift 0.2s ease-in-out infinite alternate;
}

.glitch-slices-heavy .glitch-slice.active {
    animation: glitchShiftHeavy 0.15s ease-in-out infinite alternate;
}

@keyframes glitchShift {
    0% { transform: translateX(-15px); }
    100% { transform: translateX(15px); }
}

@keyframes glitchShiftHeavy {
    0% { transform: translateX(-40px); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(-60px); }
}

/* ============================================
   SPREAD I — THE CREATOR
   ============================================ */
.spread-1-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 3;
}

.hero-title {
    font-family: 'Zen Dots', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 8rem);
    color: #F0EDE8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    gap: 0.02em;
}

.hero-title .letter {
    opacity: 0;
    transform: translateY(4px);
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: #FFFFFF;
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-line-container {
    width: 80%;
    margin: 1.5rem auto 0;
    overflow: hidden;
}

.hero-line {
    width: 100%;
    height: 2px;
    opacity: 0;
    transition: opacity 0.1s;
}

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

.hero-line line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.hero-line.drawing line {
    stroke-dashoffset: 0;
}

.hero-subtitle {
    font-family: 'Anybody', sans-serif;
    font-weight: 600;
    font-stretch: 75%;
    font-size: 2rem;
    color: #FF3366;
    text-align: right;
    width: 80%;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.creator-figure-container {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(300px, 50vw, 500px);
    height: auto;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.creator-figure-container.visible {
    opacity: 1;
}

/* --- Archetype Figure SVG Path Animation --- */
.archetype-figure {
    width: 100%;
    height: auto;
}

.figure-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.8s ease-in-out, stroke 0.2s ease;
}

.figure-path.drawn {
    stroke-dashoffset: 0;
}

/* Hover color shift on figures */
.archetype-figure:hover .figure-path {
    stroke: #00E5CC;
    transition: stroke 0.2s ease;
}

.archetype-figure:not(:hover) .figure-path {
    transition: stroke 0.3s ease;
}

/* Restore specific colors on non-hover */
.archetype-figure:not(:hover) .figure-path[stroke="#F0EDE8"] {
    stroke: #F0EDE8;
}

.archetype-figure:not(:hover) .figure-path[stroke="#FF3366"] {
    stroke: #FF3366;
}

.archetype-figure:not(:hover) .figure-path[stroke="#00E5CC"] {
    stroke: #00E5CC;
}

.archetype-figure:not(:hover) .figure-path[stroke="#FFD700"] {
    stroke: #FFD700;
}

/* ============================================
   SPREAD II — THE REBEL
   ============================================ */
.spread-2-content {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 3;
}

.rebel-figure-zone {
    width: 65%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.rebel-figure {
    width: clamp(280px, 40vw, 450px);
    height: auto;
}

.rebel-text-zone {
    width: 35%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
}

.vertical-title {
    font-family: 'Zen Dots', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 5rem);
    color: #F0EDE8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
}

.spread-title {
    font-family: 'Zen Dots', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #F0EDE8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.spread-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: #B8B8CC;
    margin-top: 2rem;
    max-width: 400px;
}

/* ============================================
   SPREAD III — THE LOVER
   ============================================ */
.spread-3-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 3;
}

.lover-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Anybody', sans-serif;
    font-weight: 600;
    font-stretch: 150%;
    font-size: clamp(6rem, 20vw, 20rem);
    color: #FF3366;
    opacity: 0.15;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.05em;
    z-index: 1;
    pointer-events: none;
}

.lover-figure-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.lover-figure {
    width: clamp(250px, 35vw, 420px);
    height: auto;
}

/* Lover: all paths draw simultaneously (bloom effect) */
.lover-figure .figure-path {
    transition: stroke-dashoffset 1.2s ease-in-out, stroke 0.2s ease;
}

.lover-text-zone {
    text-align: center;
    z-index: 3;
    margin-top: 2rem;
    padding: 0 2rem;
}

.lover-quote {
    font-family: 'Shippori Mincho', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #F0EDE8;
    font-style: normal;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

.lover-quote-translation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    color: #555566;
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

/* ============================================
   SPREAD IV — THE SAGE
   ============================================ */
.spread-4 {
    position: relative;
}

.sage-upper-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: #0A0A12;
    z-index: 0;
}

.sage-gold-line {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #FFD700;
    z-index: 4;
}

.spread-4-content {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 3;
}

.sage-figure-zone {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sage-figure {
    width: clamp(260px, 35vw, 400px);
    height: auto;
}

.sage-text-zone {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    padding-bottom: 15%;
}

.sage-text-zone .spread-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
}

.sage-text-zone .spread-body {
    max-width: 500px;
}

/* ============================================
   SPREAD V — THE TRICKSTER
   ============================================ */
.spread-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 3;
}

.trickster-figure-zone {
    display: flex;
    align-items: center;
    justify-content: center;
}

.trickster-figure {
    width: clamp(280px, 40vw, 450px);
    height: auto;
}

/* Trickster paths: random delays handled via JS */

.trickster-text-zone {
    margin-top: 2rem;
    text-align: center;
}

.trickster-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.trick-line-1 {
    font-family: 'Zen Dots', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #F0EDE8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trick-line-2 {
    font-family: 'Zen Dots', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #00E5CC;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-left: 40px;
}

.trickster-colophon {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.colophon-line {
    width: 2px;
    height: 80px;
}

.colophon-stroke {
    transition: stroke-dashoffset 1s ease-in-out;
}

.colophon-line.drawing .colophon-stroke {
    stroke-dashoffset: 0;
}

.colophon-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: #555566;
    letter-spacing: 0.15em;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.8s ease 0.8s;
}

.colophon-text.visible {
    opacity: 1;
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 768px) {
    .margin-gloss {
        display: none;
    }

    .spread-2-content {
        flex-direction: column;
    }

    .rebel-figure-zone {
        width: 100%;
        height: 60%;
    }

    .rebel-text-zone {
        width: 100%;
        height: 40%;
        padding: 1.5rem;
    }

    .vertical-title {
        writing-mode: horizontal-tb;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
    }

    .spread-4-content {
        flex-direction: column;
    }

    .sage-figure-zone {
        width: 100%;
        height: 55%;
    }

    .sage-text-zone {
        width: 100%;
        height: 45%;
        padding: 1.5rem;
        padding-bottom: 2rem;
        justify-content: flex-start;
    }

    .dot-nav {
        right: 10px;
    }

    .lover-bg-text {
        font-size: clamp(4rem, 15vw, 10rem);
    }

    .trick-line-2 {
        margin-left: 20px;
    }
}
