/* ======================================================================
   THE LIVING TEMPLE — PROTOTYPE FOUR
   Inner Courtyard
   Clear, Dreamweaver-friendly CSS
   ====================================================================== */

:root {
    --temple-gold: #e7c98a;
    --temple-gold-bright: #fff2c8;
    --temple-ivory: #f6f0e4;
    --temple-night: #101827;
    --temple-blue: #1b2943;
    --temple-panel: rgba(11, 18, 31, 0.88);
    --temple-border: rgba(231, 201, 138, 0.42);
    --temple-text: #f5efe4;
    --temple-muted: #d2c8b5;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: #080d16;
    color: var(--temple-text);
    font-family: Georgia, "Times New Roman", serif;
}

button {
    font: inherit;
}

button:focus-visible {
    outline: 3px solid var(--temple-gold-bright);
    outline-offset: 4px;
}

.living-temple {
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: #080d16;
}

/* ----------------------------------------------------------------------
   SCENE BASE
   ---------------------------------------------------------------------- */

.scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.scene[hidden] {
    display: none;
}

.scene-enter {
    animation: sceneFadeIn 900ms ease both;
}

@keyframes sceneFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ----------------------------------------------------------------------
   INNER COURTYARD
   ---------------------------------------------------------------------- */

.scene-courtyard {
    min-height: 100vh;
    background: var(--temple-night);
}

.courtyard-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    pointer-events: none;
}

.courtyard-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(5, 9, 18, 0.46), transparent 28%),
        linear-gradient(to top, rgba(5, 9, 18, 0.58), transparent 32%);
    pointer-events: none;
}

.courtyard-heading {
    position: absolute;
    top: 5%;
    left: 50%;
    z-index: 4;
    width: min(90%, 720px);
    transform: translateX(-50%);
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--temple-gold);
    font-size: 0.76rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.courtyard-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4.4rem);
    font-weight: 400;
    letter-spacing: 0.06em;
}

.courtyard-keynote {
    margin: 0.6rem 0 0;
    color: var(--temple-muted);
    font-size: clamp(0.8rem, 1.8vw, 1.05rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ----------------------------------------------------------------------
   INTERACTIVE HOTSPOTS
   Positions are percentages so they remain aligned as the image scales.
   ---------------------------------------------------------------------- */

.hotspot {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--temple-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hotspot-art {
    position: absolute;
    width: 72%;
    max-height: 82%;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.88);
    filter: drop-shadow(0 0 18px rgba(255, 230, 171, 0.28));
    transition:
        opacity 500ms ease,
        transform 900ms ease,
        filter 700ms ease;
    pointer-events: none;
}

.hotspot-aura {
    position: absolute;
    width: 72%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 239, 192, 0.18), transparent 67%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 500ms ease, transform 900ms ease;
    pointer-events: none;
}

.hotspot-copy {
    position: absolute;
    left: 50%;
    bottom: 2%;
    width: max-content;
    max-width: 95%;
    transform: translateX(-50%);
    padding: 0.48rem 0.75rem;
    border: 1px solid rgba(231, 201, 138, 0.28);
    border-radius: 999px;
    background: rgba(7, 12, 21, 0.68);
    text-align: center;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
    opacity: 0.78;
    transition: opacity 350ms ease, background 350ms ease;
    pointer-events: none;
}

.hotspot-copy strong,
.hotspot-copy span {
    display: block;
}

.hotspot-copy strong {
    color: var(--temple-gold-bright);
    font-size: clamp(0.74rem, 1.4vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.hotspot-copy span {
    margin-top: 0.15rem;
    color: var(--temple-muted);
    font-size: clamp(0.68rem, 1.2vw, 0.88rem);
    font-style: italic;
}

.hotspot:hover .hotspot-art,
.hotspot:focus-visible .hotspot-art,
.hotspot.is-active .hotspot-art {
    opacity: 0.9;
    transform: scale(1);
    animation: breathe 3200ms ease-in-out infinite;
}

.hotspot:hover .hotspot-aura,
.hotspot:focus-visible .hotspot-aura,
.hotspot.is-active .hotspot-aura {
    opacity: 1;
    transform: scale(1.08);
}

.hotspot:hover .hotspot-copy,
.hotspot:focus-visible .hotspot-copy {
    opacity: 1;
    background: rgba(7, 12, 21, 0.82);
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(0.97);
    }

    50% {
        transform: scale(1.035);
    }
}

.hotspot-lotus {
    left: 2%;
    top: 38%;
    width: 33%;
    height: 39%;
}

.hotspot-mirror {
    right: 2%;
    top: 39%;
    width: 33%;
    height: 38%;
}

.hotspot-sanctuary {
    left: 37.5%;
    top: 8%;
    width: 25%;
    height: 53%;
}

.hotspot-sanctuary .hotspot-art {
    width: 80%;
}

/* Prototype Three: keep the Sanctuary portal visibly present at all times. */
.sanctuary-link {
    text-decoration: none;
}

.hotspot-sanctuary.is-quiet .hotspot-art {
    opacity: 0.48;
    filter: saturate(0.82) brightness(0.92);
    transform: scale(0.98);
}

.hotspot-sanctuary.is-quiet .hotspot-aura {
    opacity: 0.28;
}

.hotspot-sanctuary.is-unlocked .hotspot-art {
    opacity: 0.9;
    filter: saturate(1.08) brightness(1.08);
    animation: sanctuaryPulse 3800ms ease-in-out infinite;
}

.hotspot-sanctuary.is-unlocked .hotspot-aura {
    opacity: 0.82;
}


@keyframes sanctuaryPulse {
    0%,
    100% {
        opacity: 0.42;
        transform: scale(0.97);
    }

    50% {
        opacity: 0.78;
        transform: scale(1.02);
    }
}

.courtyard-instruction {
    position: absolute;
    left: 50%;
    bottom: 3.2%;
    z-index: 7;
    width: min(92%, 620px);
    transform: translateX(-50%);
    padding: 0.7rem 1rem;
    border: 1px solid rgba(231, 201, 138, 0.28);
    border-radius: 14px;
    background: rgba(6, 11, 20, 0.72);
    text-align: center;
    backdrop-filter: blur(6px);
}

.courtyard-instruction p {
    margin: 0;
    color: var(--temple-muted);
    font-size: clamp(0.78rem, 1.6vw, 1rem);
    font-style: italic;
}

.text-button {
    margin-top: 0.35rem;
    border: 0;
    padding: 0.2rem 0.55rem;
    background: transparent;
    color: var(--temple-gold);
    font-size: 0.74rem;
    cursor: pointer;
}

/* ----------------------------------------------------------------------
   EXPERIENCE SCENES
   ---------------------------------------------------------------------- */

.scene-experience {
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: var(--temple-night);
}

.experience-background {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    opacity: 0.32;
    filter: blur(2px) saturate(0.85);
    transform: scale(1.03);
}

.garden-background {
    background-image: linear-gradient(rgba(8, 14, 24, 0.22), rgba(8, 14, 24, 0.68)), url("assets/images/inner-courtyard.png");
}

.reflection-background {
    background-image: linear-gradient(rgba(8, 14, 24, 0.2), rgba(8, 14, 24, 0.72)), url("assets/images/inner-courtyard.png");
    background-position: 76% center;
}

.sanctuary-background {
    background-image: linear-gradient(rgba(8, 14, 24, 0.12), rgba(8, 14, 24, 0.72)), url("assets/images/inner-courtyard.png");
    background-position: center 28%;
}

.experience-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 760px);
    padding: clamp(1.2rem, 4vw, 2.7rem);
    border: 1px solid var(--temple-border);
    border-radius: 22px;
    background: var(--temple-panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    text-align: center;
    backdrop-filter: blur(12px);
}

.return-button {
    display: block;
    margin: 0 0 1.4rem;
    border: 1px solid rgba(231, 201, 138, 0.34);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: transparent;
    color: var(--temple-muted);
    cursor: pointer;
}

.experience-symbol {
    display: block;
    width: clamp(120px, 24vw, 220px);
    height: clamp(120px, 24vw, 220px);
    margin: 0 auto 1.25rem;
    object-fit: contain;
    filter: drop-shadow(0 0 24px rgba(255, 230, 171, 0.22));
}

.experience-lotus {
    animation: breathe 4200ms ease-in-out infinite;
}

.experience-mirror {
    animation: mirrorFloat 4800ms ease-in-out infinite;
}

.experience-portal {
    width: clamp(140px, 28vw, 260px);
    height: clamp(140px, 28vw, 260px);
    animation: sanctuaryPulse 4200ms ease-in-out infinite;
}

@keyframes mirrorFloat {
    0%,
    100% {
        transform: translateY(0) scale(0.98);
        opacity: 0.84;
    }

    50% {
        transform: translateY(-5px) scale(1.015);
        opacity: 1;
    }
}

.experience-panel h2 {
    margin: 0;
    font-size: clamp(1.7rem, 5vw, 3rem);
    font-weight: 400;
}

.seed-thought {
    margin: 1.8rem auto 1.4rem;
    max-width: 620px;
    color: var(--temple-gold-bright);
    font-size: clamp(1.45rem, 4vw, 2.35rem);
    font-style: italic;
    line-height: 1.35;
}

.reflection-word {
    margin: 2rem auto 1rem;
    color: var(--temple-gold-bright);
    font-size: clamp(2rem, 8vw, 5rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    animation: reflectionWord 5200ms ease-in-out infinite;
}

@keyframes reflectionWord {
    0%,
    100% {
        opacity: 0.42;
        transform: scale(0.96);
        letter-spacing: 0.12em;
    }

    50% {
        opacity: 1;
        transform: scale(1.025);
        letter-spacing: 0.2em;
    }
}

.reflection-question,
.sanctuary-statement {
    margin: 1rem auto;
    max-width: 650px;
    color: var(--temple-gold-bright);
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    font-style: italic;
    line-height: 1.5;
}

.experience-guidance {
    margin: 1rem auto 0;
    max-width: 650px;
    color: var(--temple-muted);
    font-size: clamp(0.96rem, 2vw, 1.08rem);
    line-height: 1.75;
}

.experience-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.8rem;
}

.primary-button,
.secondary-button {
    min-height: 44px;
    border-radius: 999px;
    padding: 0.72rem 1.2rem;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--temple-gold);
    background: rgba(231, 201, 138, 0.16);
    color: var(--temple-gold-bright);
}

.secondary-button {
    border: 1px solid rgba(231, 201, 138, 0.28);
    background: transparent;
    color: var(--temple-muted);
}



/* ----------------------------------------------------------------------
   CONTEMPLATIVE SEQUENCE STATES — VERSION TWO
   ---------------------------------------------------------------------- */

.contemplation-status {
    margin: 1.25rem auto 0;
    min-height: 1.5em;
    color: var(--temple-gold);
    font-size: 0.92rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.is-hidden {
    display: none !important;
}

.reflection-word.is-releasing {
    animation: releaseReflection 2800ms ease forwards;
}

@keyframes releaseReflection {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    65% {
        opacity: 0.45;
        transform: scale(1.08);
        filter: blur(1px);
    }

    100% {
        opacity: 0.08;
        transform: scale(1.16);
        filter: blur(4px);
    }
}

.sanctuary-enter-button {
    padding-left: 1.6rem;
    padding-right: 1.6rem;
}

/* ----------------------------------------------------------------------
   RESPONSIVE LAYOUT
   ---------------------------------------------------------------------- */

@media (max-width: 760px) {
    .scene-courtyard {
        min-height: 760px;
    }

    .courtyard-background {
        object-position: center;
    }

    .courtyard-heading {
        top: 3%;
    }

    .hotspot-lotus {
        left: 0;
        top: 43%;
        width: 43%;
        height: 34%;
    }

    .hotspot-mirror {
        right: 0;
        top: 43%;
        width: 43%;
        height: 34%;
    }

    .hotspot-sanctuary {
        left: 34%;
        top: 17%;
        width: 32%;
        height: 40%;
    }

    .hotspot-copy {
        bottom: -2%;
        white-space: normal;
    }

    .hotspot-art {
        width: 82%;
    }

    .courtyard-instruction {
        bottom: 1.5%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}


/* ----------------------------------------------------------------------
   HALL OF RESONANCE — PROTOTYPE FOUR
   ---------------------------------------------------------------------- */

.hotspot-hall {
    left: 40%;
    top: 58%;
    width: 20%;
    height: 23%;
    border-radius: 50%;
}

.resonance-glyph {
    display: grid;
    place-items: center;
    width: clamp(58px, 8vw, 104px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 238, 190, 0.4);
    border-radius: 50%;
    color: var(--temple-gold-bright);
    background: radial-gradient(circle, rgba(255, 239, 192, 0.22), rgba(17, 27, 44, 0.16) 52%, transparent 70%);
    box-shadow: 0 0 24px rgba(255, 230, 171, 0.12);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    transition: opacity 500ms ease, transform 700ms ease, box-shadow 700ms ease;
}

.hotspot-hall.is-locked {
    cursor: default;
    opacity: 0.38;
}

.hotspot-hall.is-unlocked {
    cursor: pointer;
    opacity: 1;
    z-index: 8;
}

.hotspot-hall.is-unlocked .resonance-glyph {
    animation: hallGlyphPulse 3600ms ease-in-out infinite;
    box-shadow: 0 0 34px rgba(255, 230, 171, 0.36);
}

@keyframes hallGlyphPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.72; }
    50% { transform: scale(1.05); opacity: 1; }
}

.scene-resonance {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 16%, rgba(126, 159, 190, 0.14), transparent 25%),
        radial-gradient(circle at 50% 55%, rgba(231, 201, 138, 0.07), transparent 34%),
        linear-gradient(180deg, #080d16 0%, #101a27 56%, #070b11 100%);
}

.resonance-architecture {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.resonance-arch {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(231, 201, 138, 0.11);
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
}

.arch-one {
    top: 4%;
    width: 76%;
    height: 58%;
}

.arch-two {
    top: 11%;
    width: 60%;
    height: 48%;
}

.resonance-floor {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -18%;
    height: 48%;
    border-radius: 50%;
    border: 1px solid rgba(231, 201, 138, 0.12);
    background: radial-gradient(ellipse, rgba(255,255,255,0.04), transparent 66%);
}

.resonance-shell {
    position: relative;
    z-index: 2;
    width: min(1180px, 94%);
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.resonance-return {
    position: relative;
    z-index: 3;
}

.resonance-heading,
.section-heading {
    text-align: center;
}

.resonance-heading {
    max-width: 780px;
    margin: 2.5rem auto 1.6rem;
}

.resonance-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
}

.resonance-heading > p:last-child,
.section-heading > p:last-child {
    color: var(--temple-muted);
    line-height: 1.7;
}

.hall-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.4rem 0 2.4rem;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 44px;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(231, 201, 138, 0.28);
    border-radius: 999px;
    color: var(--temple-muted);
}

.volume-control input {
    width: 130px;
}

.tone-section,
.interval-section {
    margin: 2.4rem auto;
}

.section-heading h3 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.35rem);
    font-weight: 400;
}

.tone-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.7rem;
}

.tone-station {
    min-height: 255px;
    border: 1px solid rgba(231, 201, 138, 0.28);
    border-radius: 22px;
    padding: 1.2rem;
    background: rgba(7, 13, 23, 0.54);
    color: var(--temple-text);
    cursor: pointer;
    transition: border-color 350ms ease, background 350ms ease, transform 350ms ease;
}

.tone-station:hover,
.tone-station:focus-visible,
.interval-card:hover,
.interval-card:focus-visible {
    border-color: rgba(255, 242, 200, 0.72);
    background: rgba(34, 45, 63, 0.66);
}

.tone-station.is-playing {
    border-color: var(--temple-gold-bright);
    background: rgba(55, 56, 52, 0.48);
}

.tone-station strong,
.tone-station > span:last-child {
    display: block;
}

.tone-station strong {
    margin-top: 0.8rem;
    color: var(--temple-gold-bright);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tone-station > span:last-child {
    margin-top: 0.35rem;
    color: var(--temple-muted);
    font-size: 0.9rem;
}

.tone-orb {
    position: relative;
    display: block;
    width: 112px;
    aspect-ratio: 1;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, rgba(255,255,255,0.28), rgba(132, 153, 178, 0.08) 38%, rgba(7, 13, 23, 0.2) 72%);
}

.tone-orb::before,
.tone-orb::after,
.tone-orb span::before {
    content: "";
    position: absolute;
    inset: 50%;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(231, 201, 138, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
}

.tone-station.is-playing .tone-orb::before { animation: resonanceWave 2400ms linear infinite; }
.tone-station.is-playing .tone-orb::after { animation: resonanceWave 2400ms 800ms linear infinite; }
.tone-station.is-playing .tone-orb span::before { animation: resonanceWave 2400ms 1600ms linear infinite; }

@keyframes resonanceWave {
    0% { transform: translate(-50%, -50%) scale(0.55); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}

.orb-low { box-shadow: inset 0 0 30px rgba(113, 137, 168, 0.12); }
.orb-mid { box-shadow: inset 0 0 30px rgba(194, 181, 144, 0.12); }
.orb-high { box-shadow: inset 0 0 30px rgba(221, 203, 151, 0.17); }
.orb-silence { background: radial-gradient(circle, rgba(255,255,255,0.025), rgba(0,0,0,0.06) 70%); }

.interval-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 1.6rem auto 0;
}

.interval-card {
    min-height: 112px;
    border: 1px solid rgba(231, 201, 138, 0.3);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(7, 13, 23, 0.52);
    color: var(--temple-text);
    cursor: pointer;
}

.interval-card.is-playing {
    border-color: var(--temple-gold-bright);
    box-shadow: 0 0 28px rgba(231, 201, 138, 0.12);
}

.interval-card strong,
.interval-card span {
    display: block;
}

.interval-card strong {
    color: var(--temple-gold-bright);
    font-size: 1.1rem;
    font-weight: 400;
}

.interval-card span {
    margin-top: 0.45rem;
    color: var(--temple-muted);
}

.resonance-status-panel {
    max-width: 760px;
    margin: 2.4rem auto 0;
    border-top: 1px solid rgba(231, 201, 138, 0.22);
    border-bottom: 1px solid rgba(231, 201, 138, 0.22);
    padding: 1.4rem 1rem;
    text-align: center;
}

#resonance-status {
    color: var(--temple-gold-bright);
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
}

#resonance-guidance {
    margin: 0.7rem auto 0;
    color: var(--temple-muted);
    line-height: 1.65;
}

@media (max-width: 820px) {
    .hotspot-hall {
        left: 36%;
        top: 60%;
        width: 28%;
        height: 20%;
    }

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

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

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

    .tone-station {
        min-height: 220px;
    }

    .volume-control {
        width: 100%;
        justify-content: center;
    }
}
