/* ==============================================
   historical.day - Memphis-Inspired Design System
   ============================================== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Source Serif 4", serif;
    background-color: #FAF3E8;
    color: #2D2A26;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== COLOR PALETTE ===== */
:root {
    --cream: #FAF3E8;
    --blush-rose: #E8B4B8;
    --powder-lavender: #C5B3D4;
    --sage-mist: #B5C9B7;
    --butter-gold: #E8D4A2;
    --terracotta-blush: #D4A088;
    --deep-ink: #2D2A26;
    --fog-gray: #8E8880;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--deep-ink);
}

h1 {
    font-size: 96px;
}

h2 {
    font-size: 44px;
    font-family: "DM Serif Display", serif;
    font-weight: 400;
    letter-spacing: 0;
}

h3 {
    font-size: 28px;
    font-family: "DM Serif Display", serif;
    font-weight: 400;
    letter-spacing: 0;
}

.day-title {
    font-size: 24px;
}

.day-date, .entry-date {
    font-family: "Outfit", sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

.day-date {
    margin-bottom: 8px;
}

p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--deep-ink);
}

/* ===== NAVIGATION BAR ===== */
.nav-bar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 24px 0;
    background-color: var(--cream);
    border-right: 1px solid var(--butter-gold);
    z-index: 1000;
}

.nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-icon:hover {
    transform: rotate(15deg) scale(1.1);
}

.nav-icon[data-icon="triangle"]::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--blush-rose);
}

.nav-icon[data-icon="circle"]::before {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--powder-lavender);
}

.nav-icon[data-icon="squiggle"]::before {
    content: "";
    width: 24px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 16"><path d="M2 8 Q6 2 10 8 T18 8 T24 8" stroke="%23B5C9B7" stroke-width="2" fill="none"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.nav-icon[data-icon="diamond"]::before {
    content: "";
    width: 16px;
    height: 16px;
    background-color: var(--sage-mist);
    transform: rotate(45deg);
}

/* ===== SCENES ===== */
.scene {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px 0 96px;
    position: relative;
}

/* ===== ENTRANCE HALL ===== */
.entrance-hall {
    background-color: var(--cream);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path d="M 0 32 Q 10 28 20 32 T 40 32 T 60 32 T 80 32 T 100 32 T 120 32 T 140 32 T 160 32 T 200 32" stroke="%23E8B4B8" stroke-width="2" fill="none" opacity="0.05"/><path d="M 0 64 Q 12 60 24 64 T 48 64 T 72 64 T 96 64 T 120 64 T 144 64 T 168 64 T 200 64" stroke="%23E8B4B8" stroke-width="2" fill="none" opacity="0.05"/></svg>');
    background-repeat: repeat;
    overflow: hidden;
}

.entrance-container {
    text-align: center;
    position: relative;
    z-index: 10;
}

.arch-frame {
    margin-bottom: 20px;
}

.arch-frame svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.entrance-title {
    font-size: 96px;
    color: var(--deep-ink);
    margin-bottom: 60px;
    animation: fadeInScale 1.2s ease-out;
    transform-origin: center;
}

.floating-elements {
    position: relative;
    width: 400px;
    height: 300px;
    margin: 60px auto 0;
}

.floating-element {
    position: absolute;
    opacity: 0.7;
}

.floating-element.fern {
    top: 0;
    left: 20px;
    animation: float-rotate 15s linear infinite;
}

.floating-element.shell {
    top: 80px;
    right: 80px;
    animation: float-rotate 18s linear infinite reverse;
}

.floating-element.flower {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: float-rotate 20s linear infinite;
}

.scroll-arrow {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 40px;
}

.scroll-arrow svg {
    animation: breathe 3s ease-in-out infinite;
    opacity: 0.5;
}

/* ===== PORTFOLIO GRID / COLLECTION GALLERY ===== */
.collection-gallery {
    background-color: var(--cream);
    padding: 120px 48px 120px 96px;
    display: block;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-cell {
    background-color: var(--cream);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grid-cell.cell-1 {
    grid-column: 1 / 5;
    grid-row: 1;
    min-height: 300px;
    background: linear-gradient(135deg, var(--cream) 0%, var(--blush-rose) 100%);
}

.grid-cell.cell-2 {
    grid-column: 7 / 11;
    grid-row: 1;
    min-height: 300px;
    background-color: var(--butter-gold);
}

.grid-cell.cell-3 {
    grid-column: 1 / 5;
    grid-row: 2;
    min-height: 240px;
    background-color: var(--powder-lavender);
}

.grid-cell.cell-4 {
    grid-column: 7 / 11;
    grid-row: 2;
    min-height: 240px;
    background: linear-gradient(45deg, var(--sage-mist), var(--powder-lavender));
}

.grid-cell.cell-5 {
    grid-column: 3 / 7;
    grid-row: 3;
    min-height: 280px;
    background-color: var(--terracotta-blush);
}

.grid-cell.cell-6 {
    grid-column: 8 / 12;
    grid-row: 3;
    min-height: 280px;
    background-color: var(--blush-rose);
}

.grid-cell.cell-7 {
    grid-column: 1 / 5;
    grid-row: 4;
    min-height: 240px;
    background: linear-gradient(to bottom, var(--butter-gold), var(--cream));
}

.grid-cell.cell-8 {
    grid-column: 7 / 11;
    grid-row: 4;
    min-height: 240px;
    background-color: var(--powder-lavender);
}

.grid-cell:nth-child(3n) {
    border-radius: 0 24px 24px 0;
}

.grid-cell:nth-child(3n+1) {
    border-radius: 24px 0 0 24px;
}

.cell-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.day-title {
    margin: 12px 0;
    color: var(--deep-ink);
}

.day-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.cell-illustration {
    align-self: flex-end;
    opacity: 0.8;
}

/* ===== ARCHIVE ROOM / TIMELINE ===== */
.archive-room {
    background-color: var(--cream);
    padding: 120px 48px 120px 96px;
    min-height: auto;
}

.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
}

.timeline-line {
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 40px;
    height: 100%;
    z-index: 1;
}

.timeline-entries {
    flex: 1;
    margin-left: 80px;
    display: flex;
    flex-direction: column;
    gap: 80px;
    z-index: 2;
}

.timeline-entry {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.entry-date {
    font-size: 48px;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    color: var(--blush-rose);
    min-width: 100px;
    text-align: right;
}

.entry-text h3 {
    font-size: 28px;
    margin-bottom: 12px;
}

.entry-text p {
    color: var(--fog-gray);
    max-width: 400px;
}

/* ===== GARDEN ===== */
.garden {
    background: linear-gradient(180deg, var(--cream) 0%, var(--sage-mist) 100%);
    padding: 120px 48px 120px 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garden-container {
    position: relative;
    text-align: center;
}

.botanical-mandala {
    position: relative;
    margin-bottom: 80px;
}

.mandala-svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    margin-bottom: 40px;
}

.closing-message {
    font-size: 56px;
    color: var(--deep-ink);
    margin-bottom: 20px;
}

.closing-text {
    font-size: 18px;
    color: var(--fog-gray);
    max-width: 500px;
    margin: 0 auto;
}

.garden-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.garden-element {
    position: absolute;
    opacity: 0.4;
}

.garden-element.element-1 {
    top: 20%;
    left: 10%;
    animation: float-drift 12s ease-in-out infinite;
}

.garden-element.element-2 {
    top: 50%;
    right: 15%;
    animation: float-drift 14s ease-in-out infinite;
    animation-delay: 2s;
}

.garden-element.element-3 {
    bottom: 20%;
    left: 25%;
    animation: float-drift 16s ease-in-out infinite;
    animation-delay: 4s;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

@keyframes float-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes float-drift {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-8px) translateX(4px);
    }
    50% {
        transform: translateY(8px) translateX(-4px);
    }
    75% {
        transform: translateY(-4px) translateX(8px);
    }
}

/* ===== SCROLL REVEAL EFFECT ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .scene {
        padding: 0 32px 0 80px;
    }

    .entrance-title {
        font-size: 72px;
    }

    h2 {
        font-size: 36px;
    }

    .portfolio-grid {
        gap: 16px;
    }

    .grid-cell {
        min-height: 200px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .scene {
        padding: 0 24px 0 64px;
    }

    .nav-bar {
        width: 40px;
        gap: 24px;
    }

    .entrance-title {
        font-size: 56px;
    }

    .floating-elements {
        width: 300px;
        height: 200px;
    }

    h2 {
        font-size: 28px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }

    .grid-cell {
        grid-column: span 2 !important;
        min-height: 180px;
        padding: 16px;
    }

    .day-title {
        font-size: 18px;
    }

    .timeline-container {
        flex-direction: column;
        gap: 0;
    }

    .timeline-line {
        width: 2px;
        left: 0;
    }

    .timeline-entries {
        margin-left: 24px;
    }

    .entry-date {
        font-size: 32px;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .scene {
        padding: 0 16px 0 48px;
    }

    .nav-bar {
        width: 36px;
        gap: 20px;
    }

    .entrance-title {
        font-size: 40px;
        margin-bottom: 40px;
    }

    .floating-elements {
        width: 200px;
        height: 150px;
    }

    h1 {
        font-size: 56px;
    }

    h2 {
        font-size: 20px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .grid-cell {
        grid-column: span 2 !important;
        min-height: 160px;
        padding: 12px;
        border-radius: 8px !important;
    }

    .day-date {
        font-size: 10px;
    }

    .day-title {
        font-size: 16px;
    }

    .cell-illustration {
        width: 40px;
        height: 40px;
    }

    .entry-date {
        font-size: 24px;
        min-width: 50px;
    }

    .closing-message {
        font-size: 36px;
    }

    .closing-text {
        font-size: 14px;
    }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
