/* ============================================
   The Playground — Loom
   play.loom.web.id
   ============================================ */

:root {
    --bg:           #1e1b4b;
    --text:         #e0f2fe;
    --text-dim:     rgba(224, 242, 254, 0.45);

    /* Door colors — one per experience */
    --door-coral:   #fca5a5;
    --door-coral-s: #d97070;
    --door-lav:     #c4b5fd;
    --door-lav-s:   #8b7fcf;

    --shadow-depth: 8px;
    --radius:       16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Cabinet Grotesk', sans-serif;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ── Background subtle noise ── */
.bg-noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Layout wrapper ── */
.playground-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 5vh 8vw;
    gap: 6vh;
}

/* ── Header ── */
.pg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pg-back {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}
.pg-back:hover {
    color: var(--text);
}

.pg-sig {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: -0.02em;
}

/* ── Hero ── */
.pg-hero {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.pg-headline {
    font-size: clamp(4rem, 12vw, 14rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.05em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.18em;
    /* will be animated by GSAP */
    opacity: 0;
}

.hl-word {
    display: inline-block;
    /* 2.5D offset shadow — Loom visual grammar */
    text-shadow:
        1px 1px 0 var(--door-coral-s),
        2px 2px 0 var(--door-coral-s),
        3px 3px 0 var(--door-coral-s),
        4px 4px 0 var(--door-coral-s),
        5px 5px 0 var(--door-coral-s),
        6px 6px 0 var(--door-coral-s),
        7px 7px 0 var(--door-coral-s),
        8px 8px 0 var(--door-coral-s);
}

.pg-sub {
    font-size: clamp(0.9rem, 1.6vw, 1.15rem);
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.01em;
    opacity: 0;
    max-width: 42ch;
}

/* ── Doors grid ── */
.doors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    opacity: 0;
}

/* ── Single Door ── */
.door {
    --card-bg: var(--door-coral);
    --card-shadow: var(--door-coral-s);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* Surprise me door — lavender */
.door--surprise {
    --card-bg: var(--door-lav);
    --card-shadow: var(--door-lav-s);
}

/* Wrong door — mint green */
.door--green {
    --card-bg: #6ee7b7;
    --card-shadow: #3bba8a;
}

/* The visible card face with seamless 2.5D block shadow */
.door-inner {
    position: relative;
    z-index: 1;
    background-color: var(--card-bg);
    color: #1e1b4b;
    border-radius: var(--radius);
    padding: 2rem 2rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    height: 100%;
    min-height: 200px;
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--card-shadow);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.door-shadow {
    display: none;
}

/* Spring hover on desktop — float slightly up with deeper shadow */
@media (hover: hover) and (pointer: fine) {
    .door:hover .door-inner {
        transform: translate(-3px, -3px);
        box-shadow: calc(var(--shadow-depth) + 4px) calc(var(--shadow-depth) + 4px) 0px var(--card-shadow);
    }
}

/* Press fully on active */
.door:active .door-inner {
    transform: translate(var(--shadow-depth), var(--shadow-depth));
    box-shadow: 0px 0px 0px var(--card-shadow);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

/* Door content */
.door-tag {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
}

.door-name {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.door-desc {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
    line-height: 1.4;
    flex: 1;
}

.door-cta {
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
    display: block;
}

/* ── Footer ── */
.pg-footer {
    margin-top: auto;
    padding-top: 2vh;
}

.pg-footer-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dim);
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .playground-wrap {
        padding: 4vh 6vw;
    }

    .doors {
        grid-template-columns: 1fr;
    }

    .door-inner {
        min-height: 160px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .door-inner,
    .door-shadow {
        transition: none;
    }
}
