/* =========================
   01. TOKENS
   ========================= */

:root {
    --bg: #02050c;
    --bg-soft: rgba(6, 14, 27, 0.82);
    --panel: rgba(8, 20, 38, 0.74);
    --panel-strong: rgba(5, 14, 28, 0.92);
    --line: rgba(0, 215, 227, 0.22);
    --line-strong: rgba(0, 224, 234, 0.48);
    --text: #eafcff;
    --text-soft: rgba(210, 231, 235, 0.78);
    --text-muted: rgba(172, 198, 204, 0.82);
    --accent: #00d7e3;
    --accent-strong: #00e6f1;
    --accent-deep: #086e92;
    --accent-soft: rgba(0, 215, 227, 0.18);
    --accent-glow: rgba(0, 215, 227, 0.28);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
    --sidebar-width: 290px;
    --content-pad: clamp(24px, 4vw, 64px);
    --topbar-height: 72px;
    --topbar-inline-pad: var(--content-pad);
    --floating-entry-gap: 12px;
}

/* =========================
   02. RESET / GLOBAL
   ========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html,
body {
    min-height: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.content-scroll::-webkit-scrollbar {
    display: none;
}

body {
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
            radial-gradient(circle at top right, rgba(0, 215, 227, 0.10), transparent 24%),
            radial-gradient(circle at 18% 12%, rgba(8, 110, 146, 0.16), transparent 28%),
            linear-gradient(180deg, #081425 0%, #050d1a 55%, #02050c 100%);
    color: var(--text);
}

body.menu-open {
    overflow: hidden;
}

button,
a {
    color: inherit;
}

code {
    font-family: Consolas, Monaco, monospace;
    color: #9af4ff;
}

/* =========================
   03. LAYOUT SHELL
   ========================= */

.page-shell {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    margin-left: 0;
}

.content-scroll {
    position: relative;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    transform: none !important;
    transition: none !important;
}

/* =========================
   04. NAVIGATION
   ========================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    align-items: center;
    width: var(--sidebar-width);
    padding: 24px 16px;
    background: transparent;
    border-right: 0;
    box-shadow: none;
}

.sidebar::before,
.sidebar::after,
.site-menu__item--group::before {
    display: none;
    content: none;
}

.sidebar__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4px 8px 4px 2px;
    gap: 8px;
}

.sidebar__mobile-toggle,
.topbar__menu-button {
    display: none;
}

.site-menu {
    margin: auto 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
}

.site-menu__group {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-menu__item,
.site-menu__child-item {
    min-width: 0;
    list-style: none;
}

.site-menu__item--group {
    padding-top: 2px;
}

.site-menu__link,
.site-menu__toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 7px 12px 7px 24px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(220, 236, 240, 0.72);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition:
            color 0.22s ease,
            transform 0.22s ease,
            background 0.22s ease,
            text-shadow 0.22s ease;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.site-menu__link::before,
.site-menu__toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(0, 215, 227, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 215, 227, 0.12);
    transition:
            transform 0.22s ease,
            background 0.22s ease,
            box-shadow 0.22s ease;
}

.site-menu__link:hover,
.site-menu__toggle:hover {
    color: #f4feff;
    transform: translateX(4px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    text-shadow: 0 0 16px rgba(0, 215, 227, 0.14);
}

.site-menu__link:hover::before,
.site-menu__toggle:hover::before {
    background: rgba(0, 215, 227, 0.42);
    box-shadow:
            0 0 0 1px rgba(0, 215, 227, 0.22),
            0 0 10px rgba(0, 215, 227, 0.22);
    transform: translateY(-50%) scale(1.08);
}

.site-menu__link.is-active,
.site-menu__toggle.is-active {
    color: #ffffff;
    transform: translateX(4px);
    background: linear-gradient(90deg, rgba(0, 215, 227, 0.14) 0%, rgba(0, 215, 227, 0.05) 38%, transparent 100%);
    text-shadow: 0 0 18px rgba(0, 215, 227, 0.18);
}

.site-menu__link.is-active::before,
.site-menu__toggle.is-active::before {
    background: var(--accent);
    box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.16),
            0 0 12px rgba(0, 215, 227, 0.28);
    transform: translateY(-50%) scale(1.16);
}

.site-menu__children {
    display: grid;
    gap: 2px;
    margin: 2px 0 0;
    padding: 0 0 0 18px;
    border-left: 0;
}

.site-menu__child-link {
    position: relative;
    display: block;
    width: 100%;
    padding: 5px 10px 5px 16px;
    border-radius: 8px;
    color: rgba(205, 227, 232, 0.60);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    transition:
            color 0.22s ease,
            transform 0.22s ease,
            background 0.22s ease,
            text-shadow 0.22s ease;
}

.site-menu__child-link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(0, 215, 227, 0.16);
    transition:
            background 0.22s ease,
            box-shadow 0.22s ease,
            transform 0.22s ease;
}

.site-menu__child-link:hover {
    color: #f4feff;
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.022);
    text-shadow: 0 0 12px rgba(0, 215, 227, 0.10);
}

.site-menu__child-link:hover::before {
    background: rgba(0, 215, 227, 0.34);
    box-shadow: 0 0 8px rgba(0, 215, 227, 0.18);
    transform: translateY(-50%) scale(1.1);
}

.site-menu__child-link.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(0, 215, 227, 0.10), transparent 75%);
    text-shadow: 0 0 12px rgba(0, 215, 227, 0.12);
}

.site-menu__child-link.is-active::before {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(0, 215, 227, 0.20);
}

.topbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: var(--topbar-height);
    padding: 14px;
    background: linear-gradient(180deg, rgba(4, 10, 19, 0.88), rgba(4, 10, 19, 0));
    pointer-events: none;
}

.topbar > * {
    pointer-events: auto;
}

.topbar__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.topbar__meta strong {
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: right;
}

.floating-entry {
    position: fixed;
    top: calc(var(--topbar-height) + var(--floating-entry-gap));
    right: var(--topbar-inline-pad);
    z-index: 25;
    pointer-events: none;
}

.floating-entry > * {
    pointer-events: auto;
}

.floating-entry__form {
    margin: 0;
}

.floating-entry__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(0, 215, 227, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    color: var(--accent);
    cursor: pointer;
    transition:
            transform 0.18s ease,
            box-shadow 0.18s ease,
            border-color 0.18s ease,
            background 0.18s ease;
}

.floating-entry__button svg {
    display: block;
    width: 22px;
    height: 22px;
}

.floating-entry__button:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 215, 227, 0.45);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.floating-entry__button:focus-visible {
    outline: 2px solid rgba(0, 215, 227, 0.45);
    outline-offset: 3px;
}

/* =========================
   05. SHARED TYPOGRAPHY / UI
   ========================= */

.section-kicker,
.topbar__label {
    display: inline-block;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.section-title {
    margin: 8px 0 0;
    max-width: 10ch;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(40px, 5vw, 82px);
    font-weight: 400;
    line-height: 0.98;
}

.section-text {
    max-width: 58ch;
    margin: 20px 0 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.7;
}

.max-text {
    max-width: 72ch;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 22px;
    border: 1px solid rgba(0, 215, 227, 0.28);
    border-radius: 12px;
    text-decoration: none;
    transition:
            transform 0.25s ease,
            border-color 0.25s ease,
            background 0.25s ease,
            box-shadow 0.25s ease;
}

.button:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 224, 234, 0.48);
}

.button--primary {
    color: #f4feff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 28px rgba(0, 215, 227, 0.18);
}

.button--primary:hover {
    box-shadow: 0 16px 34px rgba(0, 215, 227, 0.28);
}

.button--ghost {
    background: rgba(7, 20, 37, 0.36);
    border-color: rgba(0, 215, 227, 0.24);
    color: var(--text);
}

.button--ghost:hover {
    background: rgba(7, 20, 37, 0.52);
    border-color: rgba(0, 224, 234, 0.42);
}

.ornamental-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(0, 215, 227, 0.14);
    border-radius: 12px;
    background:
            linear-gradient(180deg, rgba(10, 21, 39, 0.86), rgba(6, 13, 25, 0.72)),
            radial-gradient(circle at top left, rgba(0, 215, 227, 0.08), transparent 35%);
    box-shadow: var(--shadow);
}

.ornamental-card::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(
            140deg,
            rgba(0, 224, 234, 0.36),
            rgba(255, 255, 255, 0.04),
            rgba(8, 110, 146, 0.24)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* =========================
   06. SECTION FRAMEWORK
   ========================= */

.page-section {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    margin-left: 0;
    padding-left: 0;
    overflow: clip;
    isolation: isolate;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.page-section::before,
.page-section::after {
    content: "";
    position: absolute;
    inset: 0;
}

.page-section::before {
    z-index: -2;
    background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.42)),
            linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 36%);
}

.page-section::after {
    z-index: -1;
    opacity: 0.18;
    background-image: repeating-linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.02) 0,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 28px
    );
}

.section-video-wrap,
.section-video-overlay {
    position: absolute;
    inset: 0;
}

.section-video-wrap {
    z-index: -3;
    overflow: hidden;
}

.section-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.section-video-overlay {
    z-index: -1;
    pointer-events: none;
    background:
            radial-gradient(circle at 50% 38%, rgba(0, 215, 227, 0.09), transparent 24%),
            radial-gradient(circle at 50% 42%, rgba(4, 12, 24, 0.01) 0%, rgba(4, 12, 24, 0.09) 36%, rgba(2, 6, 12, 0.42) 100%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, transparent 40%),
            linear-gradient(180deg, rgba(1, 4, 9, 0.10) 0%, rgba(1, 4, 9, 0.14) 34%, rgba(1, 4, 9, 0.56) 100%),
            linear-gradient(180deg, rgba(2, 6, 12, 0.04) 0%, rgba(2, 6, 12, 0.07) 40%, rgba(2, 6, 12, 0.48) 100%),
            linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.08) 28%, rgba(0, 0, 0, 0.08) 72%, rgba(0, 0, 0, 0.24) 100%);
}

.section-content {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - (var(--content-pad) * 2)));
    margin: 0 auto;
    padding: 90px var(--content-pad);
}

.section-content--intro {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 24px;
}

.theme-hero {
    background: #050607;
}

.theme-void {
    background: linear-gradient(180deg, #040914, #07111f 60%, #02050c 100%);
}

.theme-silver {
    background: linear-gradient(180deg, #07111c, #0a1623 50%, #050b12 100%);
}

/* =========================
   07. RESPONSIVE <= 900
   ========================= */

@media (max-width: 900px) {
    :root {
        --topbar-height: 84px;
        --topbar-inline-pad: 24px;
        --floating-entry-gap: 10px;
    }

    html,
    body {
        scroll-snap-type: none;
    }

    .sidebar {
        width: min(360px, 90vw);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        background:
                linear-gradient(180deg, rgba(7, 16, 29, 0.96), rgba(4, 10, 19, 0.92)),
                linear-gradient(180deg, rgba(0, 215, 227, 0.05), transparent 36%);
        border-right: 1px solid rgba(0, 215, 227, 0.12);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
    }

    .sidebar__inner {
        padding: 18px 14px 18px 18px;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar__mobile-toggle,
    .topbar__menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(0, 215, 227, 0.24);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        cursor: pointer;
    }

    .sidebar__mobile-toggle {
        width: fit-content;
        padding: 10px 16px;
    }

    .topbar {
        justify-content: space-between;
    }

    .topbar__menu-button {
        width: 46px;
        height: 46px;
        font-size: 19px;
    }

    .page-shell,
    .content {
        min-height: 100vh;
        height: auto;
    }

    .content {
        overflow: visible;
    }

    .content-scroll {
        width: 100%;
        height: auto;
        overflow: visible;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .page-section {
        min-height: 100vh;
        height: auto;
    }

    .section-content {
        width: min(1180px, calc(100% - 48px));
        padding: 84px 24px;
    }

    .page-section--hero .section-content--intro {
        padding-top: calc(var(--topbar-height) + 20px);
    }

    body.menu-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.48);
    }
}

/* =========================
   08. RESPONSIVE <= 640
   ========================= */

@media (max-width: 640px) {
    :root {
        --topbar-height: 76px;
        --topbar-inline-pad: 16px;
        --floating-entry-gap: 8px;
    }

    .topbar__meta strong {
        max-width: 180px;
        font-size: 10px;
        line-height: 1.15;
        letter-spacing: 0.06em;
    }

    .section-title {
        max-width: none;
    }

    .button {
        width: 100%;
        min-width: 0;
    }

    .site-menu__link,
    .site-menu__toggle {
        font-size: 16px;
    }

    .floating-entry__button {
        width: 42px;
        height: 42px;
    }
}

/* =========================
   09. RESPONSIVE >= 901
   ========================= */

@media (min-width: 901px) {
    html,
    body {
        scroll-snap-type: y mandatory;
    }

    body {
        overscroll-behavior-y: none;
    }

    .page-shell,
    .content,
    .content-scroll {
        min-height: 100vh;
        height: auto;
    }

    .content-scroll {
        overflow: visible;
    }

    .page-section {
        height: 100vh;
        min-height: 100vh;
    }
}

/* =========================
   10. ANIMATIONS
   ========================= */

.reveal {
    opacity: 0;
    transform: translateY(65px);
    transition: all 950ms cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.discover-feature,
.stigma-compact__item,
.aetherforge-callout,
.atreia-point,
.ornamental-card,
.atreia-shot,
.stigma-compact__reward,
.aetherforge-banner,
.atreia-banner,
.discover-panel {
    transition-delay: 80ms;
}

.stigma-compact__item:nth-child(2),
.aetherforge-callout:nth-child(2),
.atreia-point:nth-child(2) {
    transition-delay: 180ms;
}

.stigma-compact__item:nth-child(3),
.aetherforge-callout:nth-child(3),
.atreia-point:nth-child(3) {
    transition-delay: 280ms;
}
