/* ============================================================
   yongzoon.xyz — Digital Dojang
   Palette: #FFFFFF (Dojang White), #000000 (Dobok Black),
            #333333 (Carbon Gray), #C44536 (Dojang Red),
            #E0E0E0 (Belt Faint)
   ============================================================ */

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

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: #000000;
    color: #FFFFFF;
    font-family: "Noto Sans KR", sans-serif;
    height: 500vh; /* Five forms scroll height */
    overflow-x: hidden;
}

/* ------------------------------------------------------------
   Dojang container — split-screen via CSS Grid
   ------------------------------------------------------------ */
.dojang {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    overflow: hidden;
}

/* ------------------------------------------------------------
   Panels — sticky to top, 100vh tall
   ------------------------------------------------------------ */
.panel {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.stillness-panel {
    background: #FFFFFF;
    color: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.motion-panel {
    background: #000000;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ------------------------------------------------------------
   Red dividing line (the only color besides B/W)
   ------------------------------------------------------------ */
.divider {
    width: 2px;
    height: 100vh;
    background: #C44536;
    position: relative;
    z-index: 5;
}

/* ------------------------------------------------------------
   Stillness Panel content states
   ------------------------------------------------------------ */
.stillness-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 480px;
    text-align: center;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
    padding: 0 40px;
}

.stillness-content.active {
    opacity: 1;
    pointer-events: auto;
}

.form-marker {
    font-family: "Roboto Mono", monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: #C44536;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.korean-anchor {
    font-family: "Noto Serif KR", serif;
    font-weight: 900;
    font-size: 160px;
    line-height: 1;
    color: #C44536;
    margin-bottom: 40px;
    user-select: none;
}

.form-name {
    font-family: "Noto Serif KR", serif;
    font-weight: 900;
    font-size: 48px;
    line-height: 1.1;
    color: #000000;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.form-description {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #333333;
    margin-bottom: 32px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.form-meta {
    font-family: "Roboto Mono", monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #333333;
    text-transform: uppercase;
    padding-top: 16px;
    border-top: 1px solid #E0E0E0;
    display: inline-block;
}

/* ------------------------------------------------------------
   Grid Floor — 60px grid that flashes during transitions
   ------------------------------------------------------------ */
.grid-floor {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, #E0E0E0 1px, transparent 1px),
        linear-gradient(to bottom, #E0E0E0 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.grid-floor.flash {
    opacity: 0.4;
}

/* ------------------------------------------------------------
   Motion Panel content states
   ------------------------------------------------------------ */
.motion-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}

.motion-content.active {
    opacity: 1;
    pointer-events: auto;
}

.path-svg {
    width: 80%;
    height: 80%;
    max-width: 400px;
    max-height: 600px;
}

/* SVG paths animation — stroke-dashoffset reveal */
.form-path {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--path-length, 2000);
    stroke-dashoffset: var(--path-length, 2000);
    transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.motion-content.active .form-path {
    stroke-dashoffset: 0;
}

/* Stance dots — pulse triggered via JS */
.stance-dot {
    transform-origin: center;
    transform-box: fill-box;
    opacity: 0;
    transition: opacity 200ms ease;
}

.motion-content.active .stance-dot {
    opacity: 1;
}

.stance-dot.pulse {
    animation: stance-pulse 200ms ease-out;
}

@keyframes stance-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

.stance-dot-final {
    animation: stance-breathe 3s ease-in-out infinite;
}

@keyframes stance-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* ------------------------------------------------------------
   Motion Panel labels (corners)
   ------------------------------------------------------------ */
.motion-label {
    position: absolute;
    font-family: "Roboto Mono", monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #FFFFFF;
    text-transform: uppercase;
    padding: 24px 32px;
}

.motion-label-tl { top: 0; left: 0; }
.motion-label-tr { top: 0; right: 0; }
.motion-label-bl { bottom: 0; left: 0; }
.motion-label-br { bottom: 0; right: 0; }

/* ------------------------------------------------------------
   Form Counter — bottom-center on red divider
   ------------------------------------------------------------ */
.form-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: "Roboto Mono", monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #C44536;
    background: #FFFFFF;
    padding: 8px 16px;
    border: 2px solid #C44536;
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.counter-current {
    color: #000000;
    font-size: 18px;
}

.counter-divider {
    color: #C44536;
}

.counter-total {
    color: #333333;
    font-size: 14px;
}

/* ------------------------------------------------------------
   Hidden scroll triggers (one per form)
   ------------------------------------------------------------ */
.scroll-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.scroll-trigger {
    width: 1px;
    height: 100vh;
    pointer-events: none;
}

/* ------------------------------------------------------------
   Mobile — split stacks vertically (top/bottom)
   ------------------------------------------------------------ */
@media (max-width: 767px) {
    .dojang {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 2px 50vh;
    }

    .divider {
        width: 100vw;
        height: 2px;
    }

    .stillness-panel {
        padding: 24px;
    }

    .korean-anchor {
        font-size: 100px;
        margin-bottom: 16px;
    }

    .form-name {
        font-size: 32px;
        margin-bottom: 14px;
    }

    .form-description {
        font-size: 15px;
        line-height: 1.7;
    }

    .form-marker {
        margin-bottom: 18px;
    }

    .form-meta {
        font-size: 11px;
    }

    .motion-label {
        font-size: 10px;
        padding: 14px 18px;
        letter-spacing: 0.15em;
    }

    .path-svg {
        width: 70%;
        height: 70%;
    }

    .form-counter {
        bottom: 16px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .counter-current {
        font-size: 14px;
    }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .form-path {
        transition: none;
        stroke-dashoffset: 0;
    }
    .stance-dot-final {
        animation: none;
    }
    .stance-dot.pulse {
        animation: none;
    }
}
