/* ============================================
   ppuzzl.org - Dark Academia Meets Neon
   Palette:
     Obsidian Night:    #0d0d12
     Aged Parchment:    #e8dcc8
     Electric Magenta:  #ff2e92
     Neon Cyan:         #00e5ff
     Bitter Violet:     #7b2fbe
     Weathered Brass:   #b8944a
     Deep Slate:        #1a1a2e
     Smoke Gray:        #4a4a5a
   ============================================ */

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

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

body {
    background-color: #0d0d12;
    color: #e8dcc8;
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.8;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ============================================
   Scroll Progress Bar
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, #ff2e92, #7b2fbe, #00e5ff);
    z-index: 1000;
    transition: width 50ms linear;
}

/* ============================================
   Side Navigation
   ============================================ */
.side-nav {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 900;
}

.nav-piece {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #4a4a5a;
    transition: color 0.3s ease, filter 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-piece svg {
    width: 24px;
    height: 24px;
}

.nav-piece:hover {
    color: #00e5ff;
}

.nav-piece.active {
    color: #ff2e92;
    filter: drop-shadow(0 0 4px rgba(255, 46, 146, 0.6)) drop-shadow(0 0 8px rgba(255, 46, 146, 0.3));
    animation: navPulse 2s ease-in-out infinite;
}

@keyframes navPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 46, 146, 0.6)) drop-shadow(0 0 8px rgba(255, 46, 146, 0.3)); }
    50% { filter: drop-shadow(0 0 6px rgba(255, 46, 146, 0.8)) drop-shadow(0 0 12px rgba(255, 46, 146, 0.5)); }
}

/* ============================================
   Chambers (Full-Viewport Sections)
   ============================================ */
.chamber {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #0d0d12 0%, #1a1a2e 100%);
}

/* Glow Wash Overlay */
.glow-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255, 46, 146, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.glow-wash-right {
    background: radial-gradient(ellipse at 70% 40%, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
}

.glow-wash-left {
    background: radial-gradient(ellipse at 20% 60%, rgba(123, 47, 190, 0.07) 0%, transparent 70%);
}

.glow-wash-center {
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 46, 146, 0.1) 0%, transparent 60%);
}

/* ============================================
   Hero Chamber
   ============================================ */
.chamber-hero {
    flex-direction: column;
    background: #0d0d12;
}

/* Cityscape */
.cityscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    z-index: 1;
    pointer-events: none;
}

.building {
    position: absolute;
    bottom: 0;
    background-color: #1a1a2e;
}

/* Watermark Puzzle Piece */
.watermark-piece {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

/* Rain Container */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(232, 220, 200, var(--rain-opacity)));
    animation: rainFall var(--rain-duration) linear var(--rain-delay) infinite;
    transform: rotate(2deg);
}

@keyframes rainFall {
    0% { transform: translateY(-100px) rotate(2deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(2deg); opacity: 0; }
}

/* Hero Title */
.hero-title {
    position: relative;
    z-index: 10;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    display: flex;
    gap: 0.02em;
}

.hero-letter {
    display: inline-block;
    text-shadow:
        0 0 10px rgba(255, 46, 146, 0.6),
        0 0 30px rgba(255, 46, 146, 0.3),
        0 0 60px rgba(255, 46, 146, 0.1);
    animation: neonFlicker 8s ease-in-out infinite;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-letter.displaced {
    opacity: 0.7;
    text-shadow: none;
}

@keyframes neonFlicker {
    0% { opacity: 1; }
    18% { opacity: 1; }
    18.5% { opacity: 0.7; }
    19% { opacity: 1; }
    40% { opacity: 1; }
    40.3% { opacity: 0.75; }
    40.6% { opacity: 1; }
    72% { opacity: 1; }
    72.2% { opacity: 0.65; }
    72.5% { opacity: 1; }
    100% { opacity: 1; }
}

.hero-subtitle {
    position: relative;
    z-index: 10;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.875rem, 1.5vw, 1.25rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4a4a5a;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

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

/* Neon Signs */
.neon-sign {
    position: absolute;
    z-index: 5;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 4px 12px;
}

.neon-sign-1 {
    top: 20%;
    right: 12%;
    color: #00e5ff;
    text-shadow:
        0 0 8px rgba(0, 229, 255, 0.6),
        0 0 20px rgba(0, 229, 255, 0.3),
        0 0 40px rgba(0, 229, 255, 0.1);
    transform: rotate(8deg);
}

.neon-sign-2 {
    bottom: 30%;
    left: 8%;
    color: #ff2e92;
    text-shadow:
        0 0 8px rgba(255, 46, 146, 0.6),
        0 0 20px rgba(255, 46, 146, 0.3),
        0 0 40px rgba(255, 46, 146, 0.1);
    transform: rotate(-5deg);
}

.neon-sign-3 {
    top: 35%;
    left: 15%;
    color: #7b2fbe;
    text-shadow:
        0 0 8px rgba(123, 47, 190, 0.6),
        0 0 20px rgba(123, 47, 190, 0.3),
        0 0 40px rgba(123, 47, 190, 0.1);
    transform: rotate(3deg);
}

/* ============================================
   Divider Strips
   ============================================ */
.divider-strip {
    width: 100%;
    height: 70px;
    overflow: hidden;
    position: relative;
    background: #0d0d12;
    display: flex;
    align-items: center;
}

.puzzle-belt {
    display: flex;
    gap: 20px;
    animation: beltScroll 40s linear infinite;
    color: #4a4a5a;
    padding: 0 10px;
    white-space: nowrap;
}

.puzzle-belt:hover {
    animation-play-state: paused;
}

.puzzle-belt:hover .belt-piece {
    color: #ff2e92;
    transition: color 0.3s ease;
}

.belt-piece {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

@keyframes beltScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   F-Layout Content Chambers
   ============================================ */
.chamber-content {
    padding: 0 5%;
}

.chamber-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
}

.f-layout {
    display: flex;
    gap: 5%;
    align-items: flex-start;
}

.content-block {
    flex: 0 0 60%;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-block {
    flex: 0 0 35%;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.sidebar-block.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Typography
   ============================================ */
.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: #e8dcc8;
}

.neon-heading {
    text-shadow: 0 0 0 transparent;
    transition: text-shadow 0.4s ease;
}

.neon-heading.glow {
    text-shadow:
        0 0 10px rgba(255, 46, 146, 0.6),
        0 0 30px rgba(255, 46, 146, 0.3),
        0 0 60px rgba(255, 46, 146, 0.1);
}

.body-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.8;
    letter-spacing: 0.005em;
    color: #e8dcc8;
    margin-bottom: 1.2rem;
}

/* Ruled text background */
.ruled-text {
    position: relative;
    padding: 1rem 0;
    background-image: repeating-linear-gradient(
        180deg,
        transparent,
        transparent calc(1.8rem - 0.5px),
        rgba(232, 220, 200, 0.04) calc(1.8rem - 0.5px),
        rgba(232, 220, 200, 0.04) 1.8rem
    );
    background-size: 100% 1.8rem;
    background-position: 0 0.9rem;
}

/* Bracket Quotes */
.bracket-quote {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.bracket-left,
.bracket-right {
    font-size: 2.5rem;
    color: #b8944a;
    font-weight: 300;
    line-height: 1;
}

.quote-text {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: #e8dcc8;
    opacity: 0.85;
}

/* Quill Icon */
.quill-icon {
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* ============================================
   Puzzle Cards
   ============================================ */
.puzzle-card {
    position: relative;
    background: #1a1a2e;
    border: 1px solid rgba(184, 148, 74, 0.3);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.puzzle-card:hover {
    border-color: rgba(255, 46, 146, 0.6);
    box-shadow: 0 0 20px rgba(255, 46, 146, 0.08);
}

.rotated-card.rot-pos {
    transform: rotate(1.5deg);
}

.rotated-card.rot-neg {
    transform: rotate(-1.5deg);
}

.card-corner-ornament {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0.5;
}

.card-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4a4a5a;
    margin-bottom: 0.5rem;
}

.card-title {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(0.875rem, 1.5vw, 1.25rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e8dcc8;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: block;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.85rem;
    color: #4a4a5a;
    font-style: italic;
}

/* ============================================
   Sidebar Decorative Elements
   ============================================ */
.constellation-dots {
    opacity: 0.5;
    margin-top: 1.5rem;
}

.method-glyph-sequence {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #7b2fbe;
    opacity: 0.6;
}

.glyph {
    display: inline-block;
    animation: glyphFloat 4s ease-in-out infinite;
}

.glyph:nth-child(2) { animation-delay: 0.5s; }
.glyph:nth-child(3) { animation-delay: 1s; }
.glyph:nth-child(4) { animation-delay: 1.5s; }
.glyph:nth-child(5) { animation-delay: 2s; }

@keyframes glyphFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.ink-splatter {
    position: absolute;
    bottom: -20px;
    right: 0;
    opacity: 0.6;
}

.collage-piece {
    margin-bottom: 1rem;
}

/* ============================================
   Solution Chamber (Final - Centered)
   ============================================ */
.chamber-solution {
    flex-direction: column;
    text-align: center;
    background: radial-gradient(ellipse at 50% 50%, #1a1a2e 0%, #0d0d12 100%);
}

.solution-inner {
    position: relative;
    z-index: 10;
    max-width: 700px;
    padding: 2rem;
}

.solution-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #e8dcc8;
    margin-bottom: 1.5rem;
}

.solution-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.8;
    color: #e8dcc8;
    opacity: 0.85;
    margin-bottom: 2.5rem;
}

.solution-puzzle-assembly {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    opacity: 0.15;
    pointer-events: none;
}

.solution-piece {
    position: absolute;
    top: 0;
    left: 0;
}

.solution-cta-area {
    margin-top: 2rem;
}

.neon-sign-solution {
    position: relative;
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #00e5ff;
    text-shadow:
        0 0 10px rgba(0, 229, 255, 0.6),
        0 0 30px rgba(0, 229, 255, 0.3),
        0 0 60px rgba(0, 229, 255, 0.15);
    cursor: pointer;
    padding: 0.5rem 2rem;
    border: 1px solid rgba(0, 229, 255, 0.3);
    transition: text-shadow 0.3s ease, border-color 0.3s ease;
}

.neon-sign-solution:hover {
    text-shadow:
        0 0 15px rgba(0, 229, 255, 0.8),
        0 0 40px rgba(0, 229, 255, 0.5),
        0 0 80px rgba(0, 229, 255, 0.25);
    border-color: rgba(0, 229, 255, 0.6);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .side-nav {
        left: 12px;
    }

    .f-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .content-block,
    .sidebar-block {
        flex: 1 1 100%;
    }

    .chamber-content {
        padding: 2rem 5%;
    }

    .neon-sign {
        display: none;
    }
}

@media (max-width: 480px) {
    .side-nav {
        display: none;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}
