:root {
    --bg: #060a11;
    --bg-deep: #04070d;
    --panel: rgba(7, 15, 28, 0.84);
    --panel-strong: rgba(9, 18, 33, 0.92);
    --line: rgba(126, 165, 208, 0.28);
    --line-strong: rgba(156, 196, 237, 0.46);
    --text: #ebf3ff;
    --muted: rgba(216, 228, 244, 0.74);
    --muted-strong: rgba(216, 228, 244, 0.88);
    --accent: #8dc6ff;
    --accent-strong: #d7ecff;
    --blood: #8e2e45;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(73, 127, 184, 0.18), transparent 28%),
        radial-gradient(circle at 20% 80%, rgba(142, 46, 69, 0.14), transparent 26%),
        linear-gradient(180deg, #08101b 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

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

body.page-ready .hero-copy > *,
body.page-ready .hero-panel,
body.page-ready .brand,
body.page-ready .topbar-panel,
body.page-ready .nav,
body.page-ready .topbar-actions {
    opacity: 1;
    transform: translateY(0);
}

.page-shell {
    position: relative;
    overflow: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(180px, auto) 1fr;
    align-items: center;
    gap: 28px;
    padding: 18px 32px;
    backdrop-filter: blur(18px);
    background:
        linear-gradient(180deg, rgba(14, 24, 38, 0.88), rgba(6, 12, 21, 0.72)),
        rgba(4, 10, 18, 0.72);
    border-bottom: 1px solid rgba(126, 165, 208, 0.18);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.brand img {
    display: block;
    width: min(240px, 34vw);
    min-width: 150px;
}

.brand,
.topbar-panel,
.nav,
.topbar-actions,
.hero-copy > *,
.hero-panel {
    opacity: 0;
    transform: translateY(18px);
}

.brand {
    justify-self: start;
    transition: opacity 480ms ease, transform 480ms ease;
}

.topbar-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 28px;
    min-width: 0;
    transition: opacity 520ms ease 120ms, transform 520ms ease 120ms;
}

.topbar-menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(126, 165, 208, 0.24);
    border-radius: 14px;
    background: rgba(8, 16, 29, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.topbar-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-strong);
    transition: transform 180ms ease, opacity 180ms ease;
}

.topbar.menu-open .topbar-menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.topbar.menu-open .topbar-menu-button span:nth-child(2) {
    opacity: 0;
}

.topbar.menu-open .topbar-menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav {
    display: flex;
    justify-content: center;
    justify-self: center;
    gap: 22px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 12px;
    transition: opacity 520ms ease 120ms, transform 520ms ease 120ms;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    flex-wrap: wrap;
    gap: 14px;
    transition: opacity 520ms ease 180ms, transform 520ms ease 180ms;
}

.store-button-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border-radius: 999px;
    border: 1px solid rgba(126, 165, 208, 0.2);
    background: rgba(8, 16, 29, 0.72);
}

.language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: background 160ms ease, color 160ms ease;
}

.language-switcher a.active {
    background: linear-gradient(180deg, rgba(123, 182, 236, 0.32), rgba(44, 84, 125, 0.24));
    color: var(--accent-strong);
}

.nav a:hover,
.footer-link:hover {
    color: var(--accent-strong);
}

.store-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(152, 188, 229, 0.34);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, rgba(22, 34, 52, 0.94), rgba(8, 14, 24, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 12px 28px rgba(0, 0, 0, 0.22);
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.store-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(234, 244, 255, 0.18), transparent);
    transform: translateX(-135%);
    transition: transform 420ms ease;
}

.store-button:hover {
    transform: translateY(-2px);
    border-color: rgba(210, 230, 248, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 16px 32px rgba(0, 0, 0, 0.32),
        0 0 22px rgba(131, 181, 232, 0.1);
}

.store-button:hover::after {
    transform: translateX(135%);
}

.store-button.steam {
    border-color: rgba(110, 168, 228, 0.42);
}

.store-button.playstation {
    border-color: rgba(198, 214, 236, 0.34);
}

.nav-cta,
.primary-button,
.download-button,
.secondary-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0 28px;
    border: 1px solid rgba(168, 208, 246, 0.56);
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
    background:
        linear-gradient(180deg, rgba(223, 244, 255, 0.24), rgba(223, 244, 255, 0) 24%),
        linear-gradient(180deg, rgba(106, 168, 226, 0.36), rgba(36, 72, 112, 0.24) 42%, rgba(10, 21, 37, 0.92) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.48),
        0 16px 34px rgba(0, 0, 0, 0.34);
    color: var(--accent-strong);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 12px;
    overflow: hidden;
    isolation: isolate;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.nav-cta::before,
.primary-button::before,
.download-button::before,
.secondary-button::before {
    content: "";
    position: absolute;
    inset: 1px;
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0 50%);
    background:
        linear-gradient(180deg, rgba(163, 207, 255, 0.28), rgba(163, 207, 255, 0) 36%),
        linear-gradient(180deg, rgba(18, 37, 64, 0.92), rgba(6, 13, 24, 0.94));
    z-index: -2;
}

.nav-cta::after,
.primary-button::after,
.download-button::after,
.secondary-button::after {
    content: "";
    position: absolute;
    top: -22%;
    left: -30%;
    width: 34%;
    height: 150%;
    background: linear-gradient(90deg, transparent, rgba(238, 249, 255, 0.42), transparent);
    transform: skewX(-24deg) translateX(-240%);
    transition: transform 520ms ease;
    z-index: -1;
}

.nav-cta:hover,
.primary-button:hover,
.download-button:hover,
.secondary-button:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(215, 236, 255, 0.84);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -1px 0 rgba(0, 0, 0, 0.54),
        0 18px 42px rgba(0, 0, 0, 0.44),
        0 0 24px rgba(126, 189, 255, 0.16);
    filter: brightness(1.06);
}

.nav-cta:hover::after,
.primary-button:hover::after,
.download-button:hover::after,
.secondary-button:hover::after {
    transform: skewX(-24deg) translateX(420%);
}

.nav-cta:active,
.primary-button:active,
.download-button:active,
.secondary-button:active {
    transform: translateY(0);
}

.secondary-button {
    border: 1px solid rgba(126, 165, 208, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 22%),
        linear-gradient(180deg, rgba(28, 39, 56, 0.9), rgba(7, 13, 23, 0.96));
    color: var(--muted-strong);
    font-weight: 700;
}

.primary-button {
    animation: buttonPulse 4.2s ease-in-out infinite 1s;
}

.hero {
    position: relative;
    min-height: calc(100vh - 84px);
    padding: 84px 32px 64px;
}

.hero-backdrop,
.hero-fog {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-backdrop {
    background:
        linear-gradient(90deg, rgba(5, 9, 15, 0.92) 0%, rgba(5, 9, 15, 0.72) 38%, rgba(5, 9, 15, 0.2) 72%, rgba(5, 9, 15, 0.78) 100%),
        url("hero-background.jpg") center/cover no-repeat;
    filter: saturate(0.86);
}

.hero-fog {
    background:
        radial-gradient(circle at 72% 30%, rgba(180, 222, 255, 0.2), transparent 20%),
        radial-gradient(circle at 58% 46%, rgba(82, 125, 173, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(7, 10, 16, 0.1), rgba(4, 7, 13, 0.48));
    animation: fogDrift 14s ease-in-out infinite alternate;
}

.hero-inner,
.feature-section,
.cinematic-break,
.flow-section,
.footer {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    margin: 0 auto;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
    gap: 32px;
    align-items: end;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent-strong);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
}

.hero h1,
.section-heading h2,
.cinematic-panel h2 {
    margin: 0;
    font-family: "Cinzel", "Times New Roman", serif;
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: 0.02em;
}

.hero h1 {
    max-width: 9ch;
    font-size: clamp(50px, 7vw, 92px);
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.54);
}

.hero-copy > * {
    transition: opacity 620ms ease, transform 620ms ease;
}

.hero-copy > *:nth-child(1) { transition-delay: 120ms; }
.hero-copy > *:nth-child(2) { transition-delay: 220ms; }
.hero-copy > *:nth-child(3) { transition-delay: 320ms; }
.hero-copy > *:nth-child(4) { transition-delay: 420ms; }
.hero-copy > *:nth-child(5) { transition-delay: 520ms; }
.hero-copy > *:nth-child(6) { transition-delay: 620ms; }

.lede {
    max-width: 650px;
    margin: 24px 0 0;
    color: var(--muted-strong);
    font-size: 18px;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.official-store-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 28px;
    color: rgba(223, 233, 246, 0.72);
    font-size: 13px;
}

.hero-panel,
.feature-card,
.cinematic-panel,
.flow-step {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
        var(--panel);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 28px;
    border-radius: 26px;
    backdrop-filter: blur(12px);
    transition: opacity 720ms ease 300ms, transform 720ms ease 300ms;
}

.panel-sigil {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(13, 34, 61, 0.82);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.hero-panel h2 {
    margin: 20px 0 14px;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 32px;
    line-height: 1.15;
}

.panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted-strong);
}

.panel-list li {
    padding: 13px 0;
    border-top: 1px solid rgba(126, 165, 208, 0.16);
}

.download-card {
    margin-top: 26px;
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(168, 208, 246, 0.22);
}

.download-card > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--muted);
}

.download-button {
    width: 100%;
    padding-inline: 18px;
}

.download-button.disabled {
    opacity: 0.54;
    pointer-events: none;
}

.feature-section,
.flow-section {
    padding: 92px 32px 0;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading h2 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.06;
}

.feature-grid,
.flow-grid {
    display: grid;
    gap: 18px;
}

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

.feature-card,
.flow-step {
    border-radius: 22px;
    padding: 28px 24px;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.feature-card:hover,
.flow-step:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.feature-index {
    display: inline-block;
    margin-bottom: 18px;
    color: rgba(215, 236, 255, 0.62);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.feature-card h3,
.flow-step h3 {
    margin: 0 0 12px;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 24px;
}

.feature-card p,
.flow-step p,
.cinematic-panel p,
.footer-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.78;
}

.footer-legal {
    display: block;
    margin-top: 10px;
    color: rgba(216, 228, 244, 0.52);
    font-size: 12px;
    line-height: 1.7;
}

.hero-inner-portal {
    align-items: stretch;
}

.auth-panel {
    display: grid;
    gap: 18px;
    align-self: stretch;
}

.portal-welcome h2,
.portal-card h3 {
    margin: 14px 0 10px;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.12;
}

.portal-welcome p,
.portal-section-copy,
.card-copy,
.helper-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
}

.portal-account-mini,
.account-meta,
.manifest-summary,
.realm-meta {
    display: grid;
    gap: 12px;
}

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

.portal-account-mini div,
.account-meta div,
.manifest-summary div {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(126, 165, 208, 0.16);
    border-radius: 16px;
    background: rgba(7, 14, 24, 0.55);
}

.portal-account-mini strong,
.account-meta strong,
.manifest-summary strong,
.realm-meta strong {
    color: rgba(216, 228, 244, 0.62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-account-mini span,
.account-meta span,
.manifest-summary span,
.realm-meta span {
    color: var(--text);
    font-size: 14px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-tab {
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(126, 165, 208, 0.2);
    border-radius: 16px;
    background: rgba(7, 14, 24, 0.64);
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, color 180ms ease, background 180ms ease;
}

.auth-tab.active {
    border-color: rgba(168, 208, 246, 0.38);
    color: var(--accent-strong);
    background: linear-gradient(180deg, rgba(88, 142, 196, 0.24), rgba(12, 22, 36, 0.84));
}

.auth-form,
.realm-form {
    display: grid;
    gap: 14px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: grid;
}

.auth-form label,
.realm-form label {
    display: grid;
    gap: 8px;
}

.auth-form span,
.realm-form span,
.credential-block > span {
    color: rgba(216, 228, 244, 0.72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-form input,
.realm-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(126, 165, 208, 0.18);
    border-radius: 16px;
    background: rgba(6, 12, 21, 0.84);
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-form input:focus,
.realm-form input:focus {
    border-color: rgba(168, 208, 246, 0.44);
    box-shadow: 0 0 0 3px rgba(118, 171, 227, 0.14);
    background: rgba(7, 14, 24, 0.94);
}

.portal-section {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 92px 32px 0;
    position: relative;
    z-index: 1;
}

.portal-grid,
.realm-list {
    display: grid;
    gap: 18px;
}

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

.realm-list {
    margin-top: 22px;
}

.portal-card,
.realm-card {
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.realm-card-empty {
    text-align: center;
    color: var(--muted);
}

.portal-card-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.credentials-card,
.portal-card {
    min-height: 100%;
}

.credential-block {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.secret-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(126, 165, 208, 0.16);
    background: rgba(6, 12, 21, 0.68);
}

.secret-row code,
.backup-table code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Cascadia Mono", "Consolas", monospace;
    color: var(--accent-strong);
    font-size: 13px;
}

.copy-button,
.table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(126, 165, 208, 0.22);
    border-radius: 14px;
    background: rgba(11, 21, 36, 0.84);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.copy-button:hover,
.table-link:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 208, 246, 0.42);
    background: rgba(16, 28, 46, 0.94);
}

.compact-button {
    min-height: 46px;
    padding-inline: 18px;
}

.inline-form {
    margin: 0;
}

.nav-cta-secondary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 22%),
        linear-gradient(180deg, rgba(28, 39, 56, 0.9), rgba(7, 13, 23, 0.96));
    color: var(--muted-strong);
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(126, 165, 208, 0.22);
    font-weight: 700;
}

.flash-success {
    background: rgba(22, 74, 52, 0.34);
    border-color: rgba(86, 198, 146, 0.32);
    color: #d6ffeb;
}

.flash-error {
    background: rgba(92, 28, 38, 0.34);
    border-color: rgba(191, 86, 104, 0.34);
    color: #ffe2e8;
}

.realm-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.backup-table-wrap {
    margin-top: 22px;
    overflow-x: auto;
}

.backup-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.backup-table th,
.backup-table td {
    padding: 14px 12px;
    border-top: 1px solid rgba(126, 165, 208, 0.16);
    text-align: left;
    vertical-align: middle;
}

.backup-table thead th {
    color: rgba(216, 228, 244, 0.64);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.backup-actions-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cinematic-break {
    padding: 92px 32px 0;
}

.cinematic-panel {
    min-height: 420px;
    padding: 56px;
    border-radius: 28px;
    background:
        linear-gradient(90deg, rgba(4, 10, 19, 0.88) 0%, rgba(4, 10, 19, 0.76) 38%, rgba(4, 10, 19, 0.2) 72%, rgba(4, 10, 19, 0.8) 100%),
        url("castle-background.png") center/cover no-repeat;
}

.cinematic-panel h2 {
    max-width: 10ch;
    margin: 8px 0 16px;
    font-size: clamp(30px, 5vw, 56px);
}

.cinematic-panel p {
    max-width: 580px;
    color: rgba(234, 241, 252, 0.82);
}

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

.flow-step strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 999px;
    border: 1px solid rgba(168, 208, 246, 0.34);
    color: var(--accent-strong);
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 88px 32px 34px;
}

.footer-title {
    display: block;
    margin-bottom: 8px;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 24px;
}

.footer-link {
    color: var(--accent-strong);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 12px;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 420ms ease, transform 420ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fogDrift {
    from {
        transform: translate3d(-1.5%, 0, 0) scale(1.02);
        opacity: 0.86;
    }
    to {
        transform: translate3d(1.5%, -1.5%, 0) scale(1.08);
        opacity: 1;
    }
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.28),
            inset 0 -1px 0 rgba(0, 0, 0, 0.48),
            0 16px 34px rgba(0, 0, 0, 0.34);
    }
    50% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.36),
            inset 0 -1px 0 rgba(0, 0, 0, 0.48),
            0 18px 42px rgba(0, 0, 0, 0.42),
            0 0 24px rgba(126, 189, 255, 0.18);
    }
}

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

    .brand,
    .topbar-panel,
    .nav,
    .topbar-actions,
    .hero-copy > *,
    .hero-panel,
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (max-width: 1080px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 18px;
        align-items: center;
    }

    .topbar-menu-button {
        display: inline-flex;
        flex-direction: column;
        justify-self: end;
    }

    .topbar-panel {
        display: none;
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        justify-items: stretch;
        gap: 18px;
        width: 100%;
        padding: 18px;
        border: 1px solid rgba(126, 165, 208, 0.16);
        border-radius: 24px;
        background:
            linear-gradient(180deg, rgba(18, 29, 44, 0.92), rgba(7, 12, 21, 0.94)),
            rgba(5, 9, 15, 0.92);
        box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
    }

    .topbar.menu-open .topbar-panel {
        display: grid;
    }

    .nav,
    .topbar-actions {
        width: 100%;
        justify-content: center;
    }

    .nav {
        order: 1;
        flex-wrap: wrap;
        gap: 14px;
    }

    .topbar-actions {
        order: 2;
        justify-self: stretch;
        gap: 12px;
    }

    .hero-inner,
    .flow-grid,
    .footer {
        grid-template-columns: 1fr;
    }

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

    .portal-grid,
    .realm-meta,
    .portal-account-mini {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 720px) {
    .topbar,
    .hero,
    .feature-section,
    .cinematic-break,
    .flow-section,
    .footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .brand img {
        width: 176px;
        min-width: 0;
    }

    .topbar {
        gap: 14px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .topbar-panel {
        padding: 16px;
        gap: 14px;
        border-radius: 20px;
    }

    .hero-panel,
    .cinematic-panel,
    .feature-card,
    .flow-step {
        padding: 22px 18px;
    }

    .hero {
        min-height: auto;
        padding-top: 44px;
        padding-bottom: 40px;
    }

    .hero h1 {
        max-width: none;
        font-size: clamp(38px, 12vw, 52px);
        line-height: 1.02;
    }

    .lede {
        margin-top: 18px;
        font-size: 16px;
        line-height: 1.65;
    }

    .hero-actions,
    .official-store-row {
        gap: 12px;
    }

    .hero-actions > *,
    .official-store-row > *,
    .hero-meta > * {
        width: 100%;
    }

    .hero-meta {
        gap: 10px;
        margin-top: 22px;
    }

    .hero-meta span {
        display: block;
        padding: 10px 12px;
        border: 1px solid rgba(126, 165, 208, 0.12);
        border-radius: 14px;
        background: rgba(8, 14, 24, 0.44);
    }

    .nav {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nav a {
        display: flex;
        justify-content: center;
        min-height: 44px;
        align-items: center;
        padding: 0 14px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.03);
    }

    .store-button-group {
        width: 100%;
        justify-content: center;
        flex-direction: column;
    }

    .store-button {
        width: 100%;
    }

    .nav-cta {
        width: 100%;
    }

    .language-switcher {
        width: 100%;
        justify-content: center;
    }

    .official-store-row {
        flex-direction: column;
    }

    .download-card > div,
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .portal-card,
    .realm-card {
        padding: 22px 18px;
    }

    .secret-row {
        grid-template-columns: 1fr;
    }

    .copy-button,
    .table-link,
    .compact-button {
        width: 100%;
    }

    .backup-table {
        min-width: 640px;
    }

    .section-heading,
    .cinematic-panel p {
        max-width: none;
    }

    .section-heading h2,
    .cinematic-panel h2 {
        font-size: clamp(28px, 9vw, 42px);
    }

    .cinematic-panel {
        min-height: 320px;
        padding-top: 34px;
        padding-bottom: 34px;
    }

    .footer-link {
        width: 100%;
        text-align: center;
    }
}
