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

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

body {
    background: #0a0a0f;
    color: #c0c0c8;
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
    /* palette: #1a1a24 #4a6fa5 #b8a060 #e0e0eb */
}

/* Progress Thread */
#progress-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 1000;
    background: #0a0a0f;
    pointer-events: none;
}

#progress-thread::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #0a0a0f, #c0c0c8);
    transition: width 0.05s linear;
}

/* Title Card */
#title-card {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    position: relative;
}

#title-content {
    text-align: center;
    width: 100%;
}

#logotype {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(7rem, 20vw, 18rem);
    letter-spacing: -0.06em;
    line-height: 1;
    background: linear-gradient(135deg, #6b6b7b, #e8e8ef, #8a8a9a, #f0f0f5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: transform;
}

#title-wave {
    width: 80%;
    height: 80px;
    margin: 2rem auto 0;
    display: block;
}

/* Manifesto */
#manifesto {
    position: relative;
}

.manifesto-panel {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.manifesto-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 4vw, 3rem);
    line-height: 1.6;
    text-align: center;
    color: #c0c0c8;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    max-width: 800px;
}

.manifesto-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mechanism */
#mechanism {
    height: 150vh;
    position: relative;
    background: #2a2a38;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#dot-grid {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(circle, #7a7a8f 1px, transparent 1px);
    background-size: 40px 40px;
}

#puzzle-container {
    width: min(80vw, 800px);
    height: auto;
    position: relative;
    z-index: 2;
    will-change: transform;
}

.puzzle-piece {
    will-change: transform;
    transition: none;
}

#seam-flash-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.seam-flash {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 160, 96, 0.6), rgba(184, 160, 96, 0));
    filter: blur(8px);
    animation: flashFade 300ms ease-out forwards;
    pointer-events: none;
}

@keyframes flashFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

@keyframes jitter {
    0% { transform: translateX(0); }
    25% { transform: translateX(2px); }
    50% { transform: translateX(-2px); }
    75% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

.jitter {
    animation: jitter 80ms ease-in-out;
}

#oscilloscope {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 2;
}

/* Signal */
#signal {
    min-height: 100vh;
    background: #0a0a0f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 4rem;
}

.wave-row {
    position: relative;
}

.wave-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #7a7a8f;
    display: block;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
}

.signal-wave {
    width: 100%;
    height: 100px;
}

/* Close */
#close {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
}

#close-content {
    text-align: center;
}

#close-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #c0c0c8;
    margin-bottom: 0.5rem;
}

#close-domain {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    color: #7a7a8f;
    margin-bottom: 2rem;
}

#close-wave {
    width: 300px;
    height: 60px;
    display: block;
    margin: 0 auto;
}
