/* ggaji.com - Korean Particle Linguistic Exploration */

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

:root {
    --bg-rice: #f7f3ec;
    --ink-black: #2c2a25;
    --accent-earth: #a0856e;
    --highlight-celadon: #7daa92;
    --muted-stone: #8a8278;
    --divider-bamboo: #c8c0b0;
    --glow-gold: #d4b483;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-rice);
    color: var(--ink-black);
    font-family: 'Noto Serif KR', serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== OPENING SECTION ===== */
.opening-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(
        135deg,
        rgba(160, 133, 110, 0.02) 0%,
        rgba(160, 133, 110, 0.04) 50%,
        rgba(160, 133, 110, 0.02) 100%
    );
}

.opening-container {
    text-align: center;
    position: relative;
    z-index: 2;
}

.main-character {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(6rem, 30vw, 24rem);
    font-weight: 900;
    color: var(--ink-black);
    line-height: 1;
    margin: 0;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeInScale 1.2s ease-out 0.3s forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.extending-line-container {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    position: relative;
}

.extending-line {
    width: 60%;
    max-width: 400px;
    height: 2px;
    background-color: var(--accent-earth);
    transform-origin: left center;
    opacity: 0;
    animation: drawLine 1.8s ease-out 0.8s forwards;
}

@keyframes drawLine {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.brush-stroke {
    width: 200px;
    height: 80px;
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.6s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.08;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.arrow {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-earth);
    border-top: none;
    border-left: none;
    transform: rotate(-45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: rotate(-45deg) translateY(0);
    }
    50% {
        transform: rotate(-45deg) translateY(12px);
    }
}

/* ===== PATH SPACERS ===== */
.path-spacer {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.path-line-vertical {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--divider-bamboo);
    opacity: 0.6;
}

.path-stone {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--divider-bamboo);
    opacity: 0;
    animation: stoneFadeIn 0.8s ease-out forwards;
}

@keyframes stoneFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.path-spacer.final {
    min-height: 60vh;
    justify-content: flex-start;
    padding-top: 10vh;
}

/* ===== GRAMMAR SECTIONS ===== */
.grammar-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(160, 133, 110, 0.01) 0%,
        rgba(160, 133, 110, 0.02) 100%
    );
}

.grammar-section.alt {
    background: linear-gradient(
        135deg,
        rgba(125, 170, 146, 0.01) 0%,
        rgba(125, 170, 146, 0.015) 100%
    );
}

.section-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.grammar-panel {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grammar-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.example-korean {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--ink-black);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.romanization {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted-stone);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

.translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--accent-earth);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.context-note {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--muted-stone);
    line-height: 1.7;
    padding-left: 1.5rem;
    border-left: 2px solid var(--divider-bamboo);
    margin-top: 1.5rem;
}

.context-note p {
    margin: 0;
}

/* ===== CONVERGENCE SECTION ===== */
.convergence-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(212, 180, 131, 0.02) 0%,
        rgba(212, 180, 131, 0.03) 100%
    );
}

.convergence-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-title {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 900;
    color: var(--ink-black);
    position: absolute;
    z-index: 10;
    opacity: 0.15;
    animation: slowRotate 120s linear infinite;
}

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

.convergence-circle {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orbital-text {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200px;
    transform-origin: center;
    transform:
        rotate(var(--angle))
        translateX(180px)
        rotate(calc(-1 * var(--angle)))
        translateY(-50%);
    animation: orbitRotate 120s linear infinite;
    opacity: 0;
    animation-fill-mode: forwards;
}

.orbital-text:nth-child(2) { animation-delay: 0s; }
.orbital-text:nth-child(3) { animation-delay: -24s; }
.orbital-text:nth-child(4) { animation-delay: -48s; }
.orbital-text:nth-child(5) { animation-delay: -72s; }
.orbital-text:nth-child(6) { animation-delay: -96s; }

@keyframes orbitRotate {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.orbital-text span {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(0.75rem, 2vw, 1rem);
    font-weight: 400;
    color: var(--muted-stone);
    text-align: center;
    display: block;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ===== CLOSING SECTION ===== */
.closing-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(125, 170, 146, 0.02) 0%,
        rgba(125, 170, 146, 0.03) 100%
    );
}

.closing-wrapper {
    text-align: center;
    max-width: 600px;
    opacity: 0;
    animation: fadeInScale 1.2s ease-out forwards;
}

.closing-meditation {
    font-family: 'Noto Serif KR', serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--ink-black);
    line-height: 1.4;
    margin: 1rem 0;
    letter-spacing: -0.01em;
}

.closing-meditation:last-child {
    color: var(--highlight-celadon);
    font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .opening-section {
        padding: 1rem;
    }

    .main-character {
        font-size: clamp(4rem, 25vw, 12rem);
    }

    .grammar-section {
        padding: 2rem 1rem;
    }

    .context-note {
        font-size: 0.8rem;
        padding-left: 1rem;
    }

    .convergence-container {
        max-width: 400px;
    }

    .orbital-text {
        width: 150px;
        transform:
            rotate(var(--angle))
            translateX(140px)
            rotate(calc(-1 * var(--angle)))
            translateY(-50%);
    }

    .orbital-text span {
        font-size: clamp(0.65rem, 1.5vw, 0.85rem);
    }
}

@media (max-width: 480px) {
    .main-character {
        font-size: clamp(2.5rem, 20vw, 8rem);
    }

    .extending-line {
        width: 50%;
    }

    .example-korean {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .translation {
        font-size: 1rem;
    }

    .orbital-text {
        width: 120px;
        transform:
            rotate(var(--angle))
            translateX(110px)
            rotate(calc(-1 * var(--angle)))
            translateY(-50%);
    }

    .orbital-text span {
        font-size: clamp(0.6rem, 1.2vw, 0.75rem);
    }

    .closing-meditation {
        font-size: clamp(1.2rem, 3vw, 2rem);
    }
}
