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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #e8e6e1;
    color: #3a3a42;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === SVG Filters (hidden) === */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === Ripple Container === */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.compliance-token {
    display: none;
}

.ripple {
    position: absolute;
    width: 4px;
    height: 4px;
    border: 1.5px solid rgba(192, 192, 204, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform 1200ms ease-out, opacity 1200ms ease-out;
    pointer-events: none;
}

.ripple.active {
    transform: translate(-50%, -50%) scale(15);
    opacity: 0;
}

/* === Zones === */
.zone {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#hero-zone {
    margin-bottom: 40vh;
}

#examination-zone {
    margin-bottom: 40vh;
}

/* === Zone Dividers === */
.zone-divider {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 2;
}

.flowing-curve {
    animation: undulate 8s ease-in-out infinite;
}

.flowing-curve-2 {
    animation: undulate2 10s ease-in-out infinite;
}

@keyframes undulate {
    0%, 100% { d: path("M0,60 C240,20 480,100 720,60 C960,20 1200,100 1440,60"); }
    50% { d: path("M0,60 C240,90 480,30 720,70 C960,100 1200,20 1440,60"); }
}

@keyframes undulate2 {
    0%, 100% { d: path("M0,80 C360,30 720,110 1080,50 C1260,20 1380,90 1440,60"); }
    50% { d: path("M0,40 C360,100 720,20 1080,80 C1260,100 1380,30 1440,60"); }
}

/* === Chrome Surface === */
.chrome-surface {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse at 30% 40%, #ffffff 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, #c0c0cc 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, #e8e6e1 0%, #c0c0cc 70%, #3a3a42 100%);
    overflow: hidden;
}

.caustic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#caustic-filter);
    background: linear-gradient(135deg, #e8e6e1 0%, #c0c0cc 50%, #e8e6e1 100%);
    opacity: 0.6;
    pointer-events: none;
}

/* === Hero Content === */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(6rem, 18vw, 20rem);
    letter-spacing: 0.08em;
    color: #2c2c34;
    filter: url(#liquid-filter);
    will-change: filter;
    line-height: 1.1;
    background: linear-gradient(180deg, #3a3a42 0%, #2c2c34 40%, #c0c0cc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: filter 0.1s;
}

.hero-title.resolved {
    filter: none;
}

.hero-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2.5vw, 1.75rem);
    color: #7b8fa8;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease;
    letter-spacing: 0.05em;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* === Background Curves === */
.bg-curves {
    position: fixed;
    right: 0;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* === Examination Zone === */
.examination-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.zone-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: #7b8fa8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* === Bubble Field === */
.bubble-field {
    width: 100%;
    min-height: 300px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* === Word Bubbles === */
.word-bubble {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c0c0cc 40%, #3a3a42 100%);
    backdrop-filter: blur(2px);
    cursor: default;
    transform: scale(0);
    animation: bubbleSpawn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow:
        0 4px 20px rgba(44, 44, 52, 0.2),
        inset 0 -2px 6px rgba(44, 44, 52, 0.15),
        inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

.word-bubble.charged {
    filter: url(#bubble-glow-warm);
}

.word-bubble.neutral {
    filter: url(#bubble-glow-cool);
}

.word-bubble .bubble-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    color: #2c2c34;
    opacity: 0;
    text-align: center;
    padding: 0.25rem;
    word-break: break-all;
    max-width: 80%;
}

.word-bubble .bubble-text.visible {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.word-bubble .scan-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: conic-gradient(from 0deg, #d4944a, transparent 30%, transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
}

.word-bubble .scan-ring.scanning {
    opacity: 1;
    animation: scanRotate 0.4s linear forwards;
}

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

@keyframes bubbleSpawn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* === Bubble size variations === */
.word-bubble.size-sm { width: 80px; height: 80px; }
.word-bubble.size-md { width: 100px; height: 100px; }
.word-bubble.size-lg { width: 120px; height: 120px; }

/* === Chrome Input === */
.input-area {
    width: 100%;
    max-width: 700px;
    position: relative;
}

.chrome-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: #2c2c34;
    background: linear-gradient(135deg, #e8e6e1 0%, #c0c0cc 50%, #e8e6e1 100%);
    border: none;
    border-bottom: 4px solid #d4944a;
    outline: none;
    letter-spacing: 0.02em;
    transition: background 0.3s ease;
}

.chrome-input::placeholder {
    color: #7b8fa8;
    opacity: 0.7;
}

.chrome-input:focus {
    background: linear-gradient(135deg, #f5edd6 0%, #e8e6e1 50%, #c0c0cc 100%);
}

/* === Analysis Readout === */
.analysis-readout {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: #7b8fa8;
    text-align: center;
    min-height: 1.5em;
    opacity: 0.8;
}

/* === Closing Zone === */
.closing-surface {
    flex-direction: column;
}

.closing-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
}

.reassembled-text {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #2c2c34;
    margin-bottom: 4rem;
    opacity: 0;
    transition: opacity 1.5s ease, transform 1.5s ease;
    transform: translateY(0);
}

.reassembled-text.visible {
    opacity: 1;
}

.reassembled-text.sinking {
    opacity: 0;
    transform: translateY(40px);
    filter: url(#liquid-filter);
}

.proverb {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 5vw, 4rem);
    color: #2c2c34;
    letter-spacing: 0.03em;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 2s ease;
    text-shadow: 0 0 40px rgba(245, 237, 214, 0.6), 0 0 80px rgba(245, 237, 214, 0.3);
}

.proverb.visible {
    opacity: 1;
}

.proverb-translation {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: #7b8fa8;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 2s ease 0.5s;
    letter-spacing: 0.05em;
}

.proverb-translation.visible {
    opacity: 1;
}

/* === Responsive === */
@media (max-width: 640px) {
    .bubble-field {
        gap: 0.6rem;
    }

    .word-bubble { width: 70px; height: 70px; }
    .word-bubble.size-sm { width: 60px; height: 60px; }
    .word-bubble.size-md { width: 75px; height: 75px; }
    .word-bubble.size-lg { width: 90px; height: 90px; }

    #hero-zone { margin-bottom: 20vh; }
    #examination-zone { margin-bottom: 20vh; }
}
