/* GGIGGL.com — Marble palace of laughter
   Palette: #F2EDE4 marble, #1A1A1E obsidian, #7B2FBE violet, #2FBE9F teal,
            #C9A84C gold, #B8B0A6 shadow */

:root {
    --marble: #F2EDE4;
    --obsidian: #1A1A1E;
    --violet: #7B2FBE;
    --teal: #2FBE9F;
    --gold: #C9A84C;
    --shadow: #B8B0A6;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-slow: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body {
    background: var(--marble);
    color: var(--obsidian);
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body::-webkit-scrollbar { display: none; }

body {
    min-height: 100vh;
    position: relative;
}

/* ===== Marble textures ===== */
.marble-carrara,
[data-marble="carrara"] {
    background-color: var(--marble);
    background-image:
        repeating-linear-gradient(23deg,
            rgba(184, 176, 166, 0.10) 0px,
            rgba(184, 176, 166, 0.10) 1px,
            transparent 1px, transparent 9px),
        repeating-linear-gradient(67deg,
            rgba(184, 176, 166, 0.07) 0px,
            rgba(184, 176, 166, 0.07) 1px,
            transparent 1px, transparent 14px),
        repeating-linear-gradient(134deg,
            rgba(26, 26, 30, 0.04) 0px,
            rgba(26, 26, 30, 0.04) 1px,
            transparent 1px, transparent 23px),
        radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(184,176,166,0.18) 0%, transparent 55%);
    filter: contrast(1.05) brightness(1.02);
}

[data-marble="viola"] {
    background-color: #F2EDE4;
    background-image:
        repeating-linear-gradient(23deg,
            rgba(123, 47, 190, 0.08) 0px,
            rgba(123, 47, 190, 0.08) 1px,
            transparent 1px, transparent 11px),
        repeating-linear-gradient(67deg,
            rgba(123, 47, 190, 0.05) 0px,
            rgba(123, 47, 190, 0.05) 1px,
            transparent 1px, transparent 17px),
        repeating-linear-gradient(134deg,
            rgba(184, 176, 166, 0.05) 0px,
            rgba(184, 176, 166, 0.05) 1px,
            transparent 1px, transparent 21px),
        radial-gradient(ellipse at 70% 30%, rgba(123,47,190,0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.4) 0%, transparent 55%);
    filter: contrast(1.05) brightness(1.02);
}

[data-marble="nero"] {
    background-color: var(--obsidian);
    color: var(--marble);
    background-image:
        repeating-linear-gradient(23deg,
            rgba(201, 168, 76, 0.07) 0px,
            rgba(201, 168, 76, 0.07) 1px,
            transparent 1px, transparent 13px),
        repeating-linear-gradient(67deg,
            rgba(201, 168, 76, 0.04) 0px,
            rgba(201, 168, 76, 0.04) 1px,
            transparent 1px, transparent 19px),
        repeating-linear-gradient(134deg,
            rgba(242, 237, 228, 0.03) 0px,
            rgba(242, 237, 228, 0.03) 1px,
            transparent 1px, transparent 27px),
        radial-gradient(ellipse at 25% 35%, rgba(201,168,76,0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 70%, rgba(123,47,190,0.10) 0%, transparent 55%);
    filter: contrast(1.08) brightness(0.95);
}

/* ===== Scroll progress (gold line) ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, var(--gold), rgba(201,168,76,0.4));
    z-index: 1000;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px rgba(201,168,76,0.6);
}

/* ===== Aurora backdrop ===== */
.aurora-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0.55;
}
.aurora {
    position: absolute;
    inset: -20%;
    background-size: 200% 200%;
    mix-blend-mode: screen;
    filter: blur(40px);
}
.aurora-1 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(123,47,190,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(47,190,159,0.3) 0%, transparent 50%);
    animation: auroraShift 30s ease-in-out infinite;
}
.aurora-2 {
    background:
        radial-gradient(ellipse at 70% 30%, rgba(123,47,190,0.30) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 70%, rgba(47,190,159,0.25) 0%, transparent 55%);
    animation: auroraShift 45s ease-in-out infinite reverse;
    opacity: 0.7;
}
.aurora-3 {
    background:
        radial-gradient(ellipse at 50% 80%, rgba(123,47,190,0.20) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 20%, rgba(47,190,159,0.18) 0%, transparent 60%);
    animation: auroraShift 60s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes auroraShift {
    0%   { background-position: 0% 0%, 100% 100%; transform: translate(0,0) scale(1); }
    25%  { background-position: 50% 30%, 50% 70%; transform: translate(-2%,1%) scale(1.05); }
    50%  { background-position: 100% 100%, 0% 0%; transform: translate(2%,-1%) scale(1.02); }
    75%  { background-position: 50% 70%, 50% 30%; transform: translate(-1%,2%) scale(1.04); }
    100% { background-position: 0% 0%, 100% 100%; transform: translate(0,0) scale(1); }
}

/* ===== Isometric decorative cubes ===== */
.iso-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    perspective: 1200px;
}
.iso-cube {
    position: absolute;
    width: 80px;
    height: 80px;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(45deg);
    opacity: 0.42;
    animation: floatIso 14s ease-in-out infinite;
    will-change: transform;
}
.iso-cube .face {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image:
        repeating-linear-gradient(23deg, rgba(184,176,166,0.5) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(67deg, rgba(184,176,166,0.3) 0 1px, transparent 1px 12px),
        linear-gradient(135deg, #F2EDE4, #E6E0D3);
    border: 1px solid rgba(26,26,30,0.18);
}
.iso-cube .face-top    { transform: translateZ(40px); }
.iso-cube .face-left   { transform: rotateX(-90deg) translateZ(-40px) translateY(40px); filter: brightness(0.85); }
.iso-cube .face-right  { transform: rotateY(90deg) translateZ(40px); filter: brightness(0.92); }
.iso-cube-a { top: 12vh; left: 6vw; transform: rotateX(60deg) rotateZ(45deg) scale(0.8); animation-delay: 0s; }
.iso-cube-b { top: 38vh; right: 8vw; transform: rotateX(60deg) rotateZ(45deg) scale(1.1); animation-delay: -3s; }
.iso-cube-c { bottom: 22vh; left: 10vw; transform: rotateX(60deg) rotateZ(45deg) scale(0.9); animation-delay: -7s; }
.iso-cube-d { bottom: 8vh; right: 12vw; transform: rotateX(60deg) rotateZ(45deg) scale(0.7); animation-delay: -10s; }

@keyframes floatIso {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -22px; }
}

/* ===== Sections / diagonal palace ===== */
.palace { position: relative; z-index: 3; }

.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12vh 8vw;
    overflow: hidden;
    margin-top: -60px;
}

/* Foyer is flat-top, diagonal-bottom */
.section-foyer {
    margin-top: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vw), 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.18);
}

/* Diagonal cascade — alternating tilts */
.cascade-a {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.22);
}
.cascade-b {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.22);
}
.cascade-c {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.22);
}

.section-gallery {
    clip-path: polygon(0 0, 100% 8vw, 100% calc(100% - 8vw), 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.22);
}

.section-corridor {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.4);
}

.section-exit {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 100%);
    box-shadow: 0 30px 60px -30px rgba(26,26,30,0.22);
}

/* ===== Typography primitives ===== */
.overline {
    font-family: "Space Grotesk", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 0.78rem;
    color: var(--obsidian);
    opacity: 0.7;
    margin-bottom: 1.4rem;
}
.overline-violet { color: var(--violet); opacity: 0.9; }
.overline-teal   { color: var(--teal);   opacity: 0.95; }
.overline-gold   { color: var(--gold);   opacity: 1; }

.cormorant {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-weight: 500;
}

.oversized {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 5vw;
    line-height: 1.04;
    letter-spacing: 0.02em;
    color: var(--obsidian);
}
.oversized .cormorant {
    background: linear-gradient(120deg, var(--violet), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.align-right { text-align: right; }
.centered { text-align: center; }

.body {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-top: 1.4rem;
    max-width: 56ch;
    color: var(--obsidian);
    opacity: 0.85;
}

/* ===== Foyer wordmark ===== */
.section-foyer .iso-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(60deg, rgba(184,176,166,0.16) 1px, transparent 1px),
        linear-gradient(120deg, rgba(184,176,166,0.16) 1px, transparent 1px),
        linear-gradient(0deg, rgba(184,176,166,0.10) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px, 80px 80px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.foyer-inner {
    position: relative;
    text-align: center;
    z-index: 2;
}

.wordmark {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 14vw;
    line-height: 0.95;
    letter-spacing: 0.04em;
    color: var(--obsidian);
    cursor: default;
    user-select: none;
    margin: 1.2rem 0 1.6rem;
    display: inline-block;
}
.wordmark .letter {
    display: inline-block;
    transform-origin: 50% 60%;
    transition: color 0.5s ease;
    will-change: transform;
    background-image: linear-gradient(180deg, var(--obsidian) 0%, #2c2c33 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wordmark .letter::after {
    content: "";
    display: inline-block;
    width: 0;
}

.subline {
    font-size: 1.4rem;
    color: var(--obsidian);
    opacity: 0.85;
    margin-top: 0.6rem;
}

.caret-down {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0.7;
}
.caret-down span {
    width: 14px;
    height: 14px;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg);
    animation: caretDrift 2s ease-in-out infinite;
}
.caret-down span:nth-child(2) { animation-delay: 0.2s; opacity: 0.6; }
.caret-down span:nth-child(3) { animation-delay: 0.4s; opacity: 0.3; }
@keyframes caretDrift {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 6px; }
}

/* ===== Cascade content ===== */
.cascade-content {
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 2;
}
.cascade-a .cascade-content { transform: rotate(-1.2deg); }
.cascade-b .cascade-content { transform: rotate(1.2deg); margin-left: auto; text-align: right; }
.cascade-c .cascade-content { transform: rotate(-1.2deg); }

.cascade-b .body { margin-left: auto; }

/* ===== Reveal animation ===== */
.reveal {
    opacity: 0;
    transform: translate(20px, 20px);
    transition: opacity 1.0s var(--ease-slow), transform 1.0s var(--spring);
}
.reveal.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ===== Gallery / isometric cubes grid ===== */
.section-gallery { flex-direction: column; gap: 6vh; }
.gallery-header { width: 100%; text-align: center; }

.gallery-grid {
    --cube-size: 130px;
    position: relative;
    width: min(900px, 90vw);
    height: 520px;
    margin: 0 auto;
    perspective: 1400px;
}

.gcube {
    position: absolute;
    width: var(--cube-size);
    height: var(--cube-size);
    transform-style: preserve-3d;
    transform:
        translate(
            calc((var(--gx) - 1) * 230px + (var(--gy) * 115px)),
            calc((var(--gy) * 80px) - (var(--gx) * 30px) + 80px)
        )
        rotateX(60deg) rotateZ(45deg);
    transition: transform 0.9s var(--spring);
    will-change: transform;
    cursor: pointer;
}
.gcube .gface {
    position: absolute;
    width: var(--cube-size);
    height: var(--cube-size);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(26,26,30,0.2);
    background-image:
        repeating-linear-gradient(23deg, rgba(184,176,166,0.5) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(67deg, rgba(184,176,166,0.3) 0 1px, transparent 1px 13px),
        linear-gradient(135deg, #F4EFE6, #E5DED1);
    overflow: hidden;
}
.gcube .gface span {
    font-family: "Playfair Display", serif;
    color: var(--obsidian);
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}
.gcube .gtop span { font-size: 2.2rem; font-weight: 900; }
.gcube .gtop    { transform: translateZ(calc(var(--cube-size) / 2)); }
.gcube .gleft   { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / -2)) translateY(calc(var(--cube-size) / 2));
                  filter: brightness(0.82); }
.gcube .gright  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2));
                  filter: brightness(0.92); }

.gcube:hover {
    transform:
        translate(
            calc((var(--gx) - 1) * 230px + (var(--gy) * 115px)),
            calc((var(--gy) * 80px) - (var(--gx) * 30px) + 60px)
        )
        rotateX(60deg) rotateZ(45deg) scale(1.08);
}
.gcube.spin {
    animation: cubeSpin 1.4s var(--spring);
}
@keyframes cubeSpin {
    0%   { filter: none; }
    50%  { filter: drop-shadow(0 0 28px rgba(123,47,190,0.7)); }
    100% { filter: none; }
}

/* ===== Aurora corridor ===== */
.section-corridor {
    position: relative;
    color: var(--marble);
    flex-direction: column;
}
.section-corridor .overline { color: var(--gold); opacity: 1; }
.section-corridor .body { color: var(--marble); opacity: 0.85; }

.corridor-aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.corridor-band {
    position: absolute;
    inset: -25%;
    background-size: 200% 200%;
    mix-blend-mode: screen;
    filter: blur(60px);
}
.corridor-band.band-1 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(123,47,190,0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(47,190,159,0.5) 0%, transparent 50%);
    animation: auroraShift 24s ease-in-out infinite;
    opacity: 0.85;
}
.corridor-band.band-2 {
    background:
        radial-gradient(ellipse at 70% 30%, rgba(123,47,190,0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 70%, rgba(47,190,159,0.4) 0%, transparent 55%);
    animation: auroraShift 38s ease-in-out infinite reverse;
    opacity: 0.7;
}
.corridor-band.band-3 {
    background:
        radial-gradient(ellipse at 50% 80%, rgba(123,47,190,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 20%, rgba(47,190,159,0.35) 0%, transparent 60%);
    animation: auroraShift 52s ease-in-out infinite;
    opacity: 0.6;
}

.corridor-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1100px;
}
.luminous {
    color: var(--marble);
    text-shadow: 0 0 18px rgba(123,47,190,0.45),
                 0 0 36px rgba(47,190,159,0.25);
}
.luminous .cormorant {
    background: linear-gradient(120deg, #d6a6ff, #6cf3cf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.luminous-body { color: var(--marble); opacity: 0.85; margin: 1.4rem auto 0; }

.projection {
    margin: 3rem auto 0;
    width: min(620px, 80vw);
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: 0 0 24px rgba(201,168,76,0.7);
    transform: skewX(-30deg);
    opacity: 0.85;
}

/* ===== Grand exit ===== */
.section-exit { text-align: center; }
.exit-inner { width: 100%; }
.final-line {
    font-size: 7vw;
    line-height: 1.05;
}
.final-line .word {
    display: inline-block;
    margin: 0 0.18em;
}
.signoff {
    font-family: "Space Grotesk", sans-serif;
    margin-top: 2.4rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--gold);
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
    .wordmark { font-size: 22vw; }
    .oversized { font-size: 9vw; }
    .final-line { font-size: 12vw; }
    .gallery-grid { height: 700px; --cube-size: 100px; }
    .gcube {
        transform:
            translate(
                calc((var(--gx) - 1) * 160px + (var(--gy) * 80px)),
                calc((var(--gy) * 80px) - (var(--gx) * 24px) + 100px)
            )
            rotateX(60deg) rotateZ(45deg);
    }
    .iso-cube { width: 56px; height: 56px; }
    .iso-cube .face { width: 56px; height: 56px; }
    .iso-cube .face-top { transform: translateZ(28px); }
    .iso-cube .face-left { transform: rotateX(-90deg) translateZ(-28px) translateY(28px); }
    .iso-cube .face-right { transform: rotateY(90deg) translateZ(28px); }
    .section { padding: 14vh 6vw; }
}
