:root {

    --gold: #d4af37;
    --gold-soft: #f2d57a;

    --black: #060606;
    --panel: #111111;
    --text: #f5f5f5;

}

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

body {
    background: #000;
    color: var(--text);

    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;

    font-family: "Segoe UI", sans-serif;

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

    position: relative;
}
.portal-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.portal-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.theta-portal {
    position: relative;
    z-index: 5;

    width: min(1000px, 92vw);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3rem;
}

.portal-ring {
    width: 340px;
    aspect-ratio: 1;
    border-radius: 50%;
}

.portal-message {
    max-width: 800px;
    text-align: center;
}

.portal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
/* ==========================================================
   PORTAL APPEARANCE
========================================================== */

.portal-atmosphere {
    background:
        radial-gradient(
            circle at center,
            rgba(212, 175, 55, 0.08),
            transparent 34%
        ),
        radial-gradient(
            circle at 50% 115%,
            rgba(212, 175, 55, 0.07),
            transparent 42%
        );
}

.portal-ring {
    position: relative;

    border: 1px solid rgba(242, 213, 122, 0.75);

    background:
        radial-gradient(
            circle at center,
            rgba(212, 175, 55, 0.16) 0%,
            rgba(212, 175, 55, 0.06) 28%,
            rgba(0, 0, 0, 0.92) 68%
        );

    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.24),
        0 0 90px rgba(212, 175, 55, 0.12),
        inset 0 0 40px rgba(212, 175, 55, 0.16);
}

.portal-ring::before,
.portal-ring::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.portal-ring::before {
    inset: 18px;
    border: 1px solid rgba(242, 213, 122, 0.42);    
}

.portal-ring::after {
    inset: 46px;
    border: 1px solid rgba(212, 175, 55, 0.2);

    background: radial-gradient(
        circle,
        rgba(242, 213, 122, 0.12),
        transparent 64%
    );
}
/* ==========================================================
   PORTAL MESSAGE
========================================================== */

.portal-kicker{
    margin-bottom:1rem;

    color:rgba(242,213,122,.75);

    font-size:.75rem;
    font-weight:700;
    letter-spacing:.45em;
    text-transform:uppercase;
}

.portal-message h1{

    margin:0 0 1rem;

    color:var(--gold-soft);

    font-family:Georgia,"Times New Roman",serif;

    font-size:clamp(2.8rem,6vw,5rem);

    font-weight:400;

    line-height:1.08;

    text-shadow:
        0 0 18px rgba(242,213,122,.25);
}

.portal-introduction{

    width:min(700px,90%);

    margin:auto;

    color:rgba(255,255,255,.78);

    font-size:1.15rem;

    line-height:1.8;
}
/* ==========================================================
   PORTAL BUTTON
========================================================== */

.portal-enter-button{

    padding:1rem 3rem;

    border:1px solid rgba(212,175,55,.45);

    border-radius:999px;

    background:
        linear-gradient(
            180deg,
            rgba(242,213,122,.14),
            rgba(212,175,55,.05)
        );

    color:var(--gold-soft);

    font-size:1rem;

    font-weight:700;

    letter-spacing:.18em;

    text-transform:uppercase;

    cursor:pointer;

    transition:
        transform .35s,
        box-shadow .35s,
        border-color .35s,
        background .35s;

    box-shadow:
        0 0 25px rgba(212,175,55,.12);
}

.portal-enter-button:hover{

    transform:translateY(-4px);

    border-color:rgba(242,213,122,.8);

    box-shadow:
        0 0 45px rgba(242,213,122,.35);

    background:
        linear-gradient(
            180deg,
            rgba(242,213,122,.25),
            rgba(212,175,55,.10)
        );
}
/* ==========================================================
   PORTAL MOTION
========================================================== */

.portal-ring {
    animation: portal-breathe 5s ease-in-out infinite;
}

.portal-orbit--outer {
    animation: orbit-clockwise 18s linear infinite;
}

.portal-orbit--inner {
    animation: orbit-counterclockwise 12s linear infinite;
}

.portal-symbol {
    animation: symbol-pulse 4s ease-in-out infinite;
}

@keyframes portal-breathe {
    0%,
    100% {
        transform: scale(1);
        filter: brightness(0.92);
    }

    50% {
        transform: scale(1.035);
        filter: brightness(1.18);
    }
}

@keyframes orbit-clockwise {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes orbit-counterclockwise {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes symbol-pulse {
    0%,
    100% {
        opacity: 0.82;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}
@media (prefers-reduced-motion: reduce) {
    .portal-ring,
    .portal-orbit--outer,
    .portal-orbit--inner,
    .portal-symbol {
        animation: none;
    }
}
/* ==========================================================
   THETA TELEPORTATION
========================================================== */

.theta-portal,
.portal-message,
.portal-actions,
.portal-ring {
    transition:
        opacity 0.8s ease,
        transform 1.9s cubic-bezier(0.2, 0.75, 0.15, 1),
        filter 1.9s ease;
}

/* Full-screen flash */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;

    pointer-events: none;

    background:
        radial-gradient(
            circle at center,
            #fffef2 0%,
            #f7df85 18%,
            #d4af37 38%,
            transparent 72%
        );

    opacity: 0;
    transform: scale(0.2);

    transition:
        opacity 0.7s ease,
        transform 1.5s cubic-bezier(0.2, 0.75, 0.15, 1);
}

/* Hide the words and button */
body.is-teleporting .portal-message,
body.is-teleporting .portal-actions {
    opacity: 0;
    transform: translateY(40px) scale(0.94);
    pointer-events: none;
}

/* Move the orb into the center and enlarge it */
body.is-teleporting .portal-ring {
    animation: none;

    z-index: 100;

    transform: scale(5.8);
    filter:
        brightness(3.2)
        saturate(1.45);

    box-shadow:
        0 0 90px rgba(242, 213, 122, 0.9),
        0 0 220px rgba(212, 175, 55, 0.72),
        0 0 420px rgba(212, 175, 55, 0.42),
        inset 0 0 100px rgba(255, 248, 205, 0.9);
}

/* Brighten the energy inside the orb */
body.is-teleporting .portal-ring::after {
    background:
        radial-gradient(
            circle,
            rgba(255, 255, 245, 1) 0%,
            rgba(255, 238, 161, 0.98) 22%,
            rgba(242, 213, 122, 0.82) 42%,
            rgba(212, 175, 55, 0.44) 62%,
            transparent 78%
        );

    box-shadow:
        0 0 80px rgba(255, 248, 205, 1),
        0 0 180px rgba(242, 213, 122, 0.88),
        inset 0 0 80px rgba(255, 255, 245, 1);
}

/* Final flash before transport */
body.is-flashing::after {
    opacity: 1;
    transform: scale(4);
}

body.is-teleporting .portal-symbol,
body.is-teleporting .portal-core-label {
    opacity: 0;
    transition: opacity 0.65s ease;
}

@media (prefers-reduced-motion: reduce) {
    body::after,
    .theta-portal,
    .portal-message,
    .portal-actions,
    .portal-ring {
        transition-duration: 0.01ms !important;
    }
}