:root {
    --bg: #09111d;
    --panel: rgba(14, 24, 39, 0.82);
    --panel-2: rgba(18, 31, 49, 0.92);
    --line: rgba(149, 176, 221, 0.16);
    --line-strong: rgba(149, 176, 221, 0.28);
    --text: #edf4ff;
    --muted: #95a8c7;
    --accent: #77a7ff;
    --accent-2: #a6d4ff;
    --gold: #f2c36b;
}

html,
body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(119, 167, 255, 0.18),
            transparent 28%),
        radial-gradient(
            circle at 85% 10%,
            rgba(242, 195, 107, 0.10),
            transparent 24%),
        linear-gradient(
            180deg,
            #07101a 0%,
            #0b1524 45%,
            #08111a 100%);
    color: var(--text);
    min-height: 100%;
    font-family:
        Inter,
        Segoe UI,
        system-ui,
        sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .035) 1px,
            transparent 1px),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .025) 1px,
            transparent 1px);
    background-size: 56px 56px;
    mask-image:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, .8),
            transparent 70%);
}

.container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 12, 20, 0.82);
    backdrop-filter: blur(14px);
}

.nav-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #f3f7ff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 2.4rem;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    overflow: visible;
    padding: 0;
}

.brand-ship {
    display: block;
    width: 3.8rem;
    height: 2.4rem;
    object-fit: contain;
    background-color: transparent !important;
}

.brand-text {
    text-transform: uppercase;
    font-size: 0.95rem;
}

.main-nav {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a {
    color: #c4d3f0;
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    font-size: 0.92rem;
    transition:
        background-color .16s ease,
        color .16s ease,
        transform .16s ease;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(119, 167, 255, .12);
    transform: translateY(-1px);
}

.main-nav a.nav-active {
    color: #09111d;
    background: var(--accent-2);
    font-weight: 700;
}

.main-nav a.nav-active:hover {
    color: #09111d;
    background: #d6ebff;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 4rem;
    background: rgba(7, 12, 20, 0.35);
}

.footer-shell {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    padding: 2rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-dot {
    color: var(--accent);
}

.page-shell {
    min-height: calc(100vh - 170px);
    padding: 2rem 0 0 0;
}

.admin-alert {
    position: sticky;
    top: 5.75rem;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border:
        1px solid
        rgba(119, 255, 187, 0.45) !important;
    border-radius: 1rem;
    color: #eafff4;
    background:
        linear-gradient(
            135deg,
            rgba(33, 121, 78, 0.92),
            rgba(20, 72, 96, 0.92)) !important;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.admin-alert.is-hiding {
    opacity: 0;
    transform: translateY(-0.35rem);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.admin-alert-close {
    flex: 0 0 auto;
    border:
        1px solid
        rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #eafff4;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    width: 1.8rem;
    height: 1.8rem;
}

.hero-panel,
.portal-tile,
.details-shell,
.portal-card,
.prose-block {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(10px);
    border-radius: 1.1rem;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, .25);
}

.hero-panel {
    padding: 3rem;
    margin-bottom: 2rem;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 1.25fr)
        minmax(260px, .75fr);
    gap: 2rem;
    overflow: hidden;
    min-height: 440px;
    background:
        linear-gradient(
            90deg,
            rgba(5, 10, 18, .82) 0%,
            rgba(5, 10, 18, .58) 34%,
            rgba(5, 10, 18, .16) 62%,
            rgba(5, 10, 18, 0) 100%),
        radial-gradient(
            circle at 78% 40%,
            rgba(119, 167, 255, .22),
            transparent 34%);
    background-size: cover;
    background-position: center top;
}

.home-hero-image {
    background-image:
        linear-gradient(
            90deg,
            rgba(5, 10, 18, .82) 0%,
            rgba(5, 10, 18, .58) 34%,
            rgba(5, 10, 18, .16) 62%,
            rgba(5, 10, 18, 0) 100%),
        url("/media/shared/home-hero-hard-bargain.png");
    background-size: cover;
    background-position: center top;
}

.home-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.home-hero .lead {
    max-width: 680px;
    font-size: 1.12rem;
    line-height: 1.65;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero-orbit {
    display: none;
}

.eyebrow {
    color: var(--accent-2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0 0 0.65rem 0;
}

.lead,
.meta-line,
.section-note,
.portal-card .card-body p {
    color: var(--muted);
}

.lead,
.prose-block > p,
.portal-card .card-body p,
.lore-outline-summary {
    white-space: pre-line;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
}

.btn-primary {
    background: var(--accent);
    color: #09111d;
    box-shadow:
        0 12px 28px rgba(119, 167, 255, .26);
}

.btn-secondary {
    border:
        1px solid
        rgba(255, 255, 255, .25);
    color: var(--text);
    background: rgba(255, 255, 255, .04);
}

.home-section {
    margin-top: 2.5rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
    letter-spacing: -0.035em;
}

.section-heading h1 {
    font-size:
        clamp(2rem, 5vw, 3.4rem);
}

.section-heading h2 {
    font-size:
        clamp(1.55rem, 3vw, 2.2rem);
}

.section-heading a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 700;
}

.card-grid,
.portal-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(190px, 1fr));
}

.child-location-grid {
    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 280px));
    justify-content: start;
}

.portal-tile {
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
}

.portal-card {
    color: var(--text);
    overflow: hidden;
    text-decoration: none;
    transition:
        transform .16s ease,
        border-color .16s ease,
        background-color .16s ease;
}

.portal-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    background: rgba(20, 35, 55, 0.9);
}

.card-image-wrap {
    background: #111c2d;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.portal-card-image,
.details-image {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center;
    background: #111c2d;
}

.entity-image-portrait {
    aspect-ratio: 2 / 3;
}

.entity-image-square {
    aspect-ratio: 1 / 1;
}

.entity-image-landscape {
    aspect-ratio: 3 / 2;
}

.books-grid .portal-card-image {
    aspect-ratio: 2 / 3;
    object-fit: contain;
}

.card-body {
    padding: 1rem;
}

.card-body h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.card-kicker {
    margin: 0 0 0.35rem 0;
    color: var(--accent-2) !important;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.details-shell {
    display: grid;
    grid-template-columns:
        minmax(260px, 360px)
        1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.details-shell-book {
    grid-template-columns:
        minmax(220px, 320px)
        1fr;
}

.details-media {
    min-width: 0;
    overflow: hidden;
    border-radius: 0.9rem;
}

.prose-block {
    background: var(--panel-2);
    padding: 1rem;
}

.lore-outline {
    max-width: 920px;
    margin-bottom: 2rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    background: var(--panel);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, .25);
    backdrop-filter: blur(10px);
}

.lore-outline-list {
    position: relative;
    margin: 0.45rem 0 0 0.8rem;
    padding: 0 0 0 1.35rem;
    list-style: none;
    border-left: 1px solid var(--line-strong);
}

.lore-outline-root {
    margin: 0;
    padding-left: 0;
    border-left: 0;
}

.lore-outline-item {
    position: relative;
    margin: 0;
    padding: 0.4rem 0;
}

.lore-outline-list:not(.lore-outline-root)
    > .lore-outline-item::before {
    content: "";
    position: absolute;
    top: 1.35rem;
    left: -1.35rem;
    width: 1rem;
    border-top: 1px solid var(--line-strong);
}

.lore-outline-entry {
    padding: 0.65rem 0.8rem;
    border-radius: 0.75rem;
    transition:
        background-color .16s ease,
        transform .16s ease;
}

.lore-outline-entry:hover {
    background: rgba(119, 167, 255, 0.08);
    transform: translateX(0.15rem);
}

.lore-outline-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.lore-outline-link:hover {
    color: var(--accent-2);
}

.lore-outline-root
    > .lore-outline-item
    > .lore-outline-entry
    > .lore-outline-link {
    color: var(--accent-2);
    font-size: 1.15rem;
}

.lore-outline-summary {
    max-width: 760px;
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

a {
    color: var(--accent);
}

@media (max-width: 900px) {
    .details-shell,
    .details-shell-book,
    .home-hero {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        padding: 2rem;
    }

    .nav-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .home-hero-image {
        background-position: 58% top;
    }

    .admin-alert {
        top: 8.75rem;
    }

    .details-media {
        max-width: 420px;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 1rem, 1200px);
    }

    .main-nav a {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }

    .home-hero {
        min-height: 440px;
    }

    .home-hero h1 {
        font-size: 2.4rem;
    }

    .admin-alert {
        top: 10.5rem;
    }

    .details-media {
        max-width: none;
    }

    .lore-outline {
        padding: 0.9rem;
    }

    .lore-outline-list {
        margin-left: 0.3rem;
        padding-left: 1rem;
    }

    .lore-outline-list:not(.lore-outline-root)
        > .lore-outline-item::before {
        left: -1rem;
        width: 0.7rem;
    }
}