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

html {
    scroll-behavior: smooth;
    background: #0E0E14;
    color: #F0F0F5;
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

body {
    position: relative;
    background: #0E0E14;
    min-height: 100vh;
}

/* === TYPOGRAPHY === */
.korean-display {
    font-family: 'Noto Sans KR', 'Nunito Sans', sans-serif;
    font-weight: 700;
    color: #00F0FF;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
}

.korean-inline {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    color: #FFD700;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    color: #F0F0F5;
}

.muted-text {
    color: #8A8A9E;
}

/* === TRIANGULAR GRID UNDERLAY === */
#grid-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.12;
    pointer-events: none;
}

/* === NEON PULSE LINES === */
.pulse-line {
    position: fixed;
    background: #00F0FF;
    z-index: 0;
    pointer-events: none;
    animation: neonPulse 4s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.pulse-line-1 {
    top: 20vh;
    left: 0;
    width: 100%;
    height: 1px;
    animation-delay: 0s;
}

.pulse-line-2 {
    top: 0;
    left: 15%;
    width: 1px;
    height: 100vh;
    position: fixed;
    animation-delay: 0.8s;
}

.pulse-line-3 {
    top: 55vh;
    left: 0;
    width: 100%;
    height: 1px;
    animation-delay: 1.6s;
}

.pulse-line-4 {
    top: 0;
    left: 72%;
    width: 1px;
    height: 100vh;
    animation-delay: 2.4s;
}

.pulse-line-5 {
    top: 85vh;
    left: 0;
    width: 100%;
    height: 1px;
    animation-delay: 3.2s;
}

@keyframes neonPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* === WATERMARK CHARACTERS === */
.hero-watermark,
.watermark-bg {
    position: absolute;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(20rem, 40vw, 50rem);
    color: #1A1A28;
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.hero-watermark {
    top: -5%;
    right: 5%;
}

/* === HERO / OPENING STATEMENT ZONE === */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    padding: 15vh 0 0 15%;
    overflow: hidden;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

#hero-title {
    font-size: clamp(3rem, 9vw, 8rem);
    letter-spacing: 0.02em;
    line-height: 1.05;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 1.2s ease-out 0.3s forwards;
}

#hero-subtitle {
    margin-top: 1.5rem;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #F0F0F5;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 1.2s ease-out 0.8s forwards;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Korean glow pulse */
@keyframes koreanGlow {
    0%, 100% { text-shadow: 0 0 30px rgba(0, 240, 255, 0.3); }
    50% { text-shadow: 0 0 30px rgba(0, 240, 255, 0.5); }
}

#hero-title {
    animation: heroFadeIn 1.2s ease-out 0.3s forwards, koreanGlow 3s ease-in-out 1.5s infinite;
}

/* === CRYSTALLINE FORMS === */
.hero-crystals {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.crystal {
    position: absolute;
    opacity: 0;
    animation: crystalIn 0.8s ease-out forwards;
}

.crystal-1 {
    top: 15%;
    right: 20%;
    width: 200px;
    height: 200px;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(255, 0, 229, 0.08));
    backdrop-filter: blur(2px);
    animation-delay: 0.6s;
    animation-name: crystalIn, crystalFloat;
    animation-duration: 0.8s, 120s;
    animation-delay: 0.6s, 1.4s;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease-out, linear;
}

.crystal-2 {
    top: 30%;
    right: 8%;
    width: 150px;
    height: 180px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    background: linear-gradient(200deg, rgba(255, 215, 0, 0.05), rgba(0, 240, 255, 0.12));
    animation-delay: 0.9s;
    animation-name: crystalIn, crystalFloat;
    animation-duration: 0.8s, 150s;
    animation-delay: 0.9s, 1.7s;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease-out, linear;
}

.crystal-3 {
    top: 55%;
    right: 25%;
    width: 120px;
    height: 140px;
    clip-path: polygon(50% 0%, 100% 30%, 85% 100%, 15% 100%, 0% 30%);
    background: linear-gradient(160deg, rgba(255, 0, 229, 0.08), rgba(0, 240, 255, 0.1));
    animation-delay: 1.2s;
    animation-name: crystalIn, crystalFloat;
    animation-duration: 0.8s, 180s;
    animation-delay: 1.2s, 2.0s;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease-out, linear;
}

.crystal-4 {
    top: 10%;
    right: 40%;
    width: 100px;
    height: 100px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    background: linear-gradient(45deg, rgba(0, 240, 255, 0.1), rgba(255, 215, 0, 0.05));
    animation-delay: 1.5s;
    animation-name: crystalIn, crystalFloat;
    animation-duration: 0.8s, 200s;
    animation-delay: 1.5s, 2.3s;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease-out, linear;
}

.crystal-5 {
    top: 65%;
    right: 10%;
    width: 80px;
    height: 90px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: linear-gradient(300deg, rgba(255, 0, 229, 0.06), rgba(255, 215, 0, 0.08));
    animation-delay: 1.8s;
    animation-name: crystalIn, crystalFloat;
    animation-duration: 0.8s, 140s;
    animation-delay: 1.8s, 2.6s;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease-out, linear;
}

@keyframes crystalIn {
    from { opacity: 0; transform: scale(0.8) rotateZ(0deg); }
    to { opacity: 1; transform: scale(1) rotateZ(0deg); }
}

@keyframes crystalFloat {
    from { transform: rotateZ(0deg); }
    to { transform: rotateZ(180deg); }
}

/* === CONCEPT COLUMNS === */
#columns {
    position: relative;
    padding: 10vh 15% 10vh;
    z-index: 1;
}

#columns .watermark-bg {
    top: -10%;
    left: 30%;
}

.column-row {
    display: flex;
    gap: 24px;
    position: relative;
    z-index: 2;
}

.concept-column {
    flex: 1;
    border: 1px solid rgba(0, 240, 255, 0.4);
    background: #1A1A28;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.4s ease-out, box-shadow 0.4s ease-out;
}

.concept-column:hover {
    border-color: rgba(0, 240, 255, 1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.column-label {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 0.25rem;
}

.column-label-en {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.column-body {
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    line-height: 1.7;
}

/* === PROPOSITIONS === */
#propositions {
    position: relative;
    padding: 10vh 15% 10vh;
    z-index: 1;
}

#propositions .watermark-bg {
    top: 10%;
    left: -5%;
}

.proposition {
    display: flex;
    align-items: stretch;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.prop-accent {
    width: 3px;
    background: #00F0FF;
    flex-shrink: 0;
    margin-right: 2rem;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 0.6s ease-out;
}

.proposition.visible .prop-accent {
    transform: scaleY(1);
}

.prop-content {
    max-width: 65%;
}

.prop-number {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

/* === TERMINAL / Q.E.D. === */
#terminal {
    position: relative;
    padding: 15vh 15%;
    text-align: center;
    z-index: 1;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#terminal .watermark-bg {
    top: -20%;
    left: 20%;
}

.terminal-line-container {
    width: 100%;
    max-width: 800px;
    height: 2px;
    margin-bottom: 3rem;
}

#qed-line {
    width: 100%;
    height: 2px;
}

#qed-line-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease-out;
}

#terminal.visible #qed-line-path {
    stroke-dashoffset: 0;
}

.qed-text {
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
    animation: koreanGlow 3s ease-in-out infinite;
}

.terminal-statement {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    max-width: 600px;
    line-height: 1.8;
}

/* === MAGNETIC ELEMENT TRANSITIONS === */
.magnetic-element {
    transition: transform 0.6s ease-out;
}

/* === ADDITIONAL COLOR REFERENCES === */
/* #2A2A3C - Deep Edge divider */
.section-divider {
    border-top: 1px solid #2A2A3C;
}

/* #FF00E5 - Inference Magenta for hover/interactive */
.concept-column:hover .column-label {
    color: #FF00E5;
    text-shadow: 0 0 30px rgba(255, 0, 229, 0.4);
}

.qed-text:hover {
    color: #FF00E5;
}

/* #FFFFFF used for strong emphasis */
.prop-number {
    color: #FFFFFF;
    opacity: 0.3;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #hero {
        padding: 12vh 8% 0;
    }

    .hero-crystals {
        opacity: 0.5;
    }

    .column-row {
        flex-direction: column;
    }

    #columns {
        padding: 8vh 8%;
    }

    #propositions {
        padding: 8vh 8%;
    }

    .prop-content {
        max-width: 90%;
    }

    #terminal {
        padding: 10vh 8%;
    }
}
