/* ============================================================
   HEISEI.BOO: Bauhaus Design System
   Color Palette & Typography
   ============================================================ */

:root {
    /* Primary Palette */
    --color-aged-cotton: #F2EDE6;
    --color-carbon-ink: #1A1612;
    --color-wet-concrete: #3D3A36;
    --color-cordovan-leather: #7B3F2E;
    --color-brass-patina: #A8914A;
    --color-drafting-pencil: #B8B0A4;
    --color-vellum: #E8DFD0;
    --color-oxidized-iron: #2E2118;

    /* Typography */
    --font-garamond: 'EB Garamond', serif;
    --font-cormorant: 'Cormorant', serif;

    /* Spacing */
    --grid-gap: 24px;
    --margin-outer: 48px;
    --baseline-grid: 8px;
    --block-gap: 16px;

    /* Transitions */
    --transition-underline: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-garamond);
    color: var(--color-carbon-ink);
    background-color: var(--color-aged-cotton);
    line-height: 1.65;
    transition: background-color 2s ease, color 2s ease;
}

/* Scroll-driven color transition at 50vh */
@supports (animation-timeline: view()) {
    body {
        animation: colorShift linear;
        animation-timeline: view();
        animation-range: 50vh, 250vh;
    }
}

@keyframes colorShift {
    0% {
        background-color: var(--color-aged-cotton);
        color: var(--color-carbon-ink);
    }
    50% {
        background-color: var(--color-aged-cotton);
        color: var(--color-carbon-ink);
    }
    100% {
        background-color: var(--color-wet-concrete);
        color: var(--color-aged-cotton);
    }
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--margin-outer);
    background: transparent;
    font-family: var(--font-garamond);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0.04em;
    z-index: 100;
    transition: background-color 2s ease;
}

.nav-left {
    font-family: var(--font-garamond);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.nav-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    transition: color 2s ease;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-oxidized-iron);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99;
    transition: background-color 2s ease;
}

.menu-overlay.active {
    display: flex;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    text-align: center;
}

.menu-link {
    font-family: var(--font-garamond);
    font-size: 36px;
    font-weight: 500;
    color: var(--color-vellum);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.4s ease;
}

.menu-link:hover {
    color: var(--color-brass-patina);
}

/* ============================================================
   MASONRY CONTAINER & BLOCKS
   ============================================================ */

.masonry-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--block-gap);
    padding: 48px var(--margin-outer);
    padding-top: 120px;
    max-width: 1600px;
    margin: 0 auto;
}

.block {
    background-color: var(--color-aged-cotton);
    transition: background-color 2s ease;
    opacity: 0;
    transform: translateY(24px);
    animation: blockReveal 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes blockReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for sequential blocks */
.block:nth-child(1) { animation-delay: 0ms; }
.block:nth-child(2) { animation-delay: 100ms; }
.block:nth-child(3) { animation-delay: 200ms; }
.block:nth-child(4) { animation-delay: 300ms; }
.block:nth-child(5) { animation-delay: 400ms; }
.block:nth-child(6) { animation-delay: 500ms; }
.block:nth-child(7) { animation-delay: 600ms; }
.block:nth-child(8) { animation-delay: 700ms; }
.block:nth-child(9) { animation-delay: 800ms; }
.block:nth-child(10) { animation-delay: 900ms; }
.block:nth-child(11) { animation-delay: 1000ms; }
.block:nth-child(12) { animation-delay: 1100ms; }
.block:nth-child(13) { animation-delay: 1200ms; }
.block:nth-child(14) { animation-delay: 1300ms; }
.block:nth-child(15) { animation-delay: 1400ms; }
.block:nth-child(16) { animation-delay: 1500ms; }
.block:nth-child(17) { animation-delay: 1600ms; }
.block:nth-child(18) { animation-delay: 1700ms; }
.block:nth-child(19) { animation-delay: 1800ms; }
.block:nth-child(20) { animation-delay: 1900ms; }

/* Block Types */
.block.monolith {
    grid-column: 1 / -1;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block.double {
    grid-column: span 6;
    padding: 40px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.block.brick {
    grid-column: span 3;
    padding: 32px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block.joint {
    grid-column: span 2;
    padding: 24px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scroll-driven background color change for blocks */
@supports (animation-timeline: view()) {
    .block {
        animation: blockReveal 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
                   blockColorShift linear;
        animation-timeline: auto, view();
        animation-range: auto, 50vh, 250vh;
    }
}

@keyframes blockColorShift {
    0% {
        background-color: var(--color-aged-cotton);
    }
    50% {
        background-color: var(--color-aged-cotton);
    }
    100% {
        background-color: var(--color-wet-concrete);
    }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1 {
    font-family: var(--font-garamond);
    font-weight: 700;
    font-size: 72px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.05;
}

h2 {
    font-family: var(--font-garamond);
    font-weight: 500;
    font-size: 32px;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--color-cordovan-leather);
    width: 0;
    animation: underlineDraw 800ms var(--transition-underline) forwards;
}

@keyframes underlineDraw {
    to {
        width: 100%;
    }
}

p {
    font-family: var(--font-garamond);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
}

.block-title {
    font-family: var(--font-garamond);
    font-weight: 500;
    font-size: 28px;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 8px;
    color: inherit;
}

.block-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--color-cordovan-leather);
    width: 0;
    animation: underlineScrollDraw 800ms var(--transition-underline) forwards;
}

@supports (animation-timeline: view()) {
    .block-title::after {
        animation: underlineScrollDraw 800ms var(--transition-underline) both;
        animation-timeline: view();
        animation-range: entry 0%, entry 100%;
    }
}

@keyframes underlineScrollDraw {
    to {
        width: 100%;
    }
}

.block-text {
    margin-bottom: 0;
}

.monolith-content {
    text-align: center;
}

.opening-title {
    font-size: 72px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.05;
}

.opening-date {
    font-family: var(--font-cormorant);
    font-weight: 300;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 16px;
}

.brick-date {
    font-family: var(--font-cormorant);
    font-weight: 300;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.brick-label {
    font-family: var(--font-garamond);
    font-weight: 400;
    font-size: 14px;
    font-style: italic;
}

.brick-quote {
    font-family: var(--font-garamond);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0.04em;
    text-align: center;
}

.transition-text {
    font-size: 48px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.legacy-text {
    font-family: var(--font-cormorant);
    font-weight: 300;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
}

.legacy-subtitle {
    font-size: 18px;
    line-height: 1.65;
    max-width: 600px;
}

/* ============================================================
   GEOMETRIC ACCENTS
   ============================================================ */

.geometric-accent {
    width: 80px;
    height: 80px;
    color: var(--color-cordovan-leather);
    opacity: 0.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   RESPONSIVE LAYOUT
   ============================================================ */

@media (max-width: 1200px) {
    .masonry-container {
        grid-template-columns: repeat(9, 1fr);
    }

    .block.double {
        grid-column: span 5;
    }

    .block.brick {
        grid-column: span 3;
    }

    .block.joint {
        grid-column: span 2;
    }

    .block.monolith {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .masonry-container {
        grid-template-columns: repeat(6, 1fr);
        padding: 24px 16px;
        padding-top: 80px;
    }

    .navbar {
        padding: 0 16px;
    }

    .block.double {
        grid-column: span 6;
        padding: 24px;
    }

    .block.brick {
        grid-column: span 3;
        padding: 16px;
    }

    .block.joint {
        grid-column: span 2;
        padding: 16px;
    }

    h1 {
        font-size: 48px;
    }

    h2 {
        font-size: 24px;
    }

    .block-text {
        font-size: 16px;
    }

    .opening-date {
        font-size: 12px;
    }

    .transition-text {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .masonry-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 16px;
        padding-top: 80px;
    }

    .block.double {
        grid-column: span 4;
        padding: 16px;
    }

    .block.brick {
        grid-column: span 2;
        padding: 12px;
    }

    .block.joint {
        grid-column: span 2;
        padding: 12px;
    }

    .block.monolith {
        height: 50vh;
    }

    h1 {
        font-size: 36px;
        letter-spacing: 0.08em;
    }

    .navbar {
        padding: 0 12px;
    }

    .menu-link {
        font-size: 28px;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .block {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .block-title::after {
        animation: none;
        width: 100%;
    }

    body {
        animation: none;
    }

    h2::after {
        animation: none;
        width: 100%;
    }

    .menu-link {
        transition: none;
    }

    .nav-menu {
        transition: none;
    }
}
