/* namu.works - Wabi-sabi Ceramics Workshop at Midnight */

:root {
    --kiln-black: #1a1631;
    --clay-cream: #f0e6d8;
    --slip-violet: #b47eff;
    --glaze-teal: #2df5c8;
    --ember-amber: #ffb347;
    --warm-ash: #d9cfc2;
    --kiln-smoke: #8a8078;
    --crackle: #3d3530;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--kiln-black);
    color: var(--warm-ash);
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   ZONE 1: THE DOOR
   ============================================ */

.zone-door {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--kiln-black);
    overflow: hidden;
}

.door-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.door-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-variation-settings: 'WONK' 1, 'opsz' 48;
    font-size: clamp(3rem, 10vw, 7rem);
    color: var(--slip-violet);
    letter-spacing: 0.02em;
    line-height: 1.05;
    opacity: 0;
    animation: door-fade-in 2s ease-out 0.6s forwards;
    text-shadow: 0 0 7px var(--slip-violet), 0 0 20px rgba(180, 126, 255, 0.4), 0 0 40px rgba(180, 126, 255, 0.15);
    will-change: opacity;
}

@keyframes door-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.door-title.glow-active {
    animation: door-fade-in 2s ease-out 0.6s forwards, glow-breathe 4s ease-in-out 2.6s infinite;
}

@keyframes glow-breathe {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.door-subtitle {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--warm-ash);
    margin-top: 1.2rem;
    opacity: 0;
    animation: door-fade-in 1.5s ease-out 1.8s forwards;
    letter-spacing: 0.03em;
}

/* ============================================
   CRACKLE OVERLAYS
   ============================================ */

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

.crackle-v1 {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cpath d='M12 5 Q30 45 55 38' stroke='%233d3530' stroke-width='0.7' fill='none'/%3E%3Cpath d='M0 80 Q25 65 48 90 Q70 110 95 85' stroke='%233d3530' stroke-width='0.5' fill='none'/%3E%3Cpath d='M60 0 Q75 30 68 55 Q62 80 80 95' stroke='%233d3530' stroke-width='0.8' fill='none'/%3E%3Cpath d='M120 10 Q140 35 125 60 Q110 85 135 100' stroke='%233d3530' stroke-width='0.6' fill='none'/%3E%3Cpath d='M150 0 Q165 25 155 50 Q148 75 170 90' stroke='%233d3530' stroke-width='0.9' fill='none'/%3E%3Cpath d='M180 20 Q195 50 185 80' stroke='%233d3530' stroke-width='0.5' fill='none'/%3E%3Cpath d='M0 130 Q20 115 45 140 Q65 160 90 145' stroke='%233d3530' stroke-width='0.7' fill='none'/%3E%3Cpath d='M100 120 Q120 145 115 170 Q110 195 130 200' stroke='%233d3530' stroke-width='0.6' fill='none'/%3E%3C/svg%3E") repeat;
    opacity: 0;
    animation: crackle-fade 3s ease-out 1.5s forwards;
}

.crackle-v2 {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cpath d='M20 10 Q45 40 30 65 Q15 90 40 105' stroke='%233d3530' stroke-width='0.6' fill='none'/%3E%3Cpath d='M80 0 Q95 28 82 55 Q70 82 90 100' stroke='%233d3530' stroke-width='0.8' fill='none'/%3E%3Cpath d='M140 15 Q155 42 148 68 Q140 95 160 110' stroke='%233d3530' stroke-width='0.5' fill='none'/%3E%3Cpath d='M0 60 Q22 48 40 65 Q58 82 50 100' stroke='%233d3530' stroke-width='0.7' fill='none'/%3E%3Cpath d='M100 55 Q118 40 130 62 Q142 84 135 105' stroke='%233d3530' stroke-width='0.9' fill='none'/%3E%3Cpath d='M10 140 Q28 125 45 145 Q62 165 55 185' stroke='%233d3530' stroke-width='0.7' fill='none'/%3E%3C/svg%3E") repeat;
    opacity: 0.08;
}

.crackle-v3 {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cpath d='M5 20 Q25 5 42 25 Q58 48 48 68 Q38 88 55 100' stroke='%233d3530' stroke-width='0.7' fill='none'/%3E%3Cpath d='M70 8 Q88 30 78 55 Q68 78 85 95 Q102 112 95 135' stroke='%233d3530' stroke-width='0.5' fill='none'/%3E%3Cpath d='M130 0 Q148 22 138 48 Q128 72 145 88' stroke='%233d3530' stroke-width='0.8' fill='none'/%3E%3Cpath d='M0 110 Q18 95 35 112 Q52 130 45 152' stroke='%233d3530' stroke-width='0.9' fill='none'/%3E%3Cpath d='M90 120 Q108 105 122 125 Q135 148 128 168' stroke='%233d3530' stroke-width='0.5' fill='none'/%3E%3C/svg%3E") repeat;
    opacity: 0.08;
}

.crackle-intense {
    opacity: 0.2;
}

@keyframes crackle-fade {
    0% { opacity: 0; }
    100% { opacity: 0.08; }
}

/* ============================================
   NOISE OVERLAY
   ============================================ */

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='12' cy='8' r='0.6' fill='%238a8078' opacity='0.15'/%3E%3Ccircle cx='45' cy='22' r='0.4' fill='%238a8078' opacity='0.12'/%3E%3Ccircle cx='78' cy='15' r='0.5' fill='%238a8078' opacity='0.1'/%3E%3Ccircle cx='25' cy='48' r='0.7' fill='%238a8078' opacity='0.13'/%3E%3Ccircle cx='62' cy='55' r='0.4' fill='%238a8078' opacity='0.11'/%3E%3Ccircle cx='90' cy='42' r='0.6' fill='%238a8078' opacity='0.14'/%3E%3Ccircle cx='8' cy='72' r='0.5' fill='%238a8078' opacity='0.1'/%3E%3Ccircle cx='38' cy='85' r='0.4' fill='%238a8078' opacity='0.12'/%3E%3Ccircle cx='72' cy='78' r='0.6' fill='%238a8078' opacity='0.13'/%3E%3C/svg%3E") repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   BUBBLE ZONES
   ============================================ */

.bubble-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.zone-door > .bubble-zone {
    z-index: 1;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    pointer-events: none;
}

/* ============================================
   WORKSHOP GRID
   ============================================ */

.zone-workshop {
    position: relative;
    padding: clamp(24px, 4vw, 48px);
    background-color: var(--kiln-black);
}

.workshop-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(12px, 2vw, 24px);
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   BLOCK TYPES
   ============================================ */

.block {
    position: relative;
    overflow: hidden;
}

/* Block Type A: Slab */
.block-slab {
    background-color: var(--clay-cream);
    padding: clamp(2rem, 4vw, 3.5rem);
    clip-path: polygon(0.5% 0%, 100% 0.3%, 99.5% 100%, 0% 99.7%);
    min-height: 280px;
}

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

/* Block Type B: Tile */
.block-tile {
    background-color: var(--kiln-black);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    min-height: 160px;
    display: flex;
    align-items: center;
}

.tile-border-left {
    border-left: 2px solid var(--glaze-teal);
}

.tile-border-right {
    border-right: 2px solid var(--ember-amber);
}

.tile-border-bottom {
    border-bottom: 2px solid var(--slip-violet);
}

[data-accent="violet"].tile-border-left { border-left-color: var(--slip-violet); }
[data-accent="teal"].tile-border-left { border-left-color: var(--glaze-teal); }
[data-accent="amber"].tile-border-left { border-left-color: var(--ember-amber); }
[data-accent="violet"].tile-border-right { border-right-color: var(--slip-violet); }
[data-accent="teal"].tile-border-right { border-right-color: var(--glaze-teal); }
[data-accent="amber"].tile-border-right { border-right-color: var(--ember-amber); }
[data-accent="violet"].tile-border-bottom { border-bottom-color: var(--slip-violet); }
[data-accent="teal"].tile-border-bottom { border-bottom-color: var(--glaze-teal); }
[data-accent="amber"].tile-border-bottom { border-bottom-color: var(--ember-amber); }

/* Neon glow for tile borders */
.tile-border-left[data-accent="teal"] {
    box-shadow: inset 2px 0 8px rgba(45, 245, 200, 0.15);
}
.tile-border-left[data-accent="violet"] {
    box-shadow: inset 2px 0 8px rgba(180, 126, 255, 0.15);
}
.tile-border-left[data-accent="amber"] {
    box-shadow: inset 2px 0 8px rgba(255, 179, 71, 0.15);
}
.tile-border-right[data-accent="amber"] {
    box-shadow: inset -2px 0 8px rgba(255, 179, 71, 0.15);
}
.tile-border-right[data-accent="violet"] {
    box-shadow: inset -2px 0 8px rgba(180, 126, 255, 0.15);
}
.tile-border-bottom[data-accent="violet"] {
    box-shadow: inset 0 -2px 8px rgba(180, 126, 255, 0.15);
}

/* Block Type C: Fragment */
.block-fragment {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fragment-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: clamp(4rem, 10vw, 8rem);
    opacity: 0.4;
    position: relative;
    z-index: 2;
}

.fragment-char-violet {
    color: var(--slip-violet);
    text-shadow: 0 0 7px var(--slip-violet), 0 0 20px rgba(180, 126, 255, 0.3);
}

/* Block Type D: Void */
.block-void {
    position: relative;
    min-height: 80px;
}

/* ============================================
   WATERMARKS
   ============================================ */

.watermark-kr {
    position: absolute;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 100;
    font-size: clamp(8rem, 20vw, 16rem);
    color: var(--crackle);
    opacity: 0.12;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    line-height: 1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.headline {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-variation-settings: 'WONK' 1, 'opsz' 48;
    font-size: clamp(2.4rem, 7vw, 5rem);
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.headline-violet {
    color: var(--slip-violet);
    text-shadow: 0 0 7px var(--slip-violet), 0 0 20px rgba(180, 126, 255, 0.4), 0 0 40px rgba(180, 126, 255, 0.15);
}

.headline-teal {
    color: var(--glaze-teal);
    text-shadow: 0 0 7px var(--glaze-teal), 0 0 20px rgba(45, 245, 200, 0.4), 0 0 40px rgba(45, 245, 200, 0.15);
}

.headline-amber {
    color: var(--ember-amber);
    text-shadow: 0 0 7px var(--ember-amber), 0 0 20px rgba(255, 179, 71, 0.4), 0 0 40px rgba(255, 179, 71, 0.15);
}

.headline-final {
    font-size: clamp(6rem, 18vw, 14rem);
    text-align: center;
    animation: glow-breathe 4s ease-in-out infinite;
    will-change: opacity;
}

.tile-heading {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-variation-settings: 'WONK' 1, 'opsz' 36;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin-bottom: 0.8rem;
    color: var(--clay-cream);
}

.body-text {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.01em;
}

.body-dark {
    color: var(--kiln-black);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
}

.body-light {
    color: var(--clay-cream);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
}

/* ============================================
   REVEAL ANIMATION
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   UNDERLINE-DRAW (only hover interaction)
   ============================================ */

a, .interactive-link {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(var(--glaze-teal), var(--glaze-teal)) no-repeat left bottom / 0% 1.5px;
    transition: background-size 0.4s ease-out;
    padding-bottom: 2px;
}

a:hover, .interactive-link:hover {
    background-size: 100% 1.5px;
}

/* ============================================
   ZONE 3: THE KILN
   ============================================ */

.zone-kiln {
    position: relative;
    padding: clamp(24px, 4vw, 48px);
    padding-bottom: 0;
    background-color: var(--kiln-black);
    overflow: hidden;
}

.kiln-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(12px, 2vw, 24px);
    max-width: 1400px;
    margin: 0 auto;
}

.kiln-void {
    min-height: 120px;
}

.kiln-final {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.kiln-final .block-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
}

.kiln-ending {
    position: relative;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ending-text {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--kiln-smoke);
    opacity: 0.4;
    text-align: center;
    position: relative;
    z-index: 2;
    letter-spacing: 0.05em;
}

/* ============================================
   NAVIGATION DOTS
   ============================================ */

.nav-dots {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    padding: 0;
}

.nav-dot-violet {
    background-color: var(--slip-violet);
    box-shadow: 0 0 6px var(--slip-violet), 0 0 12px rgba(180, 126, 255, 0.3);
}

.nav-dot-teal {
    background-color: var(--glaze-teal);
    box-shadow: 0 0 6px var(--glaze-teal), 0 0 12px rgba(45, 245, 200, 0.3);
}

.nav-dot-amber {
    background-color: var(--ember-amber);
    box-shadow: 0 0 6px var(--ember-amber), 0 0 12px rgba(255, 179, 71, 0.3);
}

.nav-dot:hover {
    transform: scale(1.3);
}

.nav-dot-label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Karla', sans-serif;
    font-size: 0.75rem;
    color: var(--warm-ash);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(var(--glaze-teal), var(--glaze-teal)) no-repeat left bottom / 0% 1px;
    padding-bottom: 2px;
    transition: opacity 0.3s ease, background-size 0.4s ease-out;
}

.nav-dot:hover .nav-dot-label {
    opacity: 1;
    background-size: 100% 1px;
}

/* ============================================
   MOBILE (below 768px)
   ============================================ */

@media (max-width: 768px) {
    .workshop-grid,
    .kiln-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .workshop-grid .block-slab {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .workshop-grid .block-tile {
        grid-column: span 3 !important;
        grid-row: auto !important;
    }

    .workshop-grid .block-fragment {
        grid-column: span 2 !important;
        grid-row: auto !important;
    }

    .workshop-grid .block-void {
        grid-column: span 2 !important;
        grid-row: auto !important;
        min-height: 40px;
    }

    .kiln-grid .block-slab {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .kiln-grid .block-tile {
        grid-column: span 3 !important;
        grid-row: auto !important;
    }

    .kiln-grid .block-void {
        grid-column: span 2 !important;
        grid-row: auto !important;
        min-height: 40px;
    }

    .headline {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .headline-final {
        font-size: clamp(5rem, 20vw, 10rem);
    }

    .watermark-kr {
        font-size: clamp(5rem, 30vw, 10rem);
    }
}
