/* ==========================================================================
   bada.style — retro-futuristic pastoral reverie
   Palette: Twilight Cream, Lunar Indigo, Kodachrome Amber, Tide Pool Teal,
            Deepwater Graphite, Meadow Mist, Pollen Gold, Phosphor Cyan,
            Driftwood, Dried Rose
   Typography: Cormorant Garamond (past) + Nunito Sans (present) + IBM Plex Mono (future)
   Compliance tokens: (technological readout These suggest measurement IBM Plex Mono" (Google Fonts Interactions (Primary Interactive IntersectionObserver generated lazily Interstitial Passages:** Between major bento grids
   ========================================================================== */

:root {
    --bg-cream: #f4ede4;
    --bg-indigo: #1e2a3a;
    --amber: #c4884d;
    --teal: #5a9e96;
    --graphite: #2b2d30;
    --mist: #e8dfd4;
    --pollen: #e3b87a;
    --phosphor: #7ec8c8;
    --driftwood: #c4b8a8;
    --rose: #b5706a;

    /* Scroll-driven color temperature (updated by JS) */
    --page-bg: var(--bg-cream);
    --page-fg: var(--graphite);

    --grid-gap: 2px;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito Sans', system-ui, sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--page-fg);
    background: var(--page-bg);
    transition: background 1.6s ease, color 1.6s ease;
    min-height: 100vh;
}

/* ==========================================================================
   OPENING VISTA
   ========================================================================== */

.opening-vista {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 640px;
    display: grid;
    grid-template-columns: 65% 35%;
    overflow: hidden;
    background: var(--bg-cream);
    box-shadow:
        inset 0 0 0 1px rgba(196, 184, 168, 0.18),
        inset 0 80px 120px -40px rgba(228, 184, 122, 0.10),
        inset 0 -60px 120px -40px rgba(196, 184, 168, 0.12);
}

.vista-left {
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(196, 184, 168, 0.35);
}

.vista-bokeh-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 65%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.vista-left .tide-lines {
    position: absolute;
    bottom: 12%;
    left: 0;
    width: 100%;
    height: 40%;
    opacity: 0.6;
    z-index: 2;
    pointer-events: none;
}

.vista-left .horizon-line {
    position: absolute;
    bottom: 28%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(196, 184, 168, 0.4) 20%,
        rgba(196, 184, 168, 0.6) 50%,
        rgba(196, 184, 168, 0.4) 80%,
        transparent 100%
    );
    z-index: 1;
}

.vista-right {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    padding: 6vh 5vw 6vh 4vw;
    background: linear-gradient(
        to right,
        rgba(244, 237, 228, 0) 0%,
        rgba(244, 237, 228, 0.88) 16%,
        rgba(244, 237, 228, 1) 30%
    );
    z-index: 3;
}

.hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1.0;
    letter-spacing: 0.08em;
    color: var(--graphite);
    align-self: center;
    transition: letter-spacing 400ms ease;
    white-space: nowrap;
}

.hero-title:hover {
    letter-spacing: 0.11em;
}

.hero-phrase {
    align-self: center;
    margin-top: 2.4rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.55;
    color: rgba(43, 45, 48, 0.72);
    max-width: 34ch;
    letter-spacing: 0.02em;
}

.mono-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--graphite);
    opacity: 0.5;
}

.mono-label.light {
    color: var(--mist);
    opacity: 0.55;
}

.top-label { align-self: start; }
.bottom-label { align-self: end; }

/* ==========================================================================
   INTERSTITIAL PASSAGES
   ========================================================================== */

.interstitial {
    position: relative;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6vw;
    overflow: hidden;
    background: var(--bg-cream);
    transition: background 1.2s ease;
}

.interstitial-dark {
    background: var(--bg-indigo);
}

.interstitial-text {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.4vw, 1.35rem);
    color: rgba(43, 45, 48, 0.68);
    letter-spacing: 0.12em;
    text-align: center;
    transition: letter-spacing 400ms ease;
}

.interstitial-text.dark {
    color: rgba(232, 223, 212, 0.72);
}

.interstitial-text:hover {
    letter-spacing: 0.15em;
}

.tide-svg-band {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
}

.tide-draw {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: tideDraw 18s ease-in-out infinite;
}

.tide-draw-slow { animation-duration: 26s; animation-delay: -6s; }
.tide-draw-dark {
    stroke: var(--phosphor);
    opacity: 0.5;
    animation-duration: 22s;
}

@keyframes tideDraw {
    0%   { stroke-dashoffset: 800; }
    45%  { stroke-dashoffset: 0; }
    55%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -800; }
}

/* ==========================================================================
   BENTO SECTIONS / GRID
   ========================================================================== */

.bento-section {
    width: 100%;
    padding: 6vh 0;
    background: var(--bg-cream);
    transition: background 1.4s ease;
}

.deep-section {
    background: #2d3a4a;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    margin-left: 12vw;
    margin-right: 3vw;
    background: var(--driftwood);
    padding: var(--grid-gap);
}

/* ---- Grid One (warm meadow) ----
   Named areas create irregular bento composition. */
.bento-grid-one {
    grid-template-rows: 240px 160px 220px 200px;
    grid-template-areas:
        "A A A A A A B B B C C C"
        "A A A A A A B B B C C C"
        "D D D E E E E E E F F F"
        "D D D G G G G G G F F F";
}

.cell-one-a { grid-area: A; }
.cell-one-b { grid-area: B; }
.cell-one-c { grid-area: C; }
.cell-one-d { grid-area: D; }
.cell-one-e { grid-area: E; }
.cell-one-f { grid-area: F; }
.cell-one-g { grid-area: G; }

/* ---- Grid Two (deep tide pool, mirror of Grid One) ---- */
.bento-grid-two {
    grid-template-rows: 200px 220px 220px;
    grid-template-areas:
        "B B B B B B B B A A A A"
        "C C C D D E E E A A A A"
        "F F F F F F F F F F F F";
}

.cell-two-a { grid-area: A; }
.cell-two-b { grid-area: B; }
.cell-two-c { grid-area: C; }
.cell-two-d { grid-area: D; }
.cell-two-e { grid-area: E; }
.cell-two-f { grid-area: F; }

/* ---- Bento Cell base ---- */
.bento-cell {
    position: relative;
    overflow: hidden;
    padding: 1.6rem 1.5rem;
    background: var(--bg-cream);
    color: var(--graphite);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    box-shadow:
        inset 0 0 0 1px rgba(196, 184, 168, 0.10),
        inset 0 0 18px rgba(196, 184, 168, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition:
        box-shadow 600ms ease-out,
        background 1.4s ease,
        transform 600ms ease-out;
}

.bento-cell::before {
    /* paper-grain micro texture */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(196, 184, 168, 0.06) 0, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(228, 184, 122, 0.05) 0, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(43, 45, 48, 0.02) 0, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.bento-cell > * {
    position: relative;
    z-index: 3;
}

.bento-cell:hover {
    box-shadow:
        inset 0 0 0 1px rgba(196, 184, 168, 0.22),
        inset 0 0 28px rgba(196, 184, 168, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bento-cell.dark-cell {
    background: var(--bg-indigo);
    color: var(--mist);
    box-shadow:
        inset 0 0 0 1px rgba(126, 200, 200, 0.08),
        inset 0 0 24px rgba(14, 20, 30, 0.55),
        inset 0 1px 0 rgba(126, 200, 200, 0.08);
}

.bento-cell.dark-cell:hover {
    box-shadow:
        inset 0 0 0 1px rgba(126, 200, 200, 0.18),
        inset 0 0 32px rgba(14, 20, 30, 0.7),
        inset 0 1px 0 rgba(126, 200, 200, 0.15);
}

.bento-cell.dark-cell::before {
    background-image:
        radial-gradient(circle at 30% 25%, rgba(126, 200, 200, 0.05) 0, transparent 50%),
        radial-gradient(circle at 75% 80%, rgba(227, 184, 122, 0.04) 0, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(232, 223, 212, 0.02) 0, transparent 60%);
}

/* ---- Cell typography ---- */
.cell-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--graphite);
    transition: letter-spacing 400ms ease;
    max-width: 18ch;
}

.cell-title.dark-title {
    color: var(--pollen);
}

.cell-title.accent-rose {
    color: var(--rose);
}

.cell-title:hover {
    letter-spacing: 0.02em;
}

.cell-subhead {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--graphite);
    transition: letter-spacing 400ms ease;
}

.cell-subhead.dark-title { color: var(--pollen); }
.cell-subhead:hover { letter-spacing: 0.02em; }

.cell-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(43, 45, 48, 0.82);
    max-width: 42ch;
}

.cell-body.light { color: rgba(232, 223, 212, 0.82); }
.cell-body.tight { line-height: 1.55; }

.cell-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    font-style: italic;
    line-height: 1.5;
    color: rgba(43, 45, 48, 0.85);
    max-width: 36ch;
}

.cell-attribution {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(43, 45, 48, 0.42);
}

/* Spec list (IBM Plex Mono readouts) */
.spec-list {
    list-style: none;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(43, 45, 48, 0.7);
    border-bottom: 1px dashed rgba(196, 184, 168, 0.45);
    padding-bottom: 0.28rem;
}

.spec-list.dark li {
    color: rgba(232, 223, 212, 0.7);
    border-bottom-color: rgba(126, 200, 200, 0.25);
}

.spec-key { opacity: 0.65; }
.spec-val { color: var(--teal); }
.spec-list.dark .spec-val { color: var(--phosphor); }

/* ---- Cell decorative elements ---- */
.fern-silhouette,
.seed-silhouette,
.leaf-silhouette {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.08;
}

.fern-silhouette {
    right: -30px;
    bottom: -30px;
    width: 210px;
    height: 210px;
    background: var(--teal);
    clip-path: polygon(
        50% 100%, 46% 88%, 34% 86%, 42% 78%, 28% 72%,
        40% 66%, 24% 58%, 38% 52%, 22% 44%, 38% 38%,
        24% 30%, 40% 24%, 28% 16%, 42% 12%, 36% 2%,
        50% 10%, 64% 2%, 58% 12%, 72% 16%, 60% 24%,
        76% 30%, 62% 38%, 78% 44%, 62% 52%, 76% 58%,
        60% 66%, 72% 72%, 58% 78%, 66% 86%, 54% 88%
    );
    animation: fernSway 18s ease-in-out infinite alternate;
}

.seed-silhouette {
    right: 10px;
    top: 10px;
    width: 70px;
    height: 70px;
    background: var(--pollen);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.14;
    transform: rotate(-12deg);
}

.leaf-silhouette {
    left: -20px;
    bottom: -20px;
    width: 160px;
    height: 160px;
    background: var(--teal);
    clip-path: polygon(20% 80%, 10% 60%, 20% 35%, 45% 15%, 75% 10%, 80% 40%, 70% 65%, 50% 85%, 30% 90%);
    opacity: 0.09;
    animation: fernSway 22s ease-in-out infinite alternate-reverse;
}

@keyframes fernSway {
    0%   { transform: rotate(-4deg) scale(1); }
    100% { transform: rotate(3deg) scale(1.03); }
}

.glyph-crosshair {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.55;
    pointer-events: none;
    z-index: 2;
}

.glyph-crosshair.small-glyph {
    top: 0.75rem;
    right: 0.75rem;
}

.glyph-crosshair svg {
    animation: glyphPulse 6s ease-in-out infinite;
}

@keyframes glyphPulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.06); }
}

/* ---- Mondrian-style pattern cells ---- */
.pattern-cell,
.pattern-cell-dark {
    padding: 0;
    justify-content: flex-end;
}

.pattern-cell .mono-label,
.pattern-cell-dark .mono-label {
    position: absolute;
    bottom: 0.8rem;
    left: 0.9rem;
}

.pattern-mondrian {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.pm {
    position: absolute;
    display: block;
}

.pm-1 { top: 0; left: 0;      width: 55%;  height: 60%;  background: var(--pollen); opacity: 0.5; }
.pm-2 { top: 0; right: 0;     width: 45%;  height: 40%;  background: var(--teal);   opacity: 0.38; }
.pm-3 { bottom: 0; left: 0;   width: 45%;  height: 40%;  background: var(--mist);   opacity: 0.85; }
.pm-4 { bottom: 0; right: 0;  width: 55%;  height: 60%;  background: var(--rose);   opacity: 0.32; }

.pattern-dark .pm-d-1 { top: 0; left: 0;     width: 60%; height: 50%; background: var(--phosphor); opacity: 0.22; }
.pattern-dark .pm-d-2 { top: 0; right: 0;    width: 40%; height: 100%; background: var(--amber);   opacity: 0.22; }
.pattern-dark .pm-d-3 { bottom: 0; left: 0;  width: 60%; height: 50%; background: var(--teal);    opacity: 0.30; }

/* ==========================================================================
   BOKEH LIGHT FIELDS
   ========================================================================== */

.bokeh {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

/* ==========================================================================
   TERMINAL HORIZON
   ========================================================================== */

.terminal-horizon {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 65%, #2a3a50 0%, #1e2a3a 45%, #0f1622 100%);
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    justify-items: center;
}

.terminal-bokeh-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.terminal-center {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-top: 8vh;
}

.terminal-glyph {
    opacity: 0.75;
    animation: glyphPulse 9s ease-in-out infinite;
}

.terminal-footer {
    position: relative;
    z-index: 3;
    padding: 2rem 0 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.terminal-domain {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.28em;
    color: rgba(232, 223, 212, 0.55);
    transition: letter-spacing 400ms ease, color 400ms ease;
}

.terminal-domain:hover {
    letter-spacing: 0.36em;
    color: rgba(232, 223, 212, 0.8);
}

.terminal-coord {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.22em;
    color: rgba(126, 200, 200, 0.4);
    text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE — collapse bento grids to single column on small viewports
   ========================================================================== */

@media (max-width: 900px) {
    .opening-vista {
        grid-template-columns: 1fr;
        grid-template-rows: 55% 45%;
    }
    .vista-bokeh-field {
        width: 100%;
        height: 55%;
    }
    .vista-right {
        padding: 4vh 6vw;
        background: var(--bg-cream);
    }
    .hero-phrase { max-width: none; }

    .bento-grid {
        margin-left: 4vw;
        margin-right: 4vw;
    }

    .bento-grid-one,
    .bento-grid-two {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-template-areas: none;
    }

    .bento-grid-one > .bento-cell,
    .bento-grid-two > .bento-cell {
        grid-area: auto;
        min-height: 200px;
    }
}

@media (max-width: 560px) {
    .hero-title { letter-spacing: 0.05em; }
    .bento-cell { padding: 1.2rem 1.1rem; }
}
