@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Mono:wght@400;500&family=Manrope:wght@300;400;500;600&display=swap');

/* =========================================
   GLOBAL
========================================= */

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

:root {
    --page-bg: #08090b;
    --text-main: #e8e5df;
    --text-muted: rgba(232, 229, 223, 0.48);
    --line: rgba(232, 229, 223, 0.16);

    --image-blur: 0.3px;
    --image-opacity: 0.82;
    --image-saturation: 0.95;
    --wake-blur: 0px;
    --wake-opacity: 1;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 50% 34%, rgba(53, 57, 67, 0.13), transparent 48%),
        var(--page-bg);
    color: var(--text-main);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 300;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.dream-page {
    position: relative;
}

/* =========================================
   LAYER-SPECIFIC ATMOSPHERE
========================================= */

.level-one {
    --image-blur: 0.3px;
    --image-opacity: 0.84;
    --image-saturation: 0.98;
    --wake-blur: 0px;
    --wake-opacity: 1;
}

.level-two {
    --image-blur: 2.5px;
    --image-opacity: 0.72;
    --image-saturation: 0.68;
    --wake-blur: 1.2px;
    --wake-opacity: 0.82;
}

.level-three {
    --image-blur: 5.5px;
    --image-opacity: 0.60;
    --image-saturation: 0.48;
    --wake-blur: 4px;
    --wake-opacity: 0.56;
}

/* =========================================
   HEADER
========================================= */

.site-header {
    width: min(1440px, calc(100% - 80px));
    margin: 0 auto;
    padding: 30px 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.brand {
    justify-self: start;
    font-size: 14px;
    letter-spacing: 0.34em;
    font-weight: 500;
}

.layer-indicator {
    justify-self: center;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.22em;
    white-space: nowrap;
}

.layer-indicator span {
    opacity: 0.5;
}

.wake-link {
    justify-self: end;
    font-size: 10px;
    letter-spacing: 0.24em;
    opacity: var(--wake-opacity);
    filter: blur(var(--wake-blur));
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.wake-link:hover {
    opacity: 1;
    filter: blur(0);
}

/* =========================================
   INTRO
========================================= */

.dream-intro {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
    padding: 110px 0 55px;
    text-align: center;
}

.eyebrow {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.3em;
    line-height: 1.8;
}

.dream-intro h1 {
    margin-top: 24px;
    font-size: clamp(42px, 7vw, 92px);
    line-height: 0.98;
    letter-spacing: 0.045em;
    font-weight: 200;
}

.intro-description {
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.09em;
    line-height: 1.8;
}

/* =========================================
   CLOCK + SPINNING TOP
========================================= */

.instrument-stage {
    width: min(740px, calc(100% - 48px));
    min-height: 190px;
    margin: 0 auto 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(80px, 15vw, 190px);
}

.clock-wrap,
.top-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.clock-face {
    position: relative;
    width: 142px;
    height: 142px;
    border: 1px solid rgba(230, 226, 218, 0.52);
    border-radius: 50%;
    box-shadow:
        0 0 28px rgba(220, 220, 220, 0.06),
        inset 0 0 25px rgba(220, 220, 220, 0.035);
}

.clock-face::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(230, 226, 218, 0.12);
    border-radius: 50%;
}

.clock-number {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    color: rgba(235, 232, 225, 0.78);
    font-family: Georgia, serif;
    font-size: 11px;
    font-weight: 400;
}

.clock-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: 50% 100%;
    border-radius: 20px;
}

.hour-hand {
    width: 3px;
    height: 34px;
    margin-left: -1.5px;
    background: rgba(235, 232, 225, 0.86);
}

.minute-hand {
    width: 2px;
    height: 48px;
    margin-left: -1px;
    background: rgba(235, 232, 225, 0.86);
}

.second-hand {
    width: 1px;
    height: 55px;
    margin-left: -0.5px;
    background: #a78c76;
}

.clock-center {
    position: absolute;
    width: 7px;
    height: 7px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #d8c8b4;
}

.instrument-caption {
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0.32em;
}

/* A small metallic, three-dimensional-looking top */

.top-wrap {
    min-width: 100px;
}

.spinning-top {
    position: relative;
    width: 72px;
    height: 126px;
    transform-style: preserve-3d;
    perspective: 600px;
    animation: topSpin 1.25s linear infinite;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}

.spinning-top.is-stopped {
    animation-play-state: paused;
}

.top-cap {
    position: absolute;
    z-index: 4;
    width: 28px;
    height: 15px;
    left: 22px;
    top: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0e8dc, #75695e 55%, #ded1bd);
    box-shadow: inset -4px -3px 6px rgba(0, 0, 0, 0.45);
}

.top-neck {
    position: absolute;
    z-index: 3;
    left: 29px;
    top: 12px;
    width: 14px;
    height: 24px;
    border-radius: 5px;
    background: linear-gradient(90deg, #514b45, #e6d7c4 45%, #686057);
}

.top-body {
    position: absolute;
    z-index: 2;
    left: 2px;
    top: 29px;
    width: 68px;
    height: 69px;
    clip-path: polygon(50% 0, 100% 78%, 50% 100%, 0 78%);
    background:
        linear-gradient(90deg, #3e3934 0%, #c8bba9 24%, #f0e7d9 43%, #766d63 68%, #262421 100%);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.28);
}

.top-body::after {
    content: "";
    position: absolute;
    left: 32px;
    top: 4px;
    width: 2px;
    height: 57px;
    background: rgba(255, 255, 255, 0.38);
    filter: blur(1px);
}

.top-tip {
    position: absolute;
    z-index: 1;
    left: 32px;
    top: 91px;
    width: 8px;
    height: 31px;
    background: linear-gradient(90deg, #544c43, #e5d4bb, #655b50);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

@keyframes topSpin {
    from {
        transform: rotateY(0deg) rotateZ(-3deg);
    }

    to {
        transform: rotateY(360deg) rotateZ(-3deg);
    }
}

/* =========================================
   EMOTION SECTION
========================================= */

.emotion-section {
    width: min(1320px, calc(100% - 64px));
    margin: 0 auto;
    padding: 0 0 80px;
}

.section-heading {
    text-align: center;
    margin-bottom: 42px;
}

.section-heading h2 {
    margin-top: 13px;
    font-size: clamp(19px, 2.5vw, 29px);
    font-weight: 300;
    letter-spacing: 0.13em;
}

.section-heading > p:last-child {
    margin-top: 13px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.08em;
}

/*
   The emotion areas sit together without card borders or visible gutters.
   Their image edges are softly masked so the images fade into one another.
*/

.emotion-fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(230px, 1fr));
    gap: 0;
    position: relative;
    isolation: isolate;
}

.emotion-region {
    position: relative;
    min-width: 0;
    min-height: 230px;
    isolation: isolate;
    cursor: crosshair;
    outline: none;
    transition: z-index 0s;
}

/* An organic mosaic arrangement */

.emotion-region:nth-child(1) {
    grid-column: 1 / 5;
    grid-row: 1 / 3;
}

.emotion-region:nth-child(2) {
    grid-column: 5 / 9;
    grid-row: 1 / 3;
}

.emotion-region:nth-child(3) {
    grid-column: 9 / 13;
    grid-row: 1 / 2;
}

.emotion-region:nth-child(4) {
    grid-column: 9 / 13;
    grid-row: 2 / 3;
}

.emotion-region:nth-child(5) {
    grid-column: 1 / 4;
    grid-row: 3 / 5;
}

.emotion-region:nth-child(6) {
    grid-column: 4 / 7;
    grid-row: 3 / 5;
}

.emotion-region:nth-child(7) {
    grid-column: 7 / 10;
    grid-row: 3 / 4;
}

.emotion-region:nth-child(8) {
    grid-column: 10 / 13;
    grid-row: 3 / 4;
}

.emotion-region:nth-child(9) {
    grid-column: 7 / 10;
    grid-row: 4 / 5;
}

.emotion-region:nth-child(10) {
    grid-column: 10 / 13;
    grid-row: 4 / 5;
}

/* The image itself */

.emotion-image {
    position: absolute;
    inset: -5%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--image-opacity);
    filter:
        blur(var(--image-blur))
        saturate(var(--image-saturation));
    transform:
        translate3d(
            var(--shift-x, 0px),
            var(--shift-y, 0px),
            0
        )
        scale(1.08);
    border-radius: 48%;
    -webkit-mask-image: radial-gradient(
        ellipse 76% 72% at center,
        rgba(0, 0, 0, 1) 42%,
        rgba(0, 0, 0, 0.92) 60%,
        rgba(0, 0, 0, 0.55) 78%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 76% 72% at center,
        rgba(0, 0, 0, 1) 42%,
        rgba(0, 0, 0, 0.92) 60%,
        rgba(0, 0, 0, 0.55) 78%,
        transparent 100%
    );
    transition:
        opacity 0.6s ease,
        filter 0.6s ease,
        transform 0.25s ease-out;
    pointer-events: none;
}

/* Slightly varied shapes help avoid a rigid tiled appearance */

.emotion-region:nth-child(3n + 1) .emotion-image {
    border-radius: 56% 44% 51% 49%;
}

.emotion-region:nth-child(3n + 2) .emotion-image {
    border-radius: 45% 55% 47% 53%;
}

.emotion-region:nth-child(3n) .emotion-image {
    border-radius: 52% 48% 58% 42%;
}

.emotion-region:hover,
.emotion-region:focus-visible {
    z-index: 5;
}

.emotion-region:hover .emotion-image,
.emotion-region:focus-visible .emotion-image {
    opacity: 1;
    transform:
        translate3d(
            var(--shift-x, 0px),
            var(--shift-y, 0px),
            0
        )
        scale(1.14);
}

.emotion-label {
    position: absolute;
    left: 11%;
    bottom: 17%;
    max-width: 82%;
    color: rgba(245, 241, 233, 0.92);
    font-size: clamp(11px, 1.25vw, 16px);
    font-weight: 400;
    letter-spacing: 0.22em;
    line-height: 1.4;
    text-shadow:
        0 2px 16px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.emotion-region:hover .emotion-label,
.emotion-region:focus-visible .emotion-label {
    opacity: 1;
}

/* =========================================
   DESCENT LINK — LAYERS 01 AND 02
========================================= */

.descent-section {
    width: min(1000px, calc(100% - 48px));
    margin: 0 auto;
    padding: 45px 0 125px;
    text-align: center;
}

.descent-link {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-top: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(232, 229, 223, 0.4);
    font-size: clamp(12px, 1.5vw, 16px);
    letter-spacing: 0.16em;
    transition:
        gap 0.3s ease,
        border-color 0.3s ease,
        opacity 0.3s ease;
}

.descent-link span {
    font-size: 19px;
}

.descent-link:hover {
    gap: 30px;
    border-color: rgba(232, 229, 223, 0.9);
}

/* =========================================
   LAYER 03 — WAKE UP SECTION
========================================= */

.wake-section {
    width: min(1000px, calc(100% - 48px));
    margin: 0 auto;
    padding: 65px 0 125px;
    text-align: center;
}

.wake-section h2 {
    margin-top: 18px;
    font-size: clamp(23px, 4vw, 42px);
    font-weight: 200;
    letter-spacing: 0.13em;
}

.wake-stage {
    position: relative;
    min-height: 300px;
    margin-top: 30px;
}

.wake-runway {
    position: absolute;
    inset: 12px 300px 12px 12px;
}

.wake-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    padding: 17px 25px;
    border: 1px solid rgba(232, 229, 223, 0.55);
    background: rgba(232, 229, 223, 0.035);
    color: var(--text-main);
    font-size: 11px;
    letter-spacing: 0.2em;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.wake-button:hover {
    background: rgba(232, 229, 223, 0.1);
    border-color: rgba(232, 229, 223, 0.9);
}

/* Hidden alternative — more reliable hover area */

.secret-zone {
    position: absolute;
    z-index: 10;
    right: 0;
    bottom: 20px;
    width: min(360px, 42%);
    min-width: 275px;
    height: 90px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.secret-link {
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    color: #a99575;

    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-decoration: none;

    filter: blur(3px);
    pointer-events: none;

    transition:
        opacity 0.4s ease,
        filter 0.4s ease,
        visibility 0.4s ease;
}

/* Reveal when the mouse enters the secret area */

.secret-zone:hover .secret-link,
.secret-zone:focus-within .secret-link {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    pointer-events: auto;
}

/* Make the touch-screen version usable too */

@media (hover: none) {
    .secret-link {
        opacity: 0.75;
        visibility: visible;
        filter: blur(0.5px);
        pointer-events: auto;
    }
}

/* =========================================
   FOOTER
========================================= */

.site-footer {
    width: min(1440px, calc(100% - 80px));
    min-height: 75px;
    margin: 0 auto;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0.22em;
}

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

@media (max-width: 760px) {
    .site-header {
        width: calc(100% - 36px);
        padding: 22px 0;
        grid-template-columns: 1fr auto;
        row-gap: 12px;
    }

    .layer-indicator {
        grid-column: 1 / 2;
        grid-row: 2;
        justify-self: start;
        font-size: 8px;
    }

    .wake-link {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .dream-intro {
        padding-top: 75px;
    }

    .dream-intro h1 {
        font-size: clamp(37px, 11vw, 66px);
    }

    .instrument-stage {
        gap: 70px;
        margin-bottom: 75px;
        transform: scale(0.9);
    }

    .emotion-section {
        width: calc(100% - 24px);
    }

    .emotion-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .emotion-region,
    .emotion-region:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
        min-height: 220px;
    }

    .emotion-region:nth-child(3n + 1) {
        min-height: 260px;
    }

    .emotion-label {
        left: 10%;
        bottom: 15%;
        font-size: 10px;
        letter-spacing: 0.14em;
    }

    .wake-runway {
        inset: 10px 10px 90px;
    }

    .secret-zone {
        right: 0;
        bottom: 10px;
        width: 100%;
        height: 60px;
    }

    .site-footer {
        width: calc(100% - 36px);
        padding: 22px 0;
        flex-wrap: wrap;
        font-size: 7px;
    }
}

@media (max-width: 420px) {
    .instrument-stage {
        gap: 50px;
        transform: scale(0.82);
    }

    .clock-face {
        width: 125px;
        height: 125px;
    }

    .emotion-region,
    .emotion-region:nth-child(n) {
        min-height: 185px;
    }

    .emotion-region:nth-child(3n + 1) {
        min-height: 220px;
    }

    .wake-button {
        padding: 14px 16px;
        font-size: 9px;
        letter-spacing: 0.13em;
    }
}

/* =========================================
   DREAM LAYERS — TYPOGRAPHY REFINEMENT
   Matches the opening page's font palette.
   Does not change the existing layout.
========================================= */

/* General body font */
body.dream-page {
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
}

/* Technical labels and navigation */
.dream-page .brand,
.dream-page .layer-indicator,
.dream-page .wake-link,
.dream-page .eyebrow,
.dream-page .instrument-caption,
.dream-page .site-footer {
    font-family: 'DM Mono', monospace;
}

/* Main dream titles */
.dream-page .dream-intro h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(56px, 7.6vw, 108px);
    line-height: 0.92;
    letter-spacing: -0.025em;
}

/* Introductory descriptions */
.dream-page .intro-description {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(18px, 1.8vw, 23px);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.015em;
    line-height: 1.5;
}

/* Emotion section heading */
.dream-page .section-heading h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(27px, 3vw, 38px);
    font-weight: 500;
    letter-spacing: 0.07em;
    line-height: 1.1;
}

/* Small text beneath the emotion section heading */
.dream-page .section-heading > p:last-child {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.06em;
}

/* Emotion names */
.dream-page .emotion-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(19px, 1.8vw, 25px);
    font-weight: 600;
    letter-spacing: 0.13em;
    line-height: 1.1;
    text-shadow:
        0 2px 12px rgba(0, 0, 0, 0.75),
        0 0 24px rgba(0, 0, 0, 0.45);
}

/* Descent links */
.dream-page .descent-link {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
}

/* Final wake-up question */
.dream-page .wake-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(34px, 4.5vw, 54px);
    font-weight: 400;
    letter-spacing: 0.08em;
}

/* Wake-up button */
.dream-page .wake-button {
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.14em;
}

/* Hidden alternative */
.dream-page .secret-link {
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.13em;
}

/* Clock numbers */
.dream-page .clock-number {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
}

/* Remove horizontal lines near header and footer */
.dream-page .site-header {
    border-bottom: none !important;
    box-shadow: none !important;
}

.dream-page .site-footer {
    border-top: none !important;
    box-shadow: none !important;
}

/* Remove decorative pseudo-element lines, if any */
.dream-page .site-header::before,
.dream-page .site-header::after,
.dream-page .site-footer::before,
.dream-page .site-footer::after {
    content: none !important;
    display: none !important;
}

/* Hide WITHIN but preserve its space */
.dream-page .site-header .brand,
.dream-page .site-footer .brand {
    visibility: hidden !important;
}

/* Make WAKE UP larger and keep it on the right */
.dream-page .site-header .wake-link {
    font-size: 14px !important;
    letter-spacing: 0.22em;
    margin-left: auto;
    text-align: right;
    padding: 8px 0 8px 12px;
}

/* Disable the old clock animations */
.dream-page .clock-hand {
    animation: none !important;
    transition: none !important;
    transform-origin: 50% 100% !important;
}

/* =========================================
   DREAM DESCENT TRANSITION
   Move downward into the next dream layer
========================================= */

/* Leaving the current layer */
.dream-page.is-descending {
    animation: descendIntoDream 0.85s cubic-bezier(.7, 0, .9, .3) forwards;
    pointer-events: none;
}

@keyframes descendIntoDream {
    0% {
        transform: translateY(0);
        filter: blur(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh);
        filter: blur(12px);
        opacity: 0;
    }
}

/* Entering the next layer */
.dream-page.is-entering-layer {
    animation: emergeFromBelow 0.9s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes emergeFromBelow {
    0% {
        transform: translateY(100vh);
        filter: blur(12px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        filter: blur(0);
        opacity: 1;
    }
}

/* Darken the screen while descending */
.dream-page.is-descending::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    pointer-events: none;
    animation: descentDarkness 0.85s ease-in forwards;
}

@keyframes descentDarkness {
    0% { opacity: 0; }
    100% { opacity: 0.85; }
}