:root {
    --bg: #070b16;
    --text: #edf2ff;
    --muted: #c2c9e6;
    --line: rgba(190, 205, 255, 0.18);
    --line-strong: rgba(190, 205, 255, 0.32);
    --accent: #b7c8ff;
    --accent-soft: rgba(183, 200, 255, 0.12);
    --violet-soft: rgba(185, 150, 255, 0.12);
    --glass: rgba(20, 24, 50, 0.42);
    --glass-strong: rgba(22, 28, 56, 0.56);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 16px 38px rgba(0, 0, 0, 0.22);
    --radius: 28px;
    --max-width: 980px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top, #1a2550 0%, #0f1730 38%, #070b16 100%);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.bg-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.62;
}

.bg-orb-1 {
    width: 420px;
    height: 420px;
    background: rgba(121, 102, 255, 0.22);
    top: -120px;
    right: -80px;
}

.bg-orb-2 {
    width: 340px;
    height: 340px;
    background: rgba(88, 142, 255, 0.16);
    bottom: -60px;
    left: -60px;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(circle at center, black 28%, transparent 86%);
}

.bg-stars {
    position: absolute;
    inset: 0;
}

.bg-star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(245, 247, 255, 0.88);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.44);
}

.site-shell {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.site-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1.25rem 0;
}

.container {
    width: min(100% - 2rem, var(--max-width));
    margin: 0 auto;
}

.book-frame {
    position: relative;
    padding: 1.1rem 1.2rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(210, 220, 255, 0.20);
    background:
        linear-gradient(180deg, rgba(25, 33, 68, 0.42), rgba(14, 18, 36, 0.44));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02),
        var(--shadow);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    overflow: hidden;
}

.book-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(180, 190, 255, 0.10), transparent 34%),
        radial-gradient(circle at bottom left, rgba(160, 120, 255, 0.08), transparent 28%);
    pointer-events: none;
}

.book-frame::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.top-controls {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.lang-nav {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.lang-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 38px;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(210, 220, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    letter-spacing: 0.03em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.lang-nav a:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.06);
}

.lang-nav a[aria-current="page"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.page-header {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
    margin: 0 auto 1.2rem;
}

.hero-figure-wrap {
    position: relative;
    width: 150px;
    margin: 0 auto 0.9rem;
}

.hero-figure-glow {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 115px;
    height: 115px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(183, 200, 255, 0.18) 0%, rgba(183, 200, 255, 0.06) 45%, transparent 75%);
    filter: blur(14px);
    pointer-events: none;
}

.hero-figure {
    position: relative;
    z-index: 1;
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.32));
    opacity: 0.96;
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: #d4dcff;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-title {
    margin: 0;
    font-size: clamp(1.95rem, 2.7vw, 3.1rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    font-weight: 500;
    background: linear-gradient(
        180deg,
        #f4f6ff 0%,
        #dbe3ff 28%,
        #b8c8f2 62%,
        #8fa4d8 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow:
        0 0 18px rgba(190, 205, 255, 0.08),
        0 0 2px rgba(255, 255, 255, 0.18);
}

.site-subtitle {
    margin: 0.7rem auto 0;
    max-width: 42rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.page-divider {
    width: min(100%, 720px);
    height: 1px;
    margin: 0 auto 1.2rem;
    background:
        linear-gradient(90deg, transparent 0%, rgba(220, 225, 255, 0.32) 50%, transparent 100%);
    position: relative;
    z-index: 1;
}

.page-content {
    position: relative;
    z-index: 1;
    max-width: 740px;
    margin: 0 auto;
}

.flow-section + .flow-section {
    margin-top: 1.2rem;
}

.ornament-line {
    width: 100px;
    height: 1px;
    background:
        linear-gradient(90deg, transparent 0%, rgba(220, 225, 255, 0.42) 50%, transparent 100%);
    margin: 0 auto 0.9rem;
}

.lead-text,
.text-section p,
.soft-note {
    color: var(--muted);
    line-height: 1.72;
    font-size: 1.04rem;
}

.intro-section,
.text-section,
.portal-section,
.projects-section,
.socials-section {
    position: relative;
}

.text-section {
    padding: 0.15rem 0;
}

.section-spacing {
    margin-top: 0.65rem !important;
}

.floating-tag-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0 0 1rem;
}

.floating-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(210, 220, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #dce4ff;
    font-size: 0.9rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.12);
}

.hint-star-button {
    position: absolute;
    top: -0.15rem;
    right: -0.1rem;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(202, 180, 255, 0.22);
    background: rgba(202, 180, 255, 0.08);
    color: #e7ddff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(172, 139, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hint-star-button:hover {
    transform: scale(1.08);
    background: rgba(202, 180, 255, 0.14);
    border-color: rgba(220, 198, 255, 0.34);
}

.portal-section {
    padding: 0.9rem 1rem;
    border-left: 2px solid rgba(185, 150, 255, 0.26);
    background: linear-gradient(90deg, rgba(185, 150, 255, 0.06), transparent 70%);
    border-radius: 0 14px 14px 0;
}

.inline-actions {
    margin-top: 0.8rem;
}

.glass-project-list {
    display: grid;
    gap: 0.9rem;
}

.glass-project-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(210, 220, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 28px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.glass-project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(210, 220, 255, 0.24);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 34px rgba(0, 0, 0, 0.18);
}

.glass-project-copy h3 {
    margin: 0 0 0.25rem;
    font-size: 1.08rem;
    font-weight: 500;
}

.glass-project-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
    font-size: 0.97rem;
}

.glass-project-action {
    display: flex;
    align-items: center;
}

.social-links-inline {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.15rem;
}

.social-links-inline a {
    color: #dfe6ff;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    opacity: 0.88;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.social-links-inline a:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.text-button,
.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(210, 220, 255, 0.16);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.12);
    transition: all 0.18s ease;
    cursor: pointer;
    font-size: 0.92rem;
}

.text-button:hover,
.button-primary:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.portal-card,
.realm-card,
.hint-modal-card {
    background:
        linear-gradient(180deg, rgba(26, 34, 64, 0.62), rgba(16, 21, 40, 0.58));
    border: 1px solid rgba(210, 220, 255, 0.16);
    border-radius: 22px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        var(--shadow-soft);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.portal-card,
.realm-card {
    padding: 1.5rem;
}

.portal-form {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.portal-input {
    flex: 1 1 280px;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(210, 220, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 0 1rem;
    font-size: 1rem;
    outline: none;
}

.portal-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(183, 200, 255, 0.10);
}

.alert-box {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 180, 180, 0.24);
    background: rgba(255, 180, 180, 0.08);
    color: var(--text);
}

.realm-intro {
    font-weight: 700;
    color: var(--text) !important;
    margin-bottom: 0.9rem !important;
}

.realm-secret-box {
    margin-top: 1.1rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(175, 230, 211, 0.16);
    background: rgba(175, 230, 211, 0.10);
}

.realm-secret-box h3 {
    margin: 0 0 0.6rem;
}

.realm-secret-box p {
    margin: 0;
}

.button-row {
    margin-top: 1.3rem;
    display: flex;
    justify-content: center;
}

.button-row-left {
    justify-content: flex-start;
}

.hint-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 18, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 20;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hint-modal.hidden {
    display: none;
}

.hint-modal-card {
    width: min(100%, 460px);
    padding: 1.35rem;
}

.hint-modal-card h3 {
    margin: 0 0 0.7rem;
    font-size: 1.28rem;
    font-weight: 500;
}

.hint-modal-card p {
    margin: 0;
    line-height: 1.74;
    color: var(--muted);
}

.hint-modal-card .button-primary {
    margin-top: 1rem;
}

.page-footer {
    position: relative;
    z-index: 1;
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    text-align: center;
    border-top: 1px solid rgba(220, 225, 255, 0.14);
}

.page-footer p {
    margin: 0;
    color: rgba(220, 225, 255, 0.72);
    font-size: 0.92rem;
}

@media (max-width: 920px) {
    .site-main {
        min-height: auto;
        display: block;
        padding: 1rem 0;
    }

    .book-frame {
        padding: 1.1rem 1rem 1.4rem;
    }

    .top-controls {
        margin-bottom: 1rem;
    }

    .hero-figure-wrap {
        width: 128px;
        margin-bottom: 0.75rem;
    }

    .hero-figure {
        width: 105px;
    }

    .site-title {
        font-size: clamp(1.9rem, 7vw, 2.6rem);
    }

    .site-subtitle,
    .lead-text,
    .text-section p,
    .soft-note {
        font-size: 1rem;
        line-height: 1.8;
    }

    .glass-project-card {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hint-star-button {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 0.85rem;
    }

    .portal-form {
        flex-direction: column;
    }
}

@media (max-height: 820px) and (min-width: 921px) {
    .site-main {
        align-items: flex-start;
        padding: 0.85rem 0;
    }

    .book-frame {
        padding: 1rem 1.1rem 1.1rem;
    }

    .top-controls {
        margin-bottom: 0.8rem;
    }

    .hero-figure-wrap {
        width: 132px;
        margin-bottom: 0.6rem;
    }

    .hero-figure {
        width: 104px;
    }

    .page-header {
        margin-bottom: 0.9rem;
    }

    .site-title {
        font-size: clamp(1.85rem, 2.35vw, 2.7rem);
    }

    .page-divider {
        margin-bottom: 0.9rem;
    }

    .flow-section + .flow-section {
        margin-top: 0.95rem;
    }

    .lead-text,
    .text-section p,
    .soft-note {
        font-size: 0.98rem;
        line-height: 1.62;
    }

    .floating-tag-row {
        margin-bottom: 0.8rem;
    }

    .glass-project-list {
        gap: 0.7rem;
    }

    .glass-project-card {
        padding: 0.8rem 0.9rem;
    }

    .page-footer {
        margin-top: 1rem;
        padding-top: 0.8rem;
    }
}