/* ============================================
   daitoua.com - Neon Zen Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Backgrounds */
    --ink-void: #0A0A0F;
    --charcoal-zen: #141420;
    --slate-breath: #1C1C2E;

    /* Neon Accents */
    --magenta-pulse: #FF2E97;
    --cyan-haze: #00E5FF;
    --chartreuse-shock: #B8FF00;

    /* Text */
    --moonstone: #E0DFE6;
    --ash-whisper: #6E6E82;

    /* Glow definitions */
    --glow-magenta: 0 0 2px #FF2E97, 0 0 8px rgba(255, 46, 151, 0.6), 0 0 20px rgba(255, 46, 151, 0.2);
    --glow-cyan: 0 0 2px #00E5FF, 0 0 8px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.2);
    --glow-chartreuse: 0 0 2px #B8FF00, 0 0 8px rgba(184, 255, 0, 0.6), 0 0 20px rgba(184, 255, 0, 0.2);

    --text-glow-magenta: 0 0 2px #FF2E97, 0 0 8px rgba(255, 46, 151, 0.6), 0 0 20px rgba(255, 46, 151, 0.2);
    --text-glow-cyan: 0 0 2px #00E5FF, 0 0 8px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.2);
    --text-glow-chartreuse: 0 0 2px #B8FF00, 0 0 8px rgba(184, 255, 0, 0.6), 0 0 20px rgba(184, 255, 0, 0.2);

    /* Layout */
    --max-width: 1280px;
    --gap-inner: 16px;
    --gap-row: 24px;

    /* Animation */
    --reveal-duration: 900ms;
    --reveal-easing: cubic-bezier(0.22, 1, 0.36, 1);
    --weight-duration: 1.2s;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--ink-void);
}

body {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    color: var(--moonstone);
    background-color: var(--ink-void);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Fixed Site Mark --- */
.site-mark {
    position: fixed;
    top: 24px;
    left: 24px;
    font-family: 'Zen Dots', cursive;
    font-size: 13px;
    color: var(--ash-whisper);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    z-index: 100;
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--chartreuse-shock);
    box-shadow: var(--glow-chartreuse);
    z-index: 200;
    will-change: width;
}

/* ============================================
   ACT I: THE VOID
   ============================================ */
.act-i {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ink-void);
    position: relative;
}

.void-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.horizontal-line {
    height: 1px;
    background: var(--cyan-haze);
    box-shadow: var(--glow-cyan);
    will-change: width;
}

.line-opening {
    width: 0;
    transition: none;
}

.line-opening.drawn {
    width: min(50vw, 400px);
}

.site-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 200;
    color: var(--moonstone);
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 1s ease, font-weight 1.2s var(--reveal-easing), letter-spacing 1.2s var(--reveal-easing);
}

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

@supports (font-variation-settings: normal) {
    .site-title.breathe {
        font-weight: 400;
        letter-spacing: 0.02em;
    }
}

/* ============================================
   ACT II, III: MODULE GRID
   ============================================ */
.act-ii,
.act-iii {
    width: 100%;
}

.act-ii {
    background-color: var(--ink-void);
}

.act-iii {
    background-color: var(--charcoal-zen);
}

.act-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
}

/* Module rows */
.module-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap-inner);
    margin-bottom: var(--gap-row);
}

.module-row.trio {
    grid-template-columns: repeat(12, 1fr);
}

.module-row.grid-2x2 {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
}

/* Column spans */
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* --- Module Types --- */

/* Base module */
.module {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

/* Void Module */
.void-module {
    background-color: var(--slate-breath);
    min-height: 200px;
    animation: void-pulse 8s ease-in-out infinite;
}

@keyframes void-pulse {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 1.0; }
}

/* Text Module */
.text-module {
    padding: 80px 48px 80px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Headings - Bricolage Grotesque */
.heading-display {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(36px, 5vw, 80px);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: 0.08em;
    color: var(--moonstone);
    text-align: left;
    transition: font-weight var(--weight-duration) var(--reveal-easing),
                letter-spacing var(--weight-duration) var(--reveal-easing);
}

@supports (font-variation-settings: normal) {
    .heading-display.weight-breathe {
        font-weight: 500;
        letter-spacing: 0.02em;
    }
}

.heading-secondary {
    font-size: clamp(32px, 4vw, 64px);
    color: var(--moonstone);
}

/* Neon heading variants (Act III) */
.heading-neon-magenta {
    color: var(--magenta-pulse);
    text-shadow: var(--text-glow-magenta);
}

.heading-neon-cyan {
    color: var(--cyan-haze);
    text-shadow: var(--text-glow-cyan);
}

/* Body text - Instrument Sans */
.body-text {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(16px, 1.2vw, 20px);
    font-weight: 400;
    line-height: 1.7;
    color: var(--moonstone);
    max-width: 600px;
    text-align: left;
}

.body-text.neon-text {
    color: var(--moonstone);
}

/* Image Module */
.image-module {
    padding: 0;
    min-height: 400px;
}

.collage-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    background-color: var(--ink-void);
}

/* Karesansui SVG patterns */
.karesansui-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.5;
}

/* Gradient washes */
.gradient-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.7;
}

.wash-magenta-cyan {
    background: linear-gradient(135deg, rgba(255, 46, 151, 0.4) 0%, rgba(0, 229, 255, 0.4) 100%);
}

.wash-cyan-chartreuse {
    background: radial-gradient(circle at 40% 50%, rgba(0, 229, 255, 0.4) 0%, rgba(184, 255, 0, 0.3) 100%);
}

.wash-magenta-chartreuse {
    background: linear-gradient(135deg, rgba(255, 46, 151, 0.35) 0%, rgba(184, 255, 0, 0.3) 100%);
}

/* Ink wash texture overlays */
.ink-wash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.35;
    mix-blend-mode: multiply;
}

.ink-wash-1 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(10, 10, 15, 0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(10, 10, 15, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(10, 10, 15, 0.8) 0%, transparent 55%);
}

.ink-wash-2 {
    background:
        radial-gradient(ellipse at 70% 40%, rgba(10, 10, 15, 0.85) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 70%, rgba(10, 10, 15, 0.7) 0%, transparent 50%);
}

.ink-wash-3 {
    background:
        radial-gradient(ellipse at 40% 30%, rgba(10, 10, 15, 0.8) 0%, transparent 55%),
        radial-gradient(ellipse at 60% 60%, rgba(10, 10, 15, 0.75) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(10, 10, 15, 0.65) 0%, transparent 45%);
}

/* Collage glyphs */
.collage-glyph {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    z-index: 3;
}

.neon-glow-path {
    filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 12px currentColor);
}

/* Glyph Module */
.glyph-module {
    background-color: var(--ink-void);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 280px;
    aspect-ratio: 1 / 1;
}

.glyph-svg {
    width: 70%;
    height: auto;
    max-width: 200px;
}

.glyph-path {
    filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 10px currentColor);
}

.glyph-label {
    font-family: 'Zen Dots', cursive;
    font-size: 13px;
    color: var(--ash-whisper);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-top: 20px;
}

/* --- Flowing Curves --- */
.flowing-curve {
    display: block;
    width: 100%;
    height: auto;
    margin: 16px 0;
    overflow: visible;
}

/* --- Neon Glow Pulse Animation --- */
@keyframes neon-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 10px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 5px currentColor) drop-shadow(0 0 14px currentColor);
    }
}

.glyph-path {
    animation: neon-pulse 4s ease-in-out infinite;
}

/* ============================================
   ACT IV: THE RETURN
   ============================================ */
.act-iv {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ink-void);
    padding: 80px 24px;
}

.return-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: var(--max-width);
}

.centered-text {
    text-align: center;
    display: flex;
    justify-content: center;
}

.heading-closing {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(36px, 5vw, 80px);
    font-weight: 200;
    line-height: 1.15;
    color: var(--moonstone);
    text-align: center;
    letter-spacing: 0.04em;
}

.line-closing {
    width: 0;
    height: 1px;
    background: var(--cyan-haze);
    box-shadow: var(--glow-cyan);
    will-change: width;
    /* Align right to draw from center to right */
    margin-left: auto;
}

.line-closing.drawn {
    width: min(50vw, 400px);
}

/* ============================================
   REVEAL ANIMATION SYSTEM
   ============================================ */
.reveal-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--reveal-duration) var(--reveal-easing),
                transform var(--reveal-duration) var(--reveal-easing);
    will-change: opacity, transform;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE: TABLET (768px)
   ============================================ */
@media (max-width: 768px) {
    .module-row {
        grid-template-columns: repeat(6, 1fr);
    }

    .col-4 { grid-column: span 3; }
    .col-6 { grid-column: span 6; }
    .col-8 { grid-column: span 6; }
    .col-12 { grid-column: span 6; }

    .module-row.grid-2x2 {
        grid-template-columns: repeat(6, 1fr);
    }

    .text-module {
        padding: 48px 32px;
    }

    .heading-display {
        font-size: clamp(28px, 5vw, 56px);
    }

    .glyph-module {
        aspect-ratio: auto;
        min-height: 200px;
    }

    .site-mark {
        top: 16px;
        left: 16px;
        font-size: 11px;
    }

    .act-inner {
        padding: 60px 20px;
    }
}

/* ============================================
   RESPONSIVE: MOBILE (375px)
   ============================================ */
@media (max-width: 480px) {
    .module-row,
    .module-row.trio,
    .module-row.grid-2x2 {
        grid-template-columns: 1fr;
    }

    .col-4,
    .col-6,
    .col-8,
    .col-12 {
        grid-column: span 1;
    }

    .text-module {
        padding: 40px 20px;
    }

    .heading-display {
        font-size: clamp(24px, 8vw, 40px);
    }

    .heading-closing {
        font-size: clamp(24px, 7vw, 40px);
    }

    .body-text {
        font-size: 16px;
    }

    .act-inner {
        padding: 40px 16px;
    }

    .void-module {
        min-height: 120px;
    }

    .glyph-module {
        min-height: 200px;
        aspect-ratio: auto;
    }

    .collage-container {
        min-height: 300px;
    }

    .site-mark {
        top: 12px;
        left: 12px;
        font-size: 10px;
    }
}

/* ============================================
   ACT III INTENSITY BOOST
   ============================================ */
.act-iii .glyph-path {
    animation: neon-pulse-intense 4s ease-in-out infinite;
}

@keyframes neon-pulse-intense {
    0%, 100% {
        filter: drop-shadow(0 0 5px currentColor) drop-shadow(0 0 15px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 22px currentColor);
    }
}

.act-iii .gradient-wash {
    opacity: 0.85;
}

.act-iii .neon-glow-path {
    filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 18px currentColor);
}

/* ============================================
   SVG LINE DRAW ANIMATION
   ============================================ */
.line-draw-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 1.5s linear;
}

.line-draw-path.drawn {
    stroke-dashoffset: 0;
}
