/* YESANG.XYZ Styles */

/* Color Palette */
:root {
    --channel-a: #1B1464;
    --channel-b: #E63946;
    --dark-ground: #0A0A12;
    --light-ground: #E8E4DF;
    --glitch-artifact: #00F5D4;
    --scan-line: rgba(255, 255, 255, 0.04);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Serif', serif;
    background-color: var(--dark-ground);
    color: var(--light-ground);
    line-height: 1.7;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    overflow-x: hidden;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background-color: var(--channel-b);
    width: 0%;
    z-index: 1000;
}

/* Scan Line Overlay */
.scan-line-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    z-index: 999;
}

/* Section Styles */
.section {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
}

/* Parallax Background */
.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Section 1: Signal Acquired */
.section-1 {
    background-color: var(--dark-ground);
}

.city-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 99px,
            rgba(139, 69, 19, 0.1) 99px,
            rgba(139, 69, 19, 0.1) 100px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 99px,
            rgba(139, 69, 19, 0.1) 99px,
            rgba(139, 69, 19, 0.1) 100px
        );
    opacity: 0.15;
}

.hero-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--light-ground);
    text-align: center;
    word-spacing: 100vw;
    position: relative;
    z-index: 10;
}

/* Glitch Text Animation */
@keyframes glitch {
    0%, 90% {
        transform: none;
        clip-path: none;
    }
    91% {
        clip-path: inset(20% 0 60% 0);
        transform: translateX(-4px);
    }
    93% {
        clip-path: inset(50% 0 10% 0);
        transform: translateX(6px);
    }
    95% {
        clip-path: inset(10% 0 70% 0);
        transform: translateX(-2px);
    }
    96%, 100% {
        transform: none;
        clip-path: none;
    }
}

.glitch-text {
    animation: glitch 5s infinite;
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-glitch-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
}

.glitch-text::before {
    animation: glitch-before 5s infinite;
    color: var(--channel-b);
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-after 5s infinite;
    color: var(--glitch-artifact);
    z-index: -2;
}

@keyframes glitch-before {
    0%, 90% {
        clip-path: none;
        transform: none;
    }
    91% {
        clip-path: inset(20% 0 60% 0);
        transform: translateX(2px);
    }
    95% {
        clip-path: inset(50% 0 10% 0);
        transform: translateX(-2px);
    }
    96%, 100% {
        clip-path: none;
        transform: none;
    }
}

@keyframes glitch-after {
    0%, 90% {
        clip-path: none;
        transform: none;
    }
    93% {
        clip-path: inset(10% 0 70% 0);
        transform: translateX(-4px);
    }
    94% {
        clip-path: inset(40% 0 20% 0);
        transform: translateX(4px);
    }
    96%, 100% {
        clip-path: none;
        transform: none;
    }
}

/* Section 2: Frequency Drift */
.section-2 {
    background-color: var(--dark-ground);
}

.korean-title {
    font-family: 'IBM Plex Serif', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    color: var(--channel-a);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 0 var(--channel-b);
}

.text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
    line-height: 1.8;
}

.text-columns p {
    text-align: justify;
}

@media (max-width: 768px) {
    .text-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.abstract-shapes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.shape {
    position: absolute;
    opacity: 0.12;
}

.shape-rect-1 {
    width: 300px;
    height: 100px;
    background-color: var(--channel-a);
    top: 20%;
    left: 10%;
}

.shape-rect-2 {
    width: 200px;
    height: 150px;
    background-color: var(--channel-b);
    bottom: 20%;
    right: 15%;
}

.shape-pixel-block-1 {
    width: 80px;
    height: 80px;
    background-color: var(--glitch-artifact);
    top: 50%;
    right: 20%;
}

.shape-pixel-block-2 {
    width: 120px;
    height: 60px;
    background-color: var(--channel-a);
    bottom: 30%;
    left: 5%;
}

/* Section 3: Channel Split */
.section-3 {
    display: flex;
    flex-direction: column;
    height: 200vh;
}

.channel-top {
    height: 100vh;
    background: linear-gradient(135deg, var(--channel-a) 0%, #0A0A12 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.channel-bottom {
    height: 100vh;
    background: linear-gradient(135deg, var(--channel-b) 0%, #0A0A12 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.channel-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.channel-text {
    font-family: 'IBM Plex Serif', serif;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    line-height: 1.8;
    font-weight: 400;
    color: var(--light-ground);
}

.shape-bar-1 {
    width: 400px;
    height: 8px;
    background-color: var(--light-ground);
    position: absolute;
    left: 5%;
    top: 30%;
    opacity: 0.15;
}

.shape-bar-2 {
    width: 300px;
    height: 8px;
    background-color: var(--light-ground);
    position: absolute;
    right: 5%;
    bottom: 40%;
    opacity: 0.15;
}

.shape-square-1 {
    width: 120px;
    height: 120px;
    background-color: var(--light-ground);
    position: absolute;
    right: 10%;
    top: 20%;
    opacity: 0.12;
}

.shape-square-2 {
    width: 150px;
    height: 150px;
    background-color: var(--light-ground);
    position: absolute;
    left: 8%;
    bottom: 15%;
    opacity: 0.12;
}

/* Section 4: Static Field */
.section-4 {
    background-color: var(--dark-ground);
    position: relative;
}

.static-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise" /></filter><rect width="200" height="200" fill="%230A0A12" filter="url(%23noise)" opacity="0.05"/></svg>');
    opacity: 0.8;
    z-index: 0;
}

.center-content {
    z-index: 10;
    text-align: center;
}

.closing-text {
    max-width: 700px;
    margin-bottom: 2rem;
}

.closing-text p {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--light-ground);
}

.timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--channel-b);
}

.shape-rotating-element {
    position: relative;
    margin-top: 2rem;
    width: 100px;
    height: 100px;
    background-color: var(--channel-a);
    opacity: 0.3;
    animation: rotation 15s linear infinite;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .section {
        height: auto;
        min-height: 100vh;
    }

    .section-3 {
        height: auto;
    }

    .channel-top,
    .channel-bottom {
        height: 100vh;
        min-height: 100vh;
    }

    .text-columns {
        grid-template-columns: 1fr;
    }
}
