/* ==========================================================================
   munju.org -- coastal-blend bento composition
   Colors: #C2D4DF #F2E9DA #F4EDE6 #3D3D3D #2B5A6B #1C3845 #7B9DAA #E6F0F5
   Fonts:  Cormorant Garamond, Lora, Nunito Sans, Fira Code
   ========================================================================== */

:root {
    --warm-linen: #F4EDE6;
    --tide-glass: #E6F0F5;
    --dune-cream: #F2E9DA;
    --shore-blue: #C2D4DF;
    --midnight-inlet: #1C3845;
    --harbor-teal: #2B5A6B;
    --warm-charcoal: #3D3D3D;
    --bleached-driftwood: #7B9DAA;
    --kelp-gold: #C9A24E;
    --reef-cyan: #4DA3B5;
    --abyss-ink: #0E2A36;

    --font-display: "Cormorant Garamond", "Lora", Georgia, serif;
    --font-sub: "Lora", Georgia, serif;
    --font-body: "Nunito Sans", "Inter", system-ui, sans-serif;
    --font-mono: "Fira Code", "Space Mono", monospace;

    --grid-gap: 20px;
    --tray-gap: 96px;
    --max-width: 1200px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--warm-linen);
    color: var(--warm-charcoal);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Bokeh Layer
   -------------------------------------------------------------------------- */
.bokeh-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    will-change: transform;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    will-change: transform;
    opacity: 0.85;
}

@keyframes bokeh-drift-a {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(14px, -38px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokeh-drift-b {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-18px, 32px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokeh-drift-c {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(12px, 46px); }
    100% { transform: translate(0, 0); }
}

@keyframes bokeh-drift-d {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-15px, -28px); }
    100% { transform: translate(0, 0); }
}

/* --------------------------------------------------------------------------
   Particle Layer
   -------------------------------------------------------------------------- */
.particle-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 52px;
    background: rgba(244, 237, 230, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(194, 212, 223, 0.5);
}

.topbar-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logotype {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    color: var(--midnight-inlet);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 200ms ease;
}

.logotype:hover { color: var(--harbor-teal); }

.menu-toggle {
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--harbor-teal);
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 6px 4px;
    transition: color 200ms ease;
}

.menu-toggle:hover { color: var(--kelp-gold); }

/* --------------------------------------------------------------------------
   Menu Overlay
   -------------------------------------------------------------------------- */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(244, 237, 230, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

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

.menu-link {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 44px;
    color: var(--midnight-inlet);
    text-decoration: none;
    letter-spacing: 0.005em;
    line-height: 1;
    transition: color 280ms ease, transform 280ms ease;
}

.menu-link:hover {
    color: var(--harbor-teal);
    transform: translateY(-2px);
}

.menu-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--bleached-driftwood);
    margin-top: 8px;
    letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   Page & Trays
   -------------------------------------------------------------------------- */
.page {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
}

.tray {
    margin-bottom: var(--tray-gap);
}

.tray:last-of-type { margin-bottom: 48px; }

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

/* --------------------------------------------------------------------------
   Cell Base
   -------------------------------------------------------------------------- */
.cell {
    border: 1px solid var(--shore-blue);
    border-radius: 14px;
    padding: 28px 24px;
    background: var(--warm-linen);
    position: relative;
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition:
        opacity 700ms cubic-bezier(0.25, 1.6, 0.55, 1),
        transform 700ms cubic-bezier(0.25, 1.6, 0.55, 1),
        border-color 250ms ease,
        box-shadow 250ms ease;
    will-change: transform, opacity;
}

.cell.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cell:hover {
    border-color: var(--reef-cyan);
    box-shadow: 0 6px 24px rgba(14, 42, 54, 0.10);
    transform: translateY(-3px);
}

.cell.is-visible:hover {
    transform: translateY(-3px);
}

/* tone variants */
.tone-tide  { background: var(--tide-glass); }
.tone-dune  { background: var(--dune-cream); }
.tone-linen { background: var(--warm-linen); }
.tone-gold  { background: rgba(201, 162, 78, 0.06); }

/* span helpers (desktop) */
.span-12-2 { grid-column: span 12; grid-row: span 2; }
.span-8-2  { grid-column: span 8;  grid-row: span 2; }
.span-4-2  { grid-column: span 4;  grid-row: span 2; }
.span-8-1  { grid-column: span 8;  grid-row: span 1; }
.span-4-1  { grid-column: span 4;  grid-row: span 1; }

/* --------------------------------------------------------------------------
   Typographic Elements
   -------------------------------------------------------------------------- */
.meta-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--bleached-driftwood);
    letter-spacing: 0.06em;
    text-transform: lowercase;
}

.meta-bottom {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Tray One: Threshold
   -------------------------------------------------------------------------- */
.tray-threshold .grid {
    min-height: calc(100vh - 100px);
    align-content: stretch;
}

.cell-threshold {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 64px 32px;
    position: relative;
}

.logotype-display {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 72px;
    color: var(--midnight-inlet);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1;
}

.threshold-phrase {
    font-family: var(--font-sub);
    font-weight: 400;
    font-style: italic;
    font-size: 22px;
    color: var(--harbor-teal);
    margin: 28px 0 0;
    max-width: 520px;
}

.cell-threshold .meta-label:first-child {
    position: absolute;
    top: 28px;
    left: 28px;
}

/* --------------------------------------------------------------------------
   Tray Two: Compartments
   -------------------------------------------------------------------------- */
.cell-narrative .cell-title,
.cell-poem .cell-title,
.cell-closing .cell-title {
    font-family: var(--font-sub);
    font-weight: 600;
    font-size: 28px;
    color: var(--harbor-teal);
    margin: 12px 0 14px;
    line-height: 1.25;
}

.cell-narrative p {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--warm-charcoal);
    margin: 0 0 14px;
}

.cell-narrative p:last-child { margin-bottom: 0; }

.poem-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.poem-list li {
    font-family: var(--font-sub);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    color: var(--harbor-teal);
    line-height: 1.4;
    padding-bottom: 24px;
}

.poem-list li:last-child { padding-bottom: 0; }

.cell-fragment {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
}

.fragment-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 400;
    color: var(--harbor-teal);
    margin: 14px 0 0;
    letter-spacing: 0.02em;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Tray Three: Index
   -------------------------------------------------------------------------- */
.cell-entry {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
}

.cell-entry .meta-label {
    margin-bottom: 4px;
    font-size: 13px;
}

.entry-title {
    font-family: var(--font-sub);
    font-weight: 600;
    font-size: 20px;
    color: var(--harbor-teal);
    margin: 0;
    line-height: 1.3;
}

.entry-desc {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    color: var(--warm-charcoal);
    line-height: 1.55;
    margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Tray Four: Shore
   -------------------------------------------------------------------------- */
.cell-closing {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.closing-text {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 28px;
    line-height: 1.45;
    color: var(--midnight-inlet);
    margin: 12px 0 0;
    letter-spacing: 0.005em;
}

.cell-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.wave-svg {
    width: 80%;
    max-width: 220px;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    margin-top: 120px;
    padding: 32px 0;
    text-align: center;
}

.footer-line {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--bleached-driftwood);
    letter-spacing: 0.08em;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) and (min-width: 768px) {
    :root { --tray-gap: 64px; }

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

    .span-12-2 { grid-column: span 8; grid-row: span 2; }
    .span-8-2  { grid-column: span 6; grid-row: span 2; }
    .span-4-2  { grid-column: span 2; grid-row: span 2; }
    .span-8-1  { grid-column: span 6; grid-row: span 1; }
    .span-4-1  { grid-column: span 4; grid-row: span 1; }

    .logotype-display { font-size: 60px; }
    .closing-text { font-size: 24px; }
}

/* --------------------------------------------------------------------------
   Responsive: Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    :root { --tray-gap: 48px; }

    body { font-size: 16px; }

    .page { padding: 16px; }

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

    .span-12-2,
    .span-8-2,
    .span-4-2,
    .span-8-1,
    .span-4-1 {
        grid-column: span 4;
        grid-row: auto;
    }

    .cell { padding: 22px 20px; }

    .tray-threshold .grid {
        min-height: 80vh;
    }
    .cell-threshold {
        min-height: 70vh;
        padding: 48px 24px;
    }
    .logotype-display { font-size: 56px; }
    .threshold-phrase { font-size: 19px; }

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

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

    .cell-fragment { min-height: 90px; }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .cell {
        opacity: 1;
        transform: none;
        transition: border-color 200ms ease, box-shadow 200ms ease;
    }
    .cell:hover { transform: none; }
    .bokeh-circle { animation: none !important; }
    .menu-overlay { transition: opacity 0ms; }
}
