/* ============================================================
   kkaji.com — v2
   Flat design / split-screen / watercolor washes
   ============================================================ */

/* ---- Palette tokens (exact hex values from DESIGN.md) ---- */
:root {
    --c-earth:        #e8dcc8;   /* warm parchment sand */
    --c-cream:        #fefcf8;   /* cream white */
    --c-green:        #5b8c5a;   /* sage / spatial */
    --c-sienna:       #c4853f;   /* burnt sienna / time */
    --c-blue:         #4a7c9b;   /* slate blue / extent */
    --c-umber:        #9b6b4a;   /* umber / quantity */
    --c-text-on-color:#fefcf8;
    --c-text-on-light:#2d2518;   /* espresso dark */
    --c-watercolor-1: #8fbc8f;   /* sage bleed */
    --c-watercolor-2: #daa520;   /* gold bleed */
    --c-watercolor-3: #cd853f;   /* peru bleed */

    --pad-x: clamp(24px, 5vw, 64px);
    --pad-y: clamp(24px, 5vw, 64px);

    --f-display: "Commissioner", "Inter", system-ui, sans-serif;
    --f-korean:  "Noto Sans KR", "Commissioner", system-ui, sans-serif;
    --f-anno:    "Karla", "Inter", system-ui, sans-serif;
}

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

html, body {
    background: var(--c-cream);
    color: var(--c-text-on-light);
    font-family: var(--f-korean);
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; }

/* zero rounded corners, zero shadows on flat surfaces */
button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }

/* ---- Split-screen primitive ---- */
.split-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.split-half {
    padding: var(--pad-y) var(--pad-x);
    position: relative;
    overflow: hidden;
}

/* ============================================================
   HERO
   ============================================================ */
.hero { min-height: 100vh; }

.hero-left {
    background: var(--c-earth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.hero-hangul {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(120px, 22vw, 360px);
    line-height: 0.85;
    color: var(--c-text-on-light);
    letter-spacing: -0.04em;
    margin-top: clamp(40px, 8vh, 120px);
    opacity: 0;
}
.hero-hangul.is-in { opacity: 1; transition: opacity 200ms linear; }

.hero-meta {
    font-family: var(--f-anno);
    font-size: 14px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--c-text-on-light);
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: clamp(8px, 2vh, 24px);
}
.meta-line-sub { letter-spacing: 0.6em; opacity: 0.6; }

.hero-right {
    background: var(--c-cream);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.watercolor-splash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.watercolor-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.watercolor-layer.is-in { opacity: 1; }
.watercolor-layer-1 {
    background: radial-gradient(circle at 70% 35%,
        rgba(143, 188, 143, 0.45) 0%,
        rgba(143, 188, 143, 0.18) 30%,
        rgba(143, 188, 143, 0.0) 60%);
    transition: opacity 300ms ease-in;
    transition-delay: 0ms;
}
.watercolor-layer-2 {
    background: radial-gradient(ellipse at 55% 60%,
        rgba(218, 165, 32, 0.40) 0%,
        rgba(218, 165, 32, 0.15) 35%,
        rgba(218, 165, 32, 0.0) 65%);
    transition: opacity 300ms ease-in;
    transition-delay: 200ms;
}
.watercolor-layer-3 {
    background: radial-gradient(circle at 40% 50%,
        rgba(205, 133, 63, 0.35) 0%,
        rgba(205, 133, 63, 0.15) 25%,
        rgba(205, 133, 63, 0.0) 50%);
    transition: opacity 300ms ease-in;
    transition-delay: 400ms;
}

.hero-right-content {
    position: relative;
    margin-top: clamp(60px, 12vh, 160px);
    max-width: 36ch;
    z-index: 2;
    opacity: 0;
}
.hero-right-content.is-in { opacity: 1; transition: opacity 400ms ease-in 600ms; }

.hero-romanized {
    font-family: var(--f-display);
    font-size: clamp(40px, 7vw, 96px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--c-text-on-light);
}
.hero-tagline {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(18px, 2.2vw, 28px);
    margin-top: 18px;
    color: var(--c-text-on-light);
}
.hero-note {
    font-family: var(--f-anno);
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--c-text-on-light);
    opacity: 0.7;
    margin-top: 12px;
}

.hero-coords {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-text-on-light);
    opacity: 0.55;
    margin-bottom: clamp(8px, 2vh, 24px);
}

/* ============================================================
   SECTION: 어디까지 (Where to)
   ============================================================ */
.section-where { background: var(--c-cream); }

.where-left {
    background: var(--c-earth);
    display: flex;
    flex-direction: column;
}
.where-right {
    background: var(--c-cream);
}

.section-header {
    margin-bottom: clamp(24px, 4vh, 48px);
    max-width: 56ch;
}
.section-eyebrow {
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.6;
    color: var(--c-text-on-light);
}
.section-title-ko {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(48px, 6vw, 96px);
    line-height: 1;
    margin-top: 8px;
    color: var(--c-text-on-light);
    letter-spacing: -0.02em;
}
.section-title-en {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(20px, 2.4vw, 32px);
    margin-top: 4px;
    color: var(--c-text-on-light);
    opacity: 0.8;
}
.section-desc {
    font-family: var(--f-korean);
    font-weight: 400;
    margin-top: 18px;
    color: var(--c-text-on-light);
    opacity: 0.8;
}

/* ---- Grammar cards: zero shadow, zero radius, share edges ---- */
.grammar-stack {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}
.grammar-card {
    color: var(--c-text-on-color);
    cursor: pointer;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* instant flat changes — DESIGN: no transition-duration */
    transition: none;
}
.grammar-green  { background: var(--c-green); }
.grammar-sienna { background: var(--c-sienna); }
.grammar-blue   { background: var(--c-blue); }
.grammar-umber  { background: var(--c-umber); }

/* hover swaps colour instantly to slate-blue family — DESIGN: instant */
.grammar-green:hover  { background: var(--c-blue); }
.grammar-sienna:hover { background: var(--c-umber); }
.grammar-blue:hover   { background: var(--c-green); }
.grammar-umber:hover  { background: var(--c-sienna); }

.card-inner {
    padding: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: clamp(16px, 2vw, 28px);
    row-gap: 4px;
    align-items: baseline;
}
.card-particle {
    grid-row: 1 / span 3;
    font-family: var(--f-display);
    font-size: clamp(36px, 4.5vw, 64px);
    font-weight: 800;
    line-height: 1;
    align-self: center;
    color: var(--c-text-on-color);
    opacity: 0.85;
}
.card-ko {
    font-family: var(--f-korean);
    font-weight: 700;
    font-size: clamp(22px, 2.8vw, 36px);
    color: var(--c-text-on-color);
    line-height: 1.15;
}
.card-en {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(15px, 1.6vw, 19px);
    color: var(--c-text-on-color);
    opacity: 0.92;
}
.card-foot {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-family: var(--f-anno);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--c-text-on-color);
    opacity: 0.85;
}
.card-note { font-style: italic; }
.card-counter {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: rgba(254, 252, 248, 0.18);
    padding: 4px 10px;
}

/* ---- Watercolor stage on right side ---- */
.watercolor-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: clamp(12px, 2vw, 28px);
    height: 100%;
    min-height: clamp(420px, 60vh, 720px);
}
.watercolor-pad {
    position: relative;
    overflow: hidden;
    background: var(--c-cream);
    min-height: clamp(180px, 26vh, 320px);
}
.pad-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 300ms ease-in;
}
.watercolor-pad.is-in .pad-layer-1 { opacity: 1; transition-delay: 0ms; }
.watercolor-pad.is-in .pad-layer-2 { opacity: 1; transition-delay: 200ms; }
.watercolor-pad.is-in .pad-layer-3 { opacity: 1; transition-delay: 400ms; }

/* landscape: sage horizon + gold sun + peru hill */
.pad-landscape .pad-layer-1 {
    background: radial-gradient(ellipse 120% 80% at 50% 80%,
        rgba(143, 188, 143, 0.45) 0%,
        rgba(143, 188, 143, 0.20) 40%,
        rgba(143, 188, 143, 0.0) 70%);
}
.pad-landscape .pad-layer-2 {
    background: radial-gradient(circle 35% at 70% 30%,
        rgba(218, 165, 32, 0.50) 0%,
        rgba(218, 165, 32, 0.20) 50%,
        rgba(218, 165, 32, 0.0) 80%);
    filter: blur(2px);
}
.pad-landscape .pad-layer-3 {
    background: radial-gradient(ellipse 70% 30% at 30% 70%,
        rgba(205, 133, 63, 0.30) 0%,
        rgba(205, 133, 63, 0.10) 50%,
        rgba(205, 133, 63, 0.0) 80%);
    filter: blur(3px);
}

/* clock: gold disc with peru pointer wash */
.pad-clock .pad-layer-1 {
    background: radial-gradient(circle 45% at 50% 50%,
        rgba(218, 165, 32, 0.45) 0%,
        rgba(218, 165, 32, 0.18) 55%,
        rgba(218, 165, 32, 0.0) 80%);
}
.pad-clock .pad-layer-2 {
    background: radial-gradient(circle 25% at 50% 50%,
        rgba(205, 133, 63, 0.40) 0%,
        rgba(205, 133, 63, 0.10) 50%,
        rgba(205, 133, 63, 0.0) 70%);
    filter: blur(2px);
}
.pad-clock .pad-layer-3 {
    background:
        linear-gradient(45deg, transparent 48%, rgba(45,37,24,0.35) 49%, rgba(45,37,24,0.35) 51%, transparent 52%) center/40% 6% no-repeat,
        linear-gradient(120deg, transparent 48%, rgba(45,37,24,0.30) 49%, rgba(45,37,24,0.30) 51%, transparent 52%) center/3% 30% no-repeat;
    filter: blur(1.5px);
}

/* map: sage land mass + blue water + peru border */
.pad-map .pad-layer-1 {
    background: radial-gradient(ellipse 65% 70% at 35% 45%,
        rgba(143, 188, 143, 0.50) 0%,
        rgba(143, 188, 143, 0.22) 50%,
        rgba(143, 188, 143, 0.0) 80%);
    filter: blur(1px);
}
.pad-map .pad-layer-2 {
    background: radial-gradient(ellipse 55% 60% at 75% 65%,
        rgba(74, 124, 155, 0.38) 0%,
        rgba(74, 124, 155, 0.14) 55%,
        rgba(74, 124, 155, 0.0) 80%);
    filter: blur(2px);
}
.pad-map .pad-layer-3 {
    background: radial-gradient(circle 18% at 50% 50%,
        rgba(205, 133, 63, 0.55) 0%,
        rgba(205, 133, 63, 0.0) 70%);
}

/* jar: umber jar shape with gold contents */
.pad-jar .pad-layer-1 {
    background: radial-gradient(ellipse 50% 60% at 50% 60%,
        rgba(155, 107, 74, 0.45) 0%,
        rgba(155, 107, 74, 0.18) 55%,
        rgba(155, 107, 74, 0.0) 80%);
    filter: blur(1px);
}
.pad-jar .pad-layer-2 {
    background: radial-gradient(ellipse 35% 35% at 50% 65%,
        rgba(218, 165, 32, 0.50) 0%,
        rgba(218, 165, 32, 0.15) 55%,
        rgba(218, 165, 32, 0.0) 80%);
    filter: blur(2px);
}
.pad-jar .pad-layer-3 {
    background: radial-gradient(circle 8% at 50% 30%,
        rgba(45, 37, 24, 0.50) 0%,
        rgba(45, 37, 24, 0.0) 70%);
    filter: blur(1px);
}

.pad-caption {
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    font-family: var(--f-anno);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--c-text-on-light);
    opacity: 0.75;
}

/* ============================================================
   SECTION: 얼마까지 (How far)
   ============================================================ */
.section-howfar { background: var(--c-earth); }

.howfar-left {
    background: var(--c-cream);
    display: flex;
    flex-direction: column;
}
.howfar-right {
    background: var(--c-earth);
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vh, 40px);
    justify-content: space-between;
}

.swap-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-top: 8px;
}
.swap-block {
    text-align: left;
    padding: clamp(20px, 3vw, 36px);
    color: var(--c-text-on-color);
    /* DESIGN: instant — no transition */
    transition: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: clamp(140px, 18vh, 200px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.swap-color-green  { background: var(--c-green); }
.swap-color-sienna { background: var(--c-sienna); }
.swap-color-blue   { background: var(--c-blue); }
.swap-color-umber  { background: var(--c-umber); }

/* default state-a colors via initial classes */
.swap-state-a[data-state-a-color="green"]  { background: var(--c-green); }
.swap-state-a[data-state-a-color="sienna"] { background: var(--c-sienna); }
.swap-state-a[data-state-a-color="blue"]   { background: var(--c-blue); }
.swap-state-a[data-state-a-color="umber"]  { background: var(--c-umber); }

.swap-ko {
    font-family: var(--f-korean);
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.1;
}
.swap-en {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(15px, 1.6vw, 19px);
    opacity: 0.92;
}
.swap-tag {
    margin-top: auto;
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.75;
}

/* ---- Reading block on right ---- */
.reading-block {
    background: var(--c-cream);
    color: var(--c-text-on-light);
    padding: clamp(24px, 3vw, 40px);
    max-width: 60ch;
}
.reading-eyebrow {
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-bottom: 14px;
}
.reading-line {
    font-family: var(--f-korean);
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    margin-bottom: 14px;
}
.reading-line em {
    font-style: italic;
    font-family: var(--f-anno);
    font-weight: 500;
}
.reading-pattern {
    font-family: var(--f-display);
    font-weight: 700;
    background: var(--c-earth);
    padding: 2px 8px;
}

.ledger {
    background: var(--c-blue);
    color: var(--c-text-on-color);
    padding: clamp(24px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ledger-title {
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.85;
}
.ledger-count {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(48px, 7vw, 96px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ledger-label {
    font-family: var(--f-anno);
    font-size: 13px;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

/* ============================================================
   SECTION: 끝까지 (Until the end)
   ============================================================ */
.section-end {
    position: relative;
    min-height: 100vh;
    background: var(--c-earth);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--pad-y) var(--pad-x);
    overflow: hidden;
}

.end-wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.end-wash-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 600ms ease-in;
}
.end-wash.is-in .end-layer-1 { opacity: 1; transition-delay: 0ms;   }
.end-wash.is-in .end-layer-2 { opacity: 1; transition-delay: 250ms; }
.end-wash.is-in .end-layer-3 { opacity: 1; transition-delay: 500ms; }
.end-wash.is-in .end-layer-4 { opacity: 1; transition-delay: 750ms; }

.end-layer-1 {
    background:
        radial-gradient(ellipse 80% 70% at 20% 30%,
            rgba(143, 188, 143, 0.45) 0%,
            rgba(143, 188, 143, 0.10) 50%,
            rgba(143, 188, 143, 0.0) 80%);
}
.end-layer-2 {
    background:
        radial-gradient(ellipse 70% 60% at 80% 70%,
            rgba(218, 165, 32, 0.40) 0%,
            rgba(218, 165, 32, 0.12) 50%,
            rgba(218, 165, 32, 0.0) 80%);
    filter: blur(2px);
}
.end-layer-3 {
    background:
        radial-gradient(ellipse 60% 50% at 60% 30%,
            rgba(205, 133, 63, 0.35) 0%,
            rgba(205, 133, 63, 0.10) 50%,
            rgba(205, 133, 63, 0.0) 80%);
    filter: blur(3px);
}
.end-layer-4 {
    background:
        radial-gradient(ellipse 90% 60% at 50% 90%,
            rgba(155, 107, 74, 0.30) 0%,
            rgba(155, 107, 74, 0.08) 50%,
            rgba(155, 107, 74, 0.0) 80%);
    filter: blur(4px);
}

.end-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 50ch;
}
.end-eyebrow {
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.7;
    color: var(--c-text-on-light);
}
.end-title {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(64px, 10vw, 168px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--c-text-on-light);
    margin-top: 16px;
}
.end-sub {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(20px, 2.4vw, 32px);
    color: var(--c-text-on-light);
    margin-top: 16px;
}
.end-tag {
    font-family: var(--f-anno);
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--c-text-on-light);
    opacity: 0.7;
    margin-top: 18px;
}

.end-footer {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: clamp(40px, 8vh, 96px);
    display: flex;
    justify-content: space-between;
    font-family: var(--f-anno);
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-text-on-light);
    opacity: 0.65;
}
.end-footer span { white-space: nowrap; }

/* ============================================================
   Responsive: collapse split-screens on small viewports
   ============================================================ */
@media (max-width: 820px) {
    .split-screen { grid-template-columns: 1fr; }
    .split-half   { min-height: auto; }
    .hero { min-height: 100vh; }
    .hero-left { min-height: 60vh; }
    .hero-right { min-height: 50vh; }
    .watercolor-stage { grid-template-columns: 1fr; grid-template-rows: repeat(4, minmax(180px, 1fr)); }
    .swap-board { grid-template-columns: 1fr; }
    .end-footer { flex-direction: column; gap: 8px; align-items: center; }
}
