/* telomere.digital - styles.css */

/* Color Palette */
:root {
    --aged-vellum: #f5ead4;
    --honey-dust: #c9b896;
    --charred-ink: #2e2a24;
    --worn-graphite: #8a7d66;
    --dried-amber: #c4944a;
    --oxidized-rust: #9b3a2e;
    --tracing-paper: #f0e5cc;
    --notebook-shadow: #3d362c;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Caveat Brush', cursive;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--aged-vellum);
    color: var(--charred-ink);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Grid Container - Graph Paper Background */
#grid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

/* Parallax Layer */
#parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
}

/* Main Scroll Container */
#scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 48px);
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 10;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(85vw, 120vw);
    scroll-snap-type: x proximity;
    scroll-padding: 0;
}

/* Hide scrollbar for cleaner look */
#scroll-container::-webkit-scrollbar {
    height: 0;
}

#scroll-container {
    scrollbar-width: none;
}

/* Panel Styles */
.panel {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.panel-border {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(240, 229, 204, 0.75);
    backdrop-filter: blur(2px);
    border: 2px solid var(--honey-dust);
    border-radius: 2px;
    padding: 40px;
    box-shadow: 0 8px 16px rgba(61, 54, 44, 0.15);
    position: relative;
    overflow: hidden;
}

.panel-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(196, 148, 74, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(155, 58, 46, 0.03) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.3;
}

.panel-content {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Typography */
.site-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.6rem, 7vw, 5.2rem);
    font-weight: 700;
    color: var(--charred-ink);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin: 0 0 20px 0;
    animation: titleDraw 3s ease-out forwards;
}

.title-text {
    display: inline;
}

.title-text .rust {
    color: var(--oxidized-rust);
}

.tagline {
    font-family: 'Homemade Apple', cursive;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: var(--worn-graphite);
    opacity: 0.7;
    letter-spacing: 0.01em;
    margin-bottom: 30px;
    transform: rotate(-2deg);
    animation: taglineDraw 2s ease-out 0.4s forwards;
    animation-fill-mode: both;
}

.section-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: var(--charred-ink);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin-bottom: 30px;
    animation: slideIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.section-title.gold-text {
    color: var(--dried-amber);
}

.panel-text {
    font-family: 'Caveat Brush', cursive;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.65;
    max-width: 38ch;
    color: var(--charred-ink);
    margin: 20px 0;
}

.panel-text p {
    margin-bottom: 15px;
}

.large-text {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Panel 1: The Code */
.panel-1 .panel-content {
    align-items: flex-start;
    padding-top: 60px;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    right: 40px;
    animation: pulse 2.5s ease-in-out infinite;
}

.arrow-icon {
    color: var(--charred-ink);
    width: 24px;
    height: 24px;
}

/* Panel 2: Replication */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.text-block {
    max-width: 35ch;
    padding: 15px;
    background: rgba(245, 234, 212, 0.5);
    border: 1px solid rgba(201, 184, 150, 0.3);
    transform: rotate(var(--rotation, 0deg));
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.text-block p {
    margin: 0;
    line-height: 1.6;
}

.telomere-illustration {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
}

.telomere-illustration svg {
    width: 100%;
    height: auto;
}

.shimmer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 184, 150, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 200% 0;
    }
    50% {
        background-position: -200% 0;
    }
}

/* Panel 3: The Cap */
.content-with-illustration {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.illustration-main {
    width: 100%;
    max-width: 250px;
    height: auto;
}

.text-wrap {
    max-width: 38ch;
}

.text-wrap p {
    margin-bottom: 15px;
    line-height: 1.65;
}

/* Panel 4: Erosion */
.erosion-content {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.text-fragment {
    position: absolute;
    transform: rotate(var(--rot, 0deg));
    left: var(--x, 0);
    top: var(--y, 0);
    max-width: 28ch;
    padding: 12px;
    background: rgba(245, 234, 212, 0.6);
    border: 1px solid rgba(201, 184, 150, 0.3);
    font-size: clamp(0.9rem, 1.3vw, 1rem);
    line-height: 1.6;
}

.text-fragment p {
    margin: 0;
}

.text-fragment em {
    font-style: italic;
    color: var(--oxidized-rust);
}

.telomere-clock {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
}

.telomere-clock svg {
    width: 100%;
    height: 100%;
}

.erasing-section {
    animation: fadeOut 10s ease-in-out infinite;
}

@keyframes fadeOut {
    0%, 10% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
    90%, 100% {
        opacity: 1;
    }
}

/* Panel 5: Telomerase */
.panel-5 .panel-content {
    padding: 40px;
}

.panel-5 .panel-border {
    background: linear-gradient(
        180deg,
        rgba(240, 229, 204, 0.75) 0%,
        rgba(196, 148, 74, 0.08) 100%
    );
    border-color: var(--dried-amber);
}

.panel-5 .section-title {
    margin-bottom: 40px;
}

.panel-5 .large-text {
    margin-bottom: 25px;
    line-height: 1.7;
}

/* Panel 6: Digital */
.final-statement {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.final-text {
    font-family: 'Homemade Apple', cursive;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: var(--charred-ink);
    opacity: 0.8;
    transform: rotate(2deg);
    margin-bottom: 60px;
    font-style: italic;
}

.final-illustration {
    width: 100%;
    max-width: 300px;
    height: auto;
    opacity: 1;
    animation: finalDraw 3s ease-out forwards;
}

.panel-6 .panel-border {
    background: linear-gradient(
        90deg,
        rgba(240, 229, 204, 0.75) 0%,
        rgba(255, 255, 255, 0.9) 100%
    );
}

/* Bottom Navigation Strip */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(245, 234, 212, 0.85);
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--honey-dust);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    overflow-x: auto;
}

.progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(201, 184, 150, 0.3);
    border-radius: 1px;
    overflow: hidden;
    margin-right: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(196, 148, 74, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s ease-in-out infinite;
    width: 0%;
    border-radius: 1px;
}

.nav-labels {
    display: flex;
    gap: 15px;
    white-space: nowrap;
}

.nav-label {
    font-family: 'Homemade Apple', cursive;
    font-size: 11px;
    color: var(--worn-graphite);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    padding: 4px 8px;
}

.nav-label:hover {
    opacity: 1;
}

/* Animations */
@keyframes titleDraw {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes taglineDraw {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(4px);
    }
}

@keyframes finalDraw {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .panel {
        padding: 20px;
    }

    .panel-border {
        padding: 20px;
    }

    .content-with-illustration {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .text-fragment {
        position: static;
        transform: none !important;
        margin-bottom: 15px;
    }

    .site-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .section-title {
        font-size: clamp(1.2rem, 3vw, 1.8rem);
    }

    #bottom-nav {
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    #scroll-container,
    #bottom-nav,
    .scroll-hint {
        display: none;
    }
}
