/* ==========================================================================
   mujun.work - Retro-Calm Bento-Box Layout
   Terracotta-Warm Earth Tones | Wave-Form Motifs | Spring Patterns
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw + 0.3rem, 1.25rem);
    line-height: 1.7;
    color: #8B5A3C;
    background-color: #F5F1ED;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #8B5A3C;
}

.body-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw + 0.3rem, 1.25rem);
    line-height: 1.7;
    color: #8B5A3C;
    margin-bottom: 1.2em;
}

.body-text:last-child {
    margin-bottom: 0;
}

.kanji {
    font-weight: 500;
    color: #C85A2C;
}

.accent-word {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: #A67C52;
    display: block;
    text-align: center;
}

.accent-word.accent-light {
    color: #F5F1ED;
}

.display-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: #8B5A3C;
}

.display-text-sm {
    font-size: clamp(1.4rem, 3.5vw, 2.8rem);
}

.display-sub {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 3vw, 2.5rem);
    color: #A67C52;
    line-height: 1.35;
}

.meta-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.8vw, 0.9rem);
    text-transform: uppercase;
    color: #C9A876;
    letter-spacing: 0.08em;
}

.caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.8vw, 0.9rem);
    text-transform: uppercase;
    color: #E3D5C6;
    letter-spacing: 0.06em;
}

.caption-text {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    color: #A67C52;
    line-height: 1.5;
    font-style: italic;
}

/* --- Sticky Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8vh;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4vw;
    background: rgba(245, 241, 237, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid #E3D5C6;
}

.header-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #8B5A3C;
    letter-spacing: 0.02em;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #8B5A3C;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger:hover span {
    background-color: #C85A2C;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-landscape {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: clamp(100px, 14vh, 180px) clamp(24px, 6vw, 80px) 0;
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.02em;
    color: #F5F1ED;
    opacity: 0.85;
    text-shadow: 0 2px 20px rgba(139, 90, 60, 0.4), 0 1px 4px rgba(139, 90, 60, 0.25);
    line-height: 1.1;
    margin-bottom: 0.2em;
}

.hero-subtitle {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    color: #F5F1ED;
    opacity: 0.75;
    text-shadow: 0 1px 10px rgba(139, 90, 60, 0.35);
    margin-left: 0.2em;
}

.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    z-index: 3;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Bento Grid Sections --- */
.bento-section {
    position: relative;
    padding: 6vw 4vw;
}

.section-ii {
    background: #F5F1ED;
}

.section-iv {
    background: #F5F1ED;
}

.section-vi {
    background: #F5F1ED;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2vw;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Bento Cell Base --- */
.bento-cell {
    border-radius: 2vw;
    overflow: hidden;
    position: relative;
    transition: background-color 0.4s ease, transform 0.3s ease;
}

.bento-cell:hover {
    transform: scale(1.008);
}

/* Cell Sizes */
.cell-1x1 {
    grid-column: span 1;
    grid-row: span 1;
}

.cell-2x1 {
    grid-column: span 2;
    grid-row: span 1;
}

.cell-1x2 {
    grid-column: span 1;
    grid-row: span 2;
}

.cell-2x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.cell-3x2 {
    grid-column: span 3;
    grid-row: span 2;
}

.cell-2x3 {
    grid-column: span 2;
    grid-row: span 3;
}

.cell-4x1 {
    grid-column: span 4;
    grid-row: span 1;
}

/* Cell Types */
.cell-image {
    background: #E8DAC8;
}

.cell-image svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.cell-text {
    background: linear-gradient(135deg, #F5F1ED 0%, #E8DAC8 100%);
    padding: 3vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cell-text.cell-accent {
    background: #E8DAC8;
}

.cell-micro {
    background: #F0EADC;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.cell-micro svg {
    width: 80%;
    height: 80%;
}

.cell-word {
    background: linear-gradient(135deg, #F0EADC, #E8DAC8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vw;
    aspect-ratio: 1;
}

.cell-word:hover .accent-word {
    color: #C85A2C;
    transition: color 0.4s ease;
}

/* Dusty Rose accent for specific cells */
.cell-dusty-rose {
    background: #C19A6B;
}

/* Cell overlay for captions */
.cell-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2vw 3vw;
    background: linear-gradient(to top, rgba(139, 90, 60, 0.55) 0%, transparent 100%);
}

/* Cell wave pattern background */
.cell-wave-pattern {
    background: #E8DAC8;
}

.cell-wave-accent {
    background: #F5F1ED;
}

.cell-dot-pattern {
    background: #F0EADC;
}

/* --- Typographic Section (Section V) --- */
.typo-section {
    position: relative;
    padding: 6vw 4vw;
    background: #F0EADC;
}

.grid-typo .cell-typo {
    padding: 3vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
}

.cell-bg-clay {
    background: #C85A2C !important;
    border-radius: 2vw;
}

.cell-bg-clay .display-sub {
    color: #F5F1ED;
}

.cell-bg-wheat {
    background: #DEB887 !important;
    border-radius: 2vw;
}

.cell-bg-wheat .meta-text {
    color: #8B5A3C;
}

.cell-bg-sienna {
    background: #A64B2A !important;
    border-radius: 2vw;
}

.cell-bg-sand {
    background: #E8DAC8 !important;
    border-radius: 2vw;
}

.cell-bg-rust {
    background: #B8623A !important;
    border-radius: 2vw;
}

/* --- Meditation Section (Section III) --- */
.meditation-section {
    position: relative;
    padding: 10vw 4vw 8vw;
    background: #E8DAC8;
    overflow: hidden;
}

.wave-bg-layers {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.wave-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
}

.wave-layer-1 {
    bottom: 10%;
}

.wave-layer-2 {
    bottom: 5%;
}

.wave-layer-3 {
    bottom: 0;
}

.meditation-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.section-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    color: #8B5A3C;
    margin-bottom: 1em;
    line-height: 1.15;
}

.meditation-text {
    padding-left: 1vw;
}

.meditation-text .body-text {
    color: #8B5A3C;
}

/* --- Wave Dividers --- */
.wave-divider {
    position: relative;
    line-height: 0;
    margin-top: -1px;
}

.wave-divider svg {
    width: 100%;
    height: auto;
    display: block;
}

.wave-divider-bottom {
    margin-top: 4vw;
}

/* --- Spring Pattern Section (Section VI) --- */
.grid-spring {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(120px, auto);
}

.grid-spring .cell-2x2 {
    min-height: 300px;
}

.grid-spring .cell-1x2 {
    min-height: 280px;
}

/* --- Resolution Section (Section VII) --- */
.resolution-section {
    position: relative;
    padding: 12vw 4vw 6vw;
    background: #F5F1ED;
    text-align: center;
    overflow: hidden;
}

.resolution-content {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 4vw;
}

.resolution-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    color: #8B5A3C;
    margin-bottom: 0.6em;
    line-height: 1.15;
}

.resolution-body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    line-height: 1.8;
    color: #A67C52;
    max-width: 700px;
    margin: 0 auto;
}

.resolution-wave {
    margin: 4vw 0 2vw;
    line-height: 0;
}

.resolution-wave svg {
    width: 100%;
    height: auto;
    display: block;
}

.site-footer {
    padding: 4vw 0 2vw;
}

.footer-mark {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #E3D5C6;
    user-select: none;
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Wave form scroll animation */
.wave-divider svg path,
.hero-wave svg path {
    transition: d 0.8s ease-out;
}

/* --- Subtle Hover Effects --- */
.cell-image:hover {
    filter: brightness(1.02);
    transition: filter 0.4s ease;
}

.cell-text:hover {
    background: linear-gradient(135deg, #F0EADC 0%, #E3D5C6 100%);
}

.cell-micro:hover {
    background: #E8DAC8;
}

/* --- Section Divider Line --- */
.bento-section::after {
    content: '';
    display: block;
    width: 60%;
    max-width: 600px;
    height: 1px;
    background: #E3D5C6;
    margin: 4vw auto 0;
}

.section-vi::after {
    display: none;
}

/* --- Grid Specific Layouts --- */

/* Grid Intro (Section II) */
.grid-intro {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
}

.grid-intro .cell-2x1:first-child {
    min-height: 200px;
}

.grid-intro .cell-1x2 {
    min-height: 260px;
}

.grid-intro .cell-2x2 {
    min-height: 320px;
}

/* Grid Gallery (Section IV) */
.grid-gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
}

.grid-gallery .cell-3x2 {
    min-height: 300px;
}

.grid-gallery .cell-2x3 {
    min-height: 400px;
}

/* Grid Typo (Section V) */
.grid-typo {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(80px, auto);
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cell-3x2 {
        grid-column: span 2;
    }

    .cell-4x1 {
        grid-column: span 2;
    }

    .cell-2x3 {
        grid-column: span 2;
        grid-row: span 2;
    }

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

    .section-heading {
        font-size: clamp(2rem, 6vw, 4rem);
    }

    .resolution-title {
        font-size: clamp(2rem, 6vw, 4rem);
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 3vw;
    }

    .cell-2x1,
    .cell-3x2,
    .cell-2x2,
    .cell-2x3,
    .cell-4x1,
    .cell-1x2 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .cell-1x1 {
        aspect-ratio: auto;
        min-height: 100px;
    }

    .cell-micro {
        aspect-ratio: auto;
        min-height: 100px;
        padding: 4vw;
    }

    .bento-section {
        padding: 8vw 5vw;
    }

    .typo-section {
        padding: 8vw 5vw;
    }

    .meditation-section {
        padding: 12vw 5vw 10vw;
    }

    .resolution-section {
        padding: 14vw 5vw 8vw;
    }

    .cell-text {
        padding: 5vw;
    }

    .grid-typo .cell-typo {
        padding: 5vw;
    }

    .hero-content {
        padding: 100px 20px 0;
    }

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

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.6rem);
    }

    .site-header {
        padding: 0 5vw;
    }

    .header-title {
        font-size: clamp(1rem, 4vw, 1.4rem);
    }

    .display-text {
        font-size: clamp(1.4rem, 6vw, 2.5rem);
    }

    .display-text-sm {
        font-size: clamp(1.1rem, 5vw, 2rem);
    }

    .display-sub {
        font-size: clamp(1.1rem, 4vw, 1.8rem);
    }

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

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

    .grid-intro .cell-2x1:first-child,
    .grid-intro .cell-1x2,
    .grid-intro .cell-2x2,
    .grid-gallery .cell-3x2,
    .grid-gallery .cell-2x3 {
        min-height: 200px;
    }

    .grid-spring .cell-2x2 {
        min-height: 250px;
    }

    .grid-spring .cell-1x2 {
        min-height: 220px;
    }
}

/* --- Warm Radial Gradient Overlay (decorative) --- */
.meditation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 60% 40%, #DEB887 0%, transparent 70%);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

/* --- Tertiary Clay Rust Overlay --- */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(200, 90, 44, 0.08);
    pointer-events: none;
}

/* --- Link / Interactive --- */
a {
    color: #A0522D;
    text-decoration: none;
    border-bottom: 1px solid rgba(160, 82, 45, 0.3);
    transition: color 0.3s ease, border-color 0.3s ease;
}

a:hover {
    color: #C85A2C;
    border-bottom-color: #C85A2C;
}
