/* undo.quest — styles.css */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --plum: #5a4a5e;
    --lavender-mist: #ddd8ec;
    --rose: #e8a0b4;
    --sage: #a8c8a0;
    --cream-pink: #f0dde4;
    --muted-plum: #9a8a9e;
    --honey: #f0c870;
    --wisteria: #c8b4e0;
    --mint-cream: #dce8d8;
    --cream: #fdf6ef;
    --sidebar-width: 280px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--plum);
    background: var(--cream);
    overflow-x: hidden;
    line-height: 1.6;
}

/* === Sidebar Reef === */
#sidebar-reef {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(248, 245, 240, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(200, 180, 224, 0.3);
    z-index: 100;
    overflow: hidden;
}

.reef-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    height: 100%;
    position: relative;
}

.sidebar-logo {
    font-family: 'Jost', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 0.06em;
    color: var(--plum);
    margin-bottom: 2.5rem;
    text-transform: lowercase;
}

/* Nav Tiles (card flip) */
.nav-tile {
    width: 220px;
    height: 60px;
    perspective: 600px;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.nav-tile .tile-front,
.nav-tile .tile-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: transform 0.5s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--plum);
}

.nav-tile .tile-front {
    background: rgba(221, 216, 236, 0.5);
    border: 1px solid rgba(200, 180, 224, 0.3);
}

.nav-tile .tile-back {
    background: var(--wisteria);
    color: white;
    transform: rotateY(180deg);
    font-size: 1.5rem;
}

.nav-tile:hover .tile-front {
    transform: rotateY(180deg);
}

.nav-tile:hover .tile-back {
    transform: rotateY(0deg);
}

.fish-icon {
    flex-shrink: 0;
}

/* Ambient fish in sidebar */
.ambient-fish-container {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.reef-plants {
    width: 100%;
    margin-top: auto;
    opacity: 0.6;
}

/* === Main Canvas === */
#main-canvas {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* === Sections === */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 3rem;
    position: relative;
}

.section-content {
    max-width: 800px;
    width: 100%;
}

/* === Hero === */
#hero {
    background: linear-gradient(160deg, var(--cream) 0%, var(--cream-pink) 50%, var(--lavender-mist) 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.display-title {
    font-family: 'Jost', sans-serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 14rem);
    line-height: 0.9;
    letter-spacing: 0.06em;
    color: var(--plum);
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.title-dot {
    display: inline;
    color: var(--rose);
}

.hero-tagline {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--muted-plum);
    letter-spacing: 0.04em;
    max-width: 500px;
    margin: 0 auto 3rem;
}

.hero-fish {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.drifting-fish {
    position: absolute;
    animation: drift linear infinite;
    opacity: 0.6;
}

.fish-1 {
    top: 20%;
    left: -100px;
    animation-duration: 18s;
    animation-delay: 0s;
}

.fish-2 {
    top: 55%;
    left: -80px;
    animation-duration: 22s;
    animation-delay: 4s;
}

.fish-3 {
    top: 75%;
    left: -90px;
    animation-duration: 25s;
    animation-delay: 8s;
}

@keyframes drift {
    0% { transform: translateX(-120px) translateY(0); }
    25% { transform: translateX(25vw) translateY(-15px); }
    50% { transform: translateX(50vw) translateY(10px); }
    75% { transform: translateX(75vw) translateY(-8px); }
    100% { transform: translateX(calc(100vw + 120px)) translateY(0); }
}

.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted-plum);
    opacity: 0.6;
    animation: breathe 3s ease-in-out infinite;
}

.scroll-arrow {
    font-size: 1.2rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

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

/* === Section Headings === */
.section-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--plum);
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.section-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--muted-plum);
    margin-bottom: 2.5rem;
}

/* === Rewind Section === */
#rewind {
    background: linear-gradient(180deg, var(--cream) 0%, var(--mint-cream) 100%);
}

.rewind-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.flip-card {
    height: 220px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.flip-card-front {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(200, 180, 224, 0.3);
    backdrop-filter: blur(8px);
}

.flip-card-back {
    background: linear-gradient(135deg, var(--wisteria), var(--rose));
    transform: rotateY(180deg);
    color: white;
    gap: 1rem;
}

.card-prompt {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--plum);
    line-height: 1.4;
}

.card-reveal {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    opacity: 0.95;
}

/* === Gallery Section === */
#gallery {
    background: linear-gradient(180deg, var(--mint-cream) 0%, var(--lavender-mist) 100%);
}

.aquarium-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.aquarium-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(200, 180, 224, 0.2);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--card-delay);
}

.aquarium-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(90, 74, 94, 0.12);
}

.aquarium-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.aquarium-label {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--plum);
}

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

/* === Moments Section === */
#moments {
    background: linear-gradient(180deg, var(--lavender-mist) 0%, var(--cream-pink) 100%);
}

.moments-timeline {
    position: relative;
    padding-left: 2.5rem;
}

.moments-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--wisteria), var(--rose), var(--honey));
    border-radius: 1px;
}

.moment {
    position: relative;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.moment.visible {
    opacity: 1;
    transform: translateX(0);
}

.moment-marker {
    position: absolute;
    left: -2.5rem;
    top: 0.3rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--wisteria);
    border: 3px solid var(--cream);
    transition: background 0.3s ease, transform 0.3s ease;
}

.moment:hover .moment-marker {
    background: var(--rose);
    transform: scale(1.3);
}

.moment-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-plum);
    display: block;
    margin-bottom: 0.4rem;
}

.moment-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--plum);
}

/* === Footer === */
#footer {
    padding: 4rem 3rem;
    text-align: center;
    background: var(--cream-pink);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--muted-plum);
}

.undo-all-button {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, var(--wisteria), var(--rose));
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.04em;
}

.undo-all-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(232, 160, 180, 0.4);
}

.footer-domain {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--muted-plum);
    opacity: 0.6;
}

/* === Floating Fish Layer === */
#floating-fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.floating-fish {
    position: absolute;
    animation: swim linear infinite;
    opacity: 0.35;
}

@keyframes swim {
    0% { transform: translateX(-100px) translateY(0) scaleX(1); }
    50% { transform: translateX(50vw) translateY(-20px) scaleX(1); }
    100% { transform: translateX(calc(100vw + 100px)) translateY(10px) scaleX(1); }
}

/* === Responsive === */
@media (max-width: 900px) {
    #sidebar-reef {
        display: none;
    }

    #main-canvas {
        margin-left: 0;
    }

    .rewind-cards,
    .aquarium-gallery {
        grid-template-columns: 1fr;
    }

    .display-title {
        font-size: clamp(3rem, 15vw, 8rem);
    }
}
