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

:root {
    color-scheme: dark;
    --background: #101015;
    --surface: #1a1a22;
    --surface-raised: #22222c;
    --text: #f3f1f5;
    --muted: #b5b0bd;
    --accent: #a78bfa;
    --accent-bright: #8767db;
    --cyan: var(--accent);
    --line: rgba(220, 211, 235, .14);
    --shadow: 0 12px 32px rgba(0, 0, 0, .22);
}

body[data-theme="blue"] {
    --accent: #78a9ee;
    --accent-bright: #477bc4;
}

body[data-theme="red"] {
    --accent: #e77b78;
    --accent-bright: #c65055;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    min-width: 320px;
    background:
        radial-gradient(ellipse at 12% 9%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 34rem),
        radial-gradient(ellipse at 88% 48%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 38rem),
        var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.7;
}

a { color: inherit; }

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 700px;
    padding: 22px max(6vw, 24px) 70px;
    background:
        linear-gradient(115deg, rgba(10, 10, 17, .97) 8%, rgba(17, 16, 27, .88) 56%, rgba(13, 14, 22, .96)),
        radial-gradient(ellipse at 78% 38%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 34rem),
        #101015;
    border-bottom: 1px solid var(--line);
}

.hero::before,
.hero::after {
    display: block;
    position: absolute;
    z-index: -1;
    border: 1px solid color-mix(in srgb, var(--accent) 17%, transparent);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.hero::before {
    top: 80px;
    right: -190px;
    width: 600px;
    height: 600px;
    box-shadow: 0 0 0 44px rgba(167, 139, 250, .025), 0 0 0 100px rgba(167, 139, 250, .02);
}

.hero::after {
    bottom: -260px;
    left: 24%;
    width: 420px;
    height: 420px;
    border-color: color-mix(in srgb, var(--accent) 13%, transparent);
}

.navigation {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    min-height: 58px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.logo {
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-decoration: none;
}

.logo::before {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 10px 2px 0;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 18px rgba(103, 232, 249, .8);
    content: "";
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    backdrop-filter: blur(14px);
}

.theme-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 6px 5px 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .045);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.theme-picker select {
    min-width: 132px;
    padding: 9px 34px 9px 34px;
    appearance: none;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
    border-radius: 11px;
    background: radial-gradient(circle at 15px 50%, var(--accent) 0 5px, transparent 5.5px), var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.theme-picker select:hover,
.theme-picker select:focus-visible {
    border-color: var(--accent);
}

.theme-picker::after {
    position: absolute;
    right: 17px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    content: "";
    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
}

.nav-links a {
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: .9rem;
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    transform: translateY(-1px);
    background: rgba(167, 139, 250, .17);
    color: #fff;
}

.hero-layout {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    min-height: 570px;
    margin: 22px auto 0;
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    align-items: center;
    gap: clamp(34px, 6vw, 80px);
}

.hero-content { max-width: 550px; animation: rise-in .8s both; }

.eyebrow {
    margin-bottom: 12px;
    color: var(--cyan);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .19em;
    text-transform: uppercase;
}

.hero h1 {
    margin-bottom: 20px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(4rem, 9vw, 7.4rem);
    line-height: .98;
    letter-spacing: -.045em;
    text-shadow: 0 0 45px rgba(167, 139, 250, .22);
}

.hero-description {
    max-width: 510px;
    margin-bottom: 30px;
    color: #c3c7d6;
    font-size: clamp(1.05rem, 2vw, 1.23rem);
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 21px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: var(--accent);
    color: #15121a;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .2);
    transition: transform .18s ease, filter .18s ease;
}

.button:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.button span { font-size: 1.25rem; transition: transform .2s ease; }
.button:hover span { transform: translateX(4px); }

.hero-art {
    position: relative;
    margin: 0;
    animation: float-in 1s .15s both;
}

.hero-art::before {
    position: absolute;
    inset: 13% -5% -7% 12%;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: 30px;
    content: "";
    transform: rotate(3deg);
}

.hero-art img {
    position: relative;
    display: block;
    width: 100%;
    max-height: 470px;
    object-fit: cover;
    border: 1px solid rgba(205, 200, 255, .36);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .46), 0 0 40px rgba(124, 108, 255, .12);
    transition: transform .45s ease, border-color .3s ease;
}

.hero-art:hover img { transform: translateY(-6px) rotate(-.5deg); border-color: color-mix(in srgb, var(--accent) 70%, white); }

.hero-art figcaption {
    position: absolute;
    right: 17px;
    bottom: 16px;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    background: rgba(10, 12, 22, .76);
    color: #eef1ff;
    font-size: .82rem;
    backdrop-filter: blur(12px);
}

.section {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 88px 0;
    animation: rise-in .7s both;
}

.section-heading { margin-bottom: 34px; text-align: center; }
.section-heading .eyebrow { color: var(--accent); }

.section-heading h2 {
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.text-panel {
    position: relative;
    max-width: 930px;
    margin: 0 auto;
    padding: 34px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    color: var(--muted);
    box-shadow: var(--shadow);
}

.text-panel p + p { margin-top: 14px; }
.text-panel strong, .theme-list strong { color: var(--text); }

.story-image {
    display: block;
    width: 100%;
    margin-top: 25px;
    border: 1px solid var(--line);
    border-radius: 17px;
}

.plot-section {
    width: 100%;
    max-width: none;
    padding-right: max(20px, calc((100% - 1120px) / 2));
    padding-left: max(20px, calc((100% - 1120px) / 2));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 38rem),
        rgba(12, 12, 18, .58);
}

.plot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.info-card, .character {
    position: relative;
    padding: 27px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-raised);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .14);
    transition: transform .18s ease, border-color .18s ease;
}

.info-card:hover, .character:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.card-number {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 800;
}

.info-card h3, .character h3 {
    margin: 13px 0 8px;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
}

.info-card p, .character p { color: var(--muted); }

.character-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.character { border-top: 2px solid color-mix(in srgb, var(--accent) 65%, transparent); }
.character:nth-child(even) { border-top-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.themes-section { padding-top: 68px; }

.theme-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 30px 14px 52px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    color: var(--muted);
    box-shadow: var(--shadow);
}

.theme-list li { margin: 14px 0; padding-left: 7px; }
.theme-list li::marker { color: var(--cyan); }
.fact-box { max-width: 850px; margin: 32px auto 0; text-align: center; }

.fact-text {
    margin-top: 18px;
    padding: 20px 24px;
    border: 1px solid rgba(167, 139, 250, .3);
    border-radius: 18px;
    background: linear-gradient(145deg, #191e2c, #111521);
    color: #c5c9d8;
    box-shadow: var(--shadow);
    animation: fact-reveal .4s both;
}

footer {
    margin-top: 25px;
    padding: 35px 20px;
    border-top: 1px solid var(--line);
    background: #070910;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}

.author-credit {
    margin-top: 7px;
    color: var(--accent);
    font-weight: 700;
}

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float-in {
    from { opacity: 0; transform: translateX(22px) scale(.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes fact-reveal {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 800px) {
    .hero { min-height: auto; padding-bottom: 58px; }
    .navigation { align-items: flex-start; flex-direction: column; }
    .nav-links { max-width: 100%; }
    .hero-layout { min-height: auto; grid-template-columns: 1fr; gap: 38px; padding: 55px 0 15px; }
    .hero-content { margin: auto; text-align: center; }
    .hero-description { margin-right: auto; margin-left: auto; }
    .hero-art { width: min(620px, 100%); margin: auto; }
    .hero-art img { max-height: 390px; }
    .plot-grid, .character-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
    .hero { padding-right: 18px; padding-left: 18px; }
    .nav-links { gap: 2px; border-radius: 17px; }
    .nav-links a { padding: 6px 9px; font-size: .83rem; }
    .hero-layout { padding-top: 42px; }
    .hero h1 { font-size: clamp(3.8rem, 19vw, 5.5rem); }
    .hero-art img { border-radius: 20px; }
    .section { width: min(100% - 32px, 1120px); padding-top: 62px; padding-bottom: 62px; }
    .plot-section { width: 100%; padding-right: 16px; padding-left: 16px; }
    .plot-grid, .character-list { grid-template-columns: 1fr; }
    .text-panel { padding: 24px; border-radius: 19px; }
    .theme-list { padding: 8px 20px 8px 38px; }
    .info-card, .character { border-radius: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
