/* ============================================
   gabs.boo v2 — Haunted Value Discovery
   Palette: #8B7355, #F5F0E8, #5C8A6E, #C45B5B, #A09888, #E8C86A, #2A2218
   Fonts: Alfa Slab One, Nunito, Inconsolata
   ============================================ */

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

:root {
    --warm-earth: #8B7355;
    --ghost-white: #F5F0E8;
    --phantom-green: #5C8A6E;
    --hidden-cost-red: #C45B5B;
    --fog-gray: #A09888;
    --candle-flicker: #E8C86A;
    --deep-shadow: #2A2218;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.7;
    color: var(--ghost-white);
    background-color: var(--warm-earth);
    overflow-x: hidden;
}

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

h1, h2, h3 {
    font-family: 'Alfa Slab One', serif;
    font-weight: 400;
    line-height: 1.2;
}

h2 {
    font-size: clamp(28px, 5vw, 60px);
}

h3 {
    font-size: clamp(20px, 3vw, 32px);
    margin-bottom: 0.75rem;
}

.ghost-data {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 700;
    color: var(--candle-flicker);
    display: block;
    margin-bottom: 0.5rem;
}

/* ============================================
   FLICKER EFFECT
   ============================================ */

@keyframes flicker {
    0%   { opacity: 1; }
    20%  { opacity: 0.4; }
    40%  { opacity: 1; }
    60%  { opacity: 0.6; }
    80%  { opacity: 1; }
    100% { opacity: 1; }
}

.flickering {
    animation: flicker 200ms ease-in-out;
}

/* ============================================
   FLOATING SHAPES (generated via JS)
   ============================================ */

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 4px;
    opacity: 0;
    will-change: transform, opacity;
}

.floating-shape--circle {
    border-radius: 50%;
}

@keyframes shapeDrift {
    0% {
        transform: translate(var(--startX), var(--startY));
        opacity: 0;
    }
    8% {
        opacity: var(--peakOpacity);
    }
    50% {
        transform: translate(var(--midX), var(--midY));
    }
    92% {
        opacity: var(--peakOpacity);
    }
    100% {
        transform: translate(var(--endX), var(--endY));
        opacity: 0;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--warm-earth);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(48px, 12vw, 140px);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 300ms ease;
}

.hero-title.visible {
    opacity: 1;
}

.title-gabs {
    color: var(--ghost-white);
    display: inline-block;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 400ms ease, transform 400ms ease;
}

.title-gabs.animate-in {
    opacity: 1;
    transform: scale(1);
}

.title-boo {
    color: transparent;
    -webkit-text-stroke: 2px var(--ghost-white);
    display: inline-block;
    opacity: 0;
    position: relative;
}

.title-boo.animate-in {
    opacity: 1;
}

/* SVG stroke-dashoffset draw for .BOO — handled via JS on the ghost path */
.title-boo--drawing {
    animation: booGlow 600ms ease-out forwards;
}

@keyframes booGlow {
    0%   { text-shadow: none; }
    50%  { text-shadow: 0 0 20px rgba(92, 138, 110, 0.3); }
    100% { text-shadow: none; }
}

.hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(16px, 2vw, 24px);
    color: var(--fog-gray);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.hero-subtitle.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   GHOST SVG DIVIDERS
   ============================================ */

.ghost-divider {
    display: block;
    width: 220px;
    max-width: 80%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.ghost-divider--hero {
    margin-top: 3rem;
}

.ghost-divider--trail {
    margin-bottom: 4rem;
}

.ghost-divider--reveal {
    margin-bottom: 3rem;
}

.ghost-path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 1.2s ease;
}

.ghost-path.drawn {
    stroke-dashoffset: 0;
}

.ghost-eye {
    opacity: 0;
    transition: opacity 400ms ease 1s;
}

.ghost-eye.visible {
    opacity: 0.7;
}

/* ============================================
   BENTO GRID SECTION
   ============================================ */

.bento-section {
    padding: 6rem 2rem;
    position: relative;
    background-color: var(--deep-shadow);
}

.section-heading {
    text-align: center;
    color: var(--ghost-white);
    margin-bottom: 3rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(160, 152, 136, 0.1);
    border: 1px solid rgba(160, 152, 136, 0.1);
    opacity: 0;
    transition: opacity 800ms ease;
}

.bento-grid.visible {
    opacity: 1;
}

.bento-cell {
    position: relative;
    min-height: 220px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 300ms ease, box-shadow 300ms ease;
    overflow: hidden;
}

.bento-cell--wide {
    grid-column: span 2;
}

.bento-cell--tall {
    grid-row: span 2;
}

.cell-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.cell-inner h3 {
    color: var(--ghost-white);
}

.cell-inner p {
    color: var(--fog-gray);
    font-size: clamp(14px, 1.4vw, 17px);
    max-width: 400px;
    margin: 0 auto;
}

.cell-icon {
    display: block;
    margin: 0 auto 1rem;
}

.cell-illustration {
    display: block;
    margin: 1.5rem auto 0;
}

/* Visible cells */
.bento-cell--visible {
    background-color: var(--deep-shadow);
}

.bento-cell--visible .cell-inner {
    opacity: 1;
}

/* Hidden (ghost-reveal) cells */
.bento-cell--hidden {
    background-color: var(--deep-shadow);
    cursor: pointer;
}

.bento-cell--hidden .cell-inner {
    opacity: 0;
    transition: opacity 300ms ease;
}

.bento-cell--hidden:hover,
.bento-cell--hidden.revealed {
    background-color: var(--ghost-white);
    box-shadow: 0 0 20px rgba(92, 138, 110, 0.2);
}

.bento-cell--hidden:hover .cell-inner,
.bento-cell--hidden.revealed .cell-inner {
    opacity: 1;
}

.bento-cell--hidden:hover h3,
.bento-cell--hidden.revealed h3 {
    color: var(--deep-shadow);
}

.bento-cell--hidden:hover p,
.bento-cell--hidden.revealed p {
    color: var(--warm-earth);
}

.bento-cell--hidden:hover .ghost-data,
.bento-cell--hidden.revealed .ghost-data {
    color: var(--hidden-cost-red);
}

/* Tease animation for hidden cells at load */
@keyframes cellTease {
    0%   { background-color: var(--deep-shadow); }
    20%  { background-color: var(--ghost-white); }
    35%  { background-color: var(--ghost-white); }
    55%  { background-color: var(--deep-shadow); }
    100% { background-color: var(--deep-shadow); }
}

@keyframes contentTease {
    0%   { opacity: 0; }
    20%  { opacity: 0.6; }
    35%  { opacity: 0.6; }
    55%  { opacity: 0; }
    100% { opacity: 0; }
}

.bento-cell--hidden.tease {
    animation: cellTease 800ms ease forwards;
}

.bento-cell--hidden.tease .cell-inner {
    animation: contentTease 800ms ease forwards;
}

/* ============================================
   GHOST TRAIL SECTION
   ============================================ */

.ghost-trail-section {
    padding: 6rem 2rem;
    position: relative;
    background-color: var(--warm-earth);
}

.trail-content {
    max-width: 800px;
    margin: 0 auto;
}

.trail-item {
    padding: 3rem 0;
    border-bottom: 1px solid rgba(160, 152, 136, 0.2);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.trail-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.trail-item:last-child {
    border-bottom: none;
}

.trail-item h3 {
    color: var(--candle-flicker);
    margin-bottom: 1rem;
}

.trail-item p {
    color: var(--ghost-white);
}

/* Afterimage effect */
.afterimage-target {
    position: relative;
}

.afterimage-clone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
    transform: translate(5px, 5px);
    filter: blur(1.5px);
    z-index: -1;
    transition: opacity 2s ease;
}

.afterimage-clone.fading {
    opacity: 0;
}

/* ============================================
   REVEAL SECTION
   ============================================ */

.reveal-section {
    padding: 6rem 2rem;
    background-color: var(--deep-shadow);
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reveal-content {
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.reveal-heading {
    color: var(--candle-flicker);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

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

.reveal-subtitle {
    color: var(--fog-gray);
    font-size: clamp(16px, 1.8vw, 22px);
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 600ms ease 200ms;
}

.reveal-subtitle.visible {
    opacity: 1;
}

.reveal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.reveal-card {
    background-color: rgba(139, 115, 85, 0.15);
    border: 1px solid rgba(160, 152, 136, 0.15);
    padding: 2.5rem 1.5rem;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 400ms ease, transform 400ms ease, background-color 300ms ease, box-shadow 300ms ease;
}

.reveal-card.visible {
    opacity: 1;
    transform: scale(1);
}

.reveal-card:hover {
    background-color: rgba(139, 115, 85, 0.25);
    box-shadow: 0 0 30px rgba(92, 138, 110, 0.15);
}

.reveal-number {
    font-size: clamp(32px, 5vw, 48px);
    color: var(--candle-flicker);
}

.reveal-label {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: clamp(13px, 1.2vw, 16px);
    color: var(--fog-gray);
    margin-top: 0.5rem;
}

.reveal-coda {
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(20px, 3vw, 36px);
    color: var(--phantom-green);
    opacity: 0;
    transition: opacity 800ms ease 600ms;
}

.reveal-coda.visible {
    opacity: 1;
}

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

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-cell--wide {
        grid-column: span 2;
    }

    .bento-cell--tall {
        grid-row: span 1;
    }

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

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-cell--wide {
        grid-column: span 1;
    }

    .reveal-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-title {
        font-size: clamp(40px, 14vw, 80px);
    }

    .title-boo {
        -webkit-text-stroke-width: 1.5px;
    }

    .bento-cell {
        min-height: 180px;
    }
}
