:root {
    --void: #0b0c2a;
    --plum: #1a0b2e;
    --ocean: #0b1a2e;
    --deep: #0f1a28;
    --neon-teal: #00e6a7;
    --neon-violet: #b24bf3;
    --neon-rose: #ff6b9d;
    --ash: #d4cfc7;
    --mist: #8a8b9e;
    --gold: #d4a853;
    --aurora-main: linear-gradient(170deg, var(--void) 0%, var(--plum) 35%, var(--ocean) 70%, var(--deep) 100%);
    --aurora-band: linear-gradient(90deg, var(--neon-teal) 0%, var(--neon-violet) 50%, var(--neon-rose) 100%);
    --aurora-shift: linear-gradient(135deg, var(--ocean), var(--plum), var(--void), var(--plum), var(--ocean));
}

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

body {
    background: var(--aurora-shift);
    background-size: 400% 400%;
    animation: auroraShift 20s ease infinite;
    color: var(--ash);
    font-family: 'Lora', serif;
    overflow-x: hidden;
    will-change: background-position;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(212, 168, 83, 0.04) 39px, rgba(212, 168, 83, 0.04) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(212, 168, 83, 0.04) 39px, rgba(212, 168, 83, 0.04) 40px);
    transform: rotate(0.3deg);
    pointer-events: none;
    z-index: 0;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Layers */
.layer {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: clamp(8rem, 15vh, 12rem) 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

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

.layer-content {
    margin-left: 8vw;
    margin-right: auto;
    max-width: 60ch;
    position: relative;
}

/* Surface Layer */
.surface-layer {
    background: var(--aurora-main);
    min-height: 100vh;
    justify-content: center;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    color: var(--ash);
    line-height: 1.1;
    animation: neon-pulse 4s ease-in-out infinite;
}

.hero-title .char {
    display: inline-block;
    animation: dissolve 8s ease-in-out infinite;
}

@keyframes dissolve {
    0%, 100% { opacity: 1; filter: blur(0); transform: translate(0, 0); }
    30% { opacity: 0.85; filter: blur(0.5px); transform: translate(0, 1px); }
    50% { opacity: 0.4; filter: blur(1px); transform: translate(0, 2px); }
    70% { opacity: 0.7; filter: blur(0.5px); transform: translate(0, 1px); }
}

@keyframes neon-pulse {
    0%, 100% { text-shadow: 0 0 7px var(--neon-teal), 0 0 20px rgba(0,230,167,0.5), 0 0 60px rgba(0,230,167,0.15); }
    50% { text-shadow: 0 0 10px var(--neon-teal), 0 0 30px rgba(0,230,167,0.6), 0 0 100px rgba(0,230,167,0.25); }
}

.hero-sub {
    font-family: 'Inconsolata', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--mist);
    opacity: 0.6;
    margin-top: 2rem;
}

/* Kintsugi cracks */
.kintsugi-crack {
    display: block;
    width: 100%;
    height: 20px;
    position: relative;
    z-index: 1;
}

/* Erosion Layer */
.erosion-layer {
    background: linear-gradient(170deg, var(--plum), var(--ocean) 60%, var(--deep));
    position: relative;
}

.erosion-text p {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.75;
    margin-bottom: 2rem;
    color: var(--ash);
}

.erosion-text p:nth-child(1) { line-height: 1.72; }
.erosion-text p:nth-child(2) { line-height: 1.78; }
.erosion-text p:nth-child(3) { line-height: 1.75; }
.erosion-text p:nth-child(4) { line-height: 1.72; }
.erosion-text p:nth-child(5) { line-height: 1.78; }

.dot-matrix-left,
.dot-matrix-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15vw;
    background: radial-gradient(circle 1.5px, rgba(138, 139, 158, 0.06) 100%, transparent 100%);
    background-size: 8px 8px;
    pointer-events: none;
}

.dot-matrix-left { left: -8vw; }
.dot-matrix-right { right: -15vw; }

/* Section titles */
.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--ash);
    margin-bottom: 3rem;
    animation: neon-pulse 4s ease-in-out infinite;
}

/* Transformation Layer */
.transformation-layer {
    background: linear-gradient(170deg, var(--void), var(--plum));
    position: relative;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
}

.aurora-bands {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.aurora-band {
    width: 100%;
    height: 33.33%;
    opacity: 0.15;
    animation: bandShift 12s ease-in-out infinite;
}

.band-1 {
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-violet));
    animation-delay: 0s;
}

.band-2 {
    background: linear-gradient(90deg, var(--neon-violet), var(--neon-rose));
    animation-delay: -4s;
}

.band-3 {
    background: linear-gradient(90deg, var(--neon-rose), var(--neon-teal));
    animation-delay: -8s;
}

@keyframes bandShift {
    0%, 100% { opacity: 0.12; transform: translateX(0); }
    50% { opacity: 0.22; transform: translateX(-5%); }
}

.transformation-content {
    position: relative;
    z-index: 1;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.fragment {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    color: var(--ash);
    opacity: 0.8;
    display: block;
    padding: 1rem 0;
}

.frag-1 { transform: rotate(-0.4deg) translateX(2rem); }
.frag-2 { transform: rotate(0.6deg) translateX(-1rem); }
.frag-3 { transform: rotate(-0.2deg) translateX(5rem); font-family: 'Inconsolata', monospace; font-style: normal; color: var(--neon-teal); opacity: 0.7; }
.frag-4 { transform: rotate(0.3deg) translateX(0.5rem); }
.frag-5 { transform: rotate(-0.5deg) translateX(3rem); font-family: 'Inconsolata', monospace; font-style: normal; color: var(--neon-teal); opacity: 0.7; }
.frag-6 { transform: rotate(0.4deg) translateX(-0.5rem); }

/* Renewal Layer */
.renewal-layer {
    background: var(--void);
    justify-content: center;
    text-align: center;
}

.renewal-content {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.recycle-glyph {
    font-size: clamp(5rem, 12vw, 10rem);
    color: var(--neon-teal);
    text-shadow: 0 0 10px var(--neon-teal), 0 0 30px rgba(0,230,167,0.5), 0 0 80px rgba(0,230,167,0.2);
    animation: glyphPulse 4s ease-in-out infinite;
    line-height: 1;
    margin-bottom: 3rem;
}

@keyframes glyphPulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--neon-teal), 0 0 30px rgba(0,230,167,0.5), 0 0 80px rgba(0,230,167,0.2); }
    50% { opacity: 0.2; text-shadow: 0 0 4px var(--neon-teal), 0 0 10px rgba(0,230,167,0.2); }
}

.renewal-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--ash);
    min-height: 2em;
}

.renewal-text .reveal-char {
    opacity: 0;
    transition: opacity 150ms ease;
}

.renewal-text .reveal-char.shown {
    opacity: 1;
}

.timestamp {
    font-family: 'Inconsolata', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--mist);
    opacity: 0.6;
    display: block;
    margin-top: 3rem;
}

/* Renewal inverted grid */
.renewal-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(212, 168, 83, 0.06) 39px, rgba(212, 168, 83, 0.06) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(212, 168, 83, 0.06) 39px, rgba(212, 168, 83, 0.06) 40px);
    transform: rotate(-0.3deg);
    pointer-events: none;
    z-index: 0;
}

/* Archive Layer */
.archive-layer {
    background: linear-gradient(170deg, var(--void), var(--plum) 50%, var(--ocean));
    flex-direction: column;
    justify-content: center;
}

.archive-cards {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.archive-card {
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.card-1 {
    background: linear-gradient(135deg, rgba(0, 230, 167, 0.08), rgba(11, 12, 42, 0.9));
    border-radius: 12px 8px 14px 6px;
    transform: rotate(-0.3deg);
}

.card-2 {
    background: linear-gradient(135deg, rgba(178, 75, 243, 0.08), rgba(26, 11, 46, 0.9));
    border-radius: 8px 14px 6px 12px;
    transform: rotate(0.5deg);
}

.card-3 {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(11, 26, 46, 0.9));
    border-radius: 14px 6px 12px 8px;
    transform: rotate(-0.4deg);
}

.card-4 {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08), rgba(15, 26, 40, 0.9));
    border-radius: 6px 12px 8px 14px;
    transform: rotate(0.3deg);
}

.card-5 {
    background: linear-gradient(135deg, rgba(0, 230, 167, 0.06), rgba(178, 75, 243, 0.06), rgba(11, 12, 42, 0.9));
    border-radius: 10px 14px 8px 12px;
    transform: rotate(-0.2deg);
}

.card-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.75;
    color: var(--ash);
    margin-bottom: 1.5rem;
}

.card-meta {
    font-family: 'Inconsolata', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--mist);
    opacity: 0.6;
}

/* Cursor trail */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.trail-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neon-teal);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
    will-change: transform, opacity;
}
