/* hangul.dev - Japanese-minimal developer documentation */
/* Color Palette:
   Paper White:      #FAFAF8  (main bg)
   Warm Parchment:   #F4F0EA  (alt bg)
   Ink Black:        #1A1A1A  (headings, body)
   Pencil Gray:      #6A6A68  (secondary)
   Thin Line:        #3A3A3A  (dividers at 15% opacity)
   Accent Indigo:    #3A4A8A  (links, interactive)
   Hand-Drawn Warm:  #8A6A50  (SVG annotations)
   Terminal Green:   #40B040  (cursor, code highlights)
*/

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #FAFAF8;
    color: #1A1A1A;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* =========================================
   HERO SECTION - Ma (negative space)
   ========================================= */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #FAFAF8;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.hero-diagonal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero-diagonal-line line {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: none;
}

.hero-title {
    position: relative;
    z-index: 2;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.02em;
    color: #1A1A1A;
    padding-left: 15%;
    padding-bottom: 15vh;
    opacity: 0;
    transition: none;
}

/* =========================================
   CONTENT SLICES - Diagonal sections
   ========================================= */

.content-slice {
    position: relative;
    padding: 120px 0 160px;
    min-height: 80vh;
}

.slice-white {
    background-color: #FAFAF8;
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    margin-top: -40px;
}

.slice-warm {
    background-color: #F4F0EA;
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    margin-top: -40px;
}

.slice-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

.content-column {
    max-width: 580px;
    margin: 0 auto;
}

/* =========================================
   SECTION HEADINGS
   ========================================= */

.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.02em;
    color: #1A1A1A;
    margin-bottom: 16px;
}

.section-lead {
    color: #6A6A68;
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 40px;
}

/* =========================================
   PROGRESSIVE DISCLOSURE MODULES
   ========================================= */

.disclosure-module {
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(58, 58, 58, 0.08);
}

.disclosure-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #1A1A1A;
    text-align: left;
    transition: color 0.2s ease;
}

.disclosure-heading:hover {
    color: #3A4A8A;
}

.disclosure-indicator {
    font-size: 12px;
    color: #3A4A8A;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    transition: transform 0.4s ease-in-out;
    display: inline-block;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.disclosure-module.expanded .disclosure-indicator {
    transform: rotate(45deg);
}

.disclosure-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease 0.1s;
    padding: 0;
}

.disclosure-module.expanded .disclosure-content {
    opacity: 1;
    padding-bottom: 24px;
}

.disclosure-content p {
    margin-bottom: 16px;
    color: #1A1A1A;
    font-size: 0.95rem;
    line-height: 1.75;
}

/* =========================================
   HANGUL SPECIMENS
   ========================================= */

.hangul-specimen {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    justify-content: center;
}

.specimen-char {
    font-family: 'Nanum Gothic', sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #1A1A1A;
    line-height: 1;
}

.vowel-specimen .specimen-char {
    font-size: clamp(3rem, 7vw, 5rem);
}

.hangul-inline {
    font-family: 'Nanum Gothic', sans-serif;
    font-weight: 700;
    color: #3A4A8A;
}

/* =========================================
   CODE BLOCKS
   ========================================= */

.code-block {
    background-color: #1A1A1A;
    padding: 20px 24px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: #FAFAF8;
    white-space: pre;
    display: block;
}

.code-comment {
    color: #6A6A68;
}

.code-keyword {
    color: #3A4A8A;
}

.code-fn {
    color: #FAFAF8;
}

.code-string {
    color: #40B040;
}

.code-key {
    font-family: 'Nanum Gothic', sans-serif;
    color: #40B040;
}

.code-arrow {
    color: #6A6A68;
}

/* =========================================
   HAND-DRAWN SVG ANNOTATIONS
   ========================================= */

.margin-annotation {
    position: absolute;
    left: -20px;
    width: 80px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.margin-annotation.visible {
    opacity: 1;
}

.annotation-1 {
    top: 120px;
}

.annotation-2 {
    top: 100px;
}

.annotation-3 {
    top: 130px;
}

.hand-drawn-svg {
    width: 100%;
    height: auto;
}

.stroke-path {
    stroke: #8A6A50;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stroke-path.stroke-1,
.stroke-path.stroke-2,
.stroke-path.stroke-3,
.stroke-path.stroke-4,
.stroke-path.stroke-5 {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.wave-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.key-outline {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.key-label {
    fill: #8A6A50;
    opacity: 0;
    transition: opacity 0.4s ease 1s;
}

.annotation-3.visible .key-label {
    opacity: 1;
}

/* Waveform inline (pronunciation pulse) */
.waveform-inline {
    display: block;
    width: 200px;
    height: 30px;
    margin: 12px 0;
}

.wave-pulse-path {
    stroke: #3A4A8A;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

/* =========================================
   TERMINAL FOOTER
   ========================================= */

.terminal-footer {
    background-color: #1A1A1A;
    padding: 60px 40px;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.terminal-footer.visible {
    transform: translateY(0);
    opacity: 1;
}

.terminal-inner {
    max-width: 580px;
    margin: 0 auto;
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.terminal-prompt {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: #FAFAF8;
}

.terminal-separator {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #6A6A68;
}

.terminal-dollar {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #6A6A68;
}

.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 16px;
    background-color: #40B040;
    opacity: 0;
    animation: none;
}

.terminal-cursor.blinking {
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-version {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #6A6A68;
}

.terminal-dot {
    color: #6A6A68;
    font-size: 0.75rem;
}

.terminal-attr {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #6A6A68;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .margin-annotation {
        display: none;
    }

    .slice-inner {
        padding: 0 24px;
    }

    .content-slice {
        padding: 80px 0 120px;
    }

    .hero-title {
        padding-left: 8%;
    }

    .terminal-footer {
        padding: 40px 24px;
    }

    .hangul-specimen {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        padding-left: 6%;
        padding-bottom: 10vh;
    }

    .code-block {
        padding: 16px;
    }

    .code-block code {
        font-size: 0.75rem;
    }
}
