/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #2A2A3A;
    color: #3A3A4A;
    overflow-x: hidden;
}

/* Import Additional Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;1,400&family=JetBrains+Mono:wght@400&display=swap');

/* Quest Container */
.quest-container {
    width: 100%;
    height: auto;
}

/* Modules Base */
.module {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    overflow: hidden;
}

.module-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 2rem;
    text-align: center;
}

/* Background Textures */
.marble-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(232, 226, 218, 0.9), transparent 50%),
        radial-gradient(ellipse 600px 500px at 80% 70%, rgba(212, 206, 196, 0.85), transparent 50%),
        conic-gradient(from 45deg at 50% 50%,
            #E8E2DA 0deg,
            #C8C0B6 90deg,
            #D4CEC4 180deg,
            #D0D0D8 270deg,
            #E8E2DA 360deg);
}

.noise-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #3A3A4A;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise"/></filter><rect width="200" height="200" fill="%233A3A4A" filter="url(%23noise)" opacity="0.3"/></svg>');
    opacity: 0.4;
}

.laboratory-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(135deg, #2A2A3A 0%, #3A3A4A 50%, #2A2A3A 100%);
    background-attachment: fixed;
}

.signal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(180, 160, 220, 0.2), transparent 50%),
        linear-gradient(180deg, #2A2A3A 0%, #3A3A4A 100%);
}

.continuation-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        radial-gradient(ellipse 900px 700px at 50% 50%, rgba(208, 208, 224, 0.08), transparent 60%),
        linear-gradient(45deg, #3A3A4A 0%, #2A2A3A 100%);
}

/* Typography Styles */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

.chrome-text {
    background: linear-gradient(90deg,
        #E8E8F0 0%,
        #D0D0E0 25%,
        #E8E8F0 50%,
        #D0D0E0 75%,
        #E8E8F0 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: chrome-shift 8s ease-in-out infinite;
}

@keyframes chrome-shift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #A0A0B0;
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
    font-weight: 300;
}

.section-heading {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: #2A2A3A;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #2A2A3A;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.module-subtitle {
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #5A5A6A;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2rem;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2A2A3A;
    margin-bottom: 0.8rem;
}

.card-text {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #3A3A4A;
    font-weight: 400;
}

/* Glassmorphic Cards */
.glassmorphic {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    transition: all 0.3s ease;
}

.glassmorphic:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

/* Module 0: The Call */
.module-call {
    background: linear-gradient(180deg, #F4F0E8 0%, #E8E2DA 50%, #D4CEC4 100%);
}

.call-wrapper {
    text-align: center;
    animation: slideUp 0.8s ease 0.2s both;
}

.hero-title {
    animation: textFadeIn 0.8s ease 0.4s both;
}

.subtitle {
    animation: textFadeIn 0.8s ease 0.6s both;
}

.call-card {
    animation: slideUp 0.8s ease 0.8s both;
}

.call-card {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.call-cta {
    margin-top: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6A6A7A;
    opacity: 0.7;
    animation: pulse-cta 2s ease-in-out infinite;
}

@keyframes pulse-cta {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Module 1: The Library */
.module-library {
    background: linear-gradient(180deg, #3A3A4A 0%, #2A2A3A 100%);
}

.library-wrapper {
    width: 100%;
}

.library-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.library-card {
    text-align: left;
    transition: transform 0.3s ease, background 0.3s ease;
}

.library-card:hover {
    transform: translateY(-8px);
}

/* Module 2: The Laboratory */
.module-laboratory {
    background: linear-gradient(135deg, #2A2A3A 0%, #3A3A4A 50%, #2A2A3A 100%);
}

.laboratory-wrapper {
    width: 100%;
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1000px;
}

.lab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.lab-item:hover {
    transform: scale(1.05);
}

.lab-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.lab-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #D0D0E0;
    margin-bottom: 0.6rem;
}

.lab-text {
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
    color: #A0A0B0;
    line-height: 1.6;
    font-weight: 400;
}

.lab-signal-box {
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.signal-text {
    font-family: 'Source Serif 4', serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #D0D0E0;
    font-style: italic;
    font-weight: 400;
}

/* Module 3: The Signal */
.module-signal {
    background: linear-gradient(180deg, #2A2A3A 0%, #3A3A4A 100%);
}

.signal-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.signal-display {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    height: 300px;
    margin: 3rem auto;
    padding: 2rem;
}

.signal-bar {
    width: 40px;
    background: linear-gradient(180deg, #B4A0DC 0%, #B8B8C8 50%, #D0D0E0 100%);
    border-radius: 8px 8px 0 0;
    animation: signal-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(180, 160, 220, 0.4);
}

.signal-bar-1 {
    height: 120px;
    animation-delay: 0s;
}

.signal-bar-2 {
    height: 180px;
    animation-delay: 0.2s;
}

.signal-bar-3 {
    height: 220px;
    animation-delay: 0.4s;
}

.signal-bar-4 {
    height: 160px;
    animation-delay: 0.6s;
}

.signal-bar-5 {
    height: 140px;
    animation-delay: 0.8s;
}

@keyframes signal-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.signal-content {
    text-align: center;
    margin-top: 2rem;
}

.signal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #D0D0E0;
    margin-bottom: 1rem;
}

.signal-desc {
    font-size: 1rem;
    color: #A0A0B0;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Module 4: The Continuation */
.module-continuation {
    background: linear-gradient(135deg, #3A3A4A 0%, #2A2A3A 100%);
}

.continuation-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.continuation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.continuation-card {
    text-align: left;
    transition: all 0.3s ease;
}

.continuation-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.4);
}

.continuation-footer {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
}

.footer-text {
    font-family: 'Source Serif 4', serif;
    font-size: 1.2rem;
    color: #D0D0E0;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.footer-text-small {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #B4A0DC;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

/* Responsive Design */
@media (max-width: 768px) {
    .module {
        min-height: auto;
        padding: 2rem 0;
    }

    .module-content {
        padding: 2rem 1rem;
    }

    .library-cards,
    .lab-grid {
        grid-template-columns: 1fr;
    }

    .continuation-cards {
        grid-template-columns: 1fr;
    }

    .signal-display {
        gap: 1rem;
        height: 250px;
    }

    .signal-bar {
        width: 30px;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    .glassmorphic {
        padding: 1.5rem;
    }

    .signal-display {
        height: 200px;
        gap: 0.8rem;
    }

    .signal-bar {
        width: 24px;
    }
}

/* Scroll Snap */
@supports (scroll-snap-type: y mandatory) {
    html {
        scroll-snap-type: y mandatory;
    }

    .module {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* Technical Readout Styling */
.lab-readout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6A6A7A;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Decorative Elements */
.bubble-decoration {
    position: absolute;
    border-radius: 50%;
    opacity: 0.25;
    pointer-events: none;
    animation: bubble-drift 30s ease-in-out infinite;
}

.bubble-1 {
    width: 12px;
    height: 12px;
    background-color: #B8B8C8;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.bubble-2 {
    width: 8px;
    height: 8px;
    background-color: #D0D0D8;
    top: 20%;
    right: 8%;
    animation-delay: 8s;
}

.bubble-3 {
    width: 14px;
    height: 14px;
    background-color: #A0A0B0;
    bottom: 15%;
    right: 5%;
    animation-delay: 16s;
}

.bubble-4 {
    width: 10px;
    height: 10px;
    background-color: #B8B8C8;
    bottom: 20%;
    left: 7%;
    animation-delay: 12s;
}

@keyframes bubble-drift {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.25;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-20px) translateX(8px);
        opacity: 0.2;
    }
}

/* Chrome Gradient Reference */
.chrome-ref {
    background: linear-gradient(135deg,
        #B8B8C8 0%,
        #E8E8F0 25%,
        #A0A0B0 50%,
        #D0D0E0 75%,
        #B8B8C8 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Paper Warm Background Accent */
.paper-warm-bg {
    background-color: #F4F0E8;
    color: #2A2A3A;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .module {
        page-break-after: always;
    }
}
