/* tnhec.com - The Never Happy Ending Chronicle */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --royal-violet: #6838A8;
    --dark-purple: #3A2838;
    --gold: #C8A838;
    --muted-mauve: #7A6878;
    --teal: #38A8A8;
    --warm-white: #FBF8F5;
    --deep-noir: #2A1830;
}

body {
    background: var(--deep-noir);
    color: var(--dark-purple);
    font-family: 'Literata', serif;
    font-size: 1.0625rem;
    line-height: 1.85;
    font-weight: 400;
    overflow-x: hidden;
}

/* Opening Ripple */
.opening-ripple {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--deep-noir);
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.opening-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--warm-white) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: rippleExpand 1.5s ease forwards;
}
@keyframes rippleExpand {
    to {
        width: 300vmax;
        height: 300vmax;
    }
}
.opening-ripple.done {
    opacity: 0;
}

/* Hero Sections */
.hero-section {
    width: 100%;
    height: 80vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--warm-white) 0%, #F0EDE8 100%);
}

/* Isometric Scenes */
.isometric-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}
.iso-ground {
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #E8E0D8 0%, #D8D0C8 100%);
    transform: rotateX(60deg) rotateZ(-45deg);
    bottom: 15%;
}
.ground-2 { background: linear-gradient(135deg, #D8D0E8 0%, #C8C0D8 100%); }
.ground-3 { background: linear-gradient(135deg, #D8E8E0 0%, #C8D8D0 100%); }
.ground-4 { background: linear-gradient(135deg, #E8E0D0 0%, #D8D0C0 100%); }
.ground-5 { background: linear-gradient(135deg, #E0D8E8 0%, #D0C8D8 100%); }

.iso-building {
    position: absolute;
    width: 60px;
    height: 100px;
    transform: rotateX(60deg) rotateZ(-45deg);
}
.building-1 { background: var(--royal-violet); bottom: 35%; left: 35%; height: 120px; }
.building-2 { background: var(--gold); bottom: 30%; left: 50%; height: 80px; width: 50px; }
.building-3 { background: var(--teal); bottom: 35%; left: 30%; height: 100px; }
.building-4 { background: var(--muted-mauve); bottom: 30%; left: 55%; height: 70px; width: 45px; }
.building-5 { background: var(--gold); bottom: 35%; left: 40%; height: 90px; }
.building-6 { background: var(--royal-violet); bottom: 32%; left: 35%; height: 110px; }
.building-7 { background: var(--teal); bottom: 28%; left: 52%; height: 75px; width: 50px; }
.building-8 { background: var(--muted-mauve); bottom: 35%; left: 42%; height: 95px; }

.iso-tree {
    position: absolute;
    width: 20px;
    height: 40px;
    transform: rotateX(60deg) rotateZ(-45deg);
}
.iso-tree::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 15px;
    background: #8A6848;
}
.iso-tree::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 28px solid #5A8848;
}
.tree-1 { bottom: 25%; left: 25%; }
.tree-2 { bottom: 22%; left: 65%; }
.tree-3 { bottom: 25%; left: 45%; }
.tree-4 { bottom: 28%; left: 25%; }
.tree-5 { bottom: 22%; left: 60%; }
.tree-6 { bottom: 25%; left: 58%; }

.iso-character {
    position: absolute;
    width: 16px;
    height: 32px;
    background: var(--deep-noir);
    border-radius: 8px 8px 4px 4px;
    transform: rotateX(60deg) rotateZ(-45deg);
}
.iso-character::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--deep-noir);
    border-radius: 50%;
}
.char-1 { bottom: 28%; left: 45%; }
.char-2 { bottom: 26%; left: 40%; }
.char-3 { bottom: 24%; left: 48%; }
.char-4 { bottom: 26%; left: 45%; }
.char-5 { bottom: 28%; left: 42%; }
.char-6 { bottom: 26%; left: 38%; }
.char-7 { bottom: 24%; left: 50%; }

/* Kinetic Title */
.kinetic-title {
    position: relative;
    z-index: 2;
    font-family: 'Righteous', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    color: var(--gold);
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
#main-title {
    font-size: clamp(3rem, 8vw, 6rem);
}
.letter {
    display: inline-block;
    opacity: 0;
    transform: rotateX(-90deg);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.letter.visible {
    opacity: 1;
    transform: rotateX(0deg);
}
.chapter-heading {
    color: var(--deep-noir);
    font-size: clamp(2rem, 5vw, 4rem);
}

.subtitle {
    position: relative;
    z-index: 2;
    font-family: 'Literata', serif;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--muted-mauve);
    text-align: center;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 1s ease;
}
.subtitle.visible { opacity: 1; }

/* Wave Dividers */
.wave-divider {
    width: 100%;
    height: 60px;
    background: var(--warm-white);
    overflow: hidden;
}
.wave-divider svg {
    width: 100%;
    height: 100%;
}
.wave-path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 1.5s ease;
}
.wave-path.animated {
    stroke-dashoffset: 0;
}

/* Text Sections */
.text-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: var(--warm-white);
    text-align: left;
}
.chapter-note {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted-mauve);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
}
.story-text {
    font-family: 'Literata', serif;
    font-size: 1.0625rem;
    color: var(--dark-purple);
    line-height: 1.85;
    margin-bottom: 1.5rem;
}
.story-data {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: var(--royal-violet);
    letter-spacing: 0.04em;
}

/* Footer */
.site-footer {
    background: var(--deep-noir);
    text-align: center;
    padding: 4rem 2rem;
}
.footer-text {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted-mauve);
    letter-spacing: 0.06em;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section { height: 60vh; }
    .iso-ground { width: 250px; height: 250px; }
    .text-section { padding: 3rem 1.5rem; }
}
