/* ===== Story version — soft light immersive theme ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #e6ebf1;
    --content-glow: rgba(250, 248, 243, 0.9);
    --ink: #22202e;
    --body-text: #4c4759;
    --muted: #777185;
    --accent: #a87e2f;
    --blue: #3d6ec9;
    --green: #2e9e5f;
    --teal: #0e9c90;
    --card-bg: rgba(255, 255, 255, 0.55);
    --card-border: rgba(34, 32, 46, 0.09);
    --shadow-soft: 0 18px 50px -18px rgba(34, 32, 46, 0.22);
    --shadow-lift: 0 30px 70px -20px rgba(34, 32, 46, 0.3);
    --scene-glow: 61, 110, 201;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 800px at 85% -10%, rgba(61, 110, 201, 0.18), transparent 62%),
        radial-gradient(1000px 700px at -10% 30%, rgba(168, 126, 47, 0.14), transparent 58%),
        radial-gradient(900px 900px at 90% 80%, rgba(14, 156, 144, 0.13), transparent 62%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
}

/* A chapter-aware atmospheric wash fed by the WebGL scene. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(55vw 55vw at 8% 48%, rgba(var(--scene-glow), 0.16), transparent 68%),
        radial-gradient(48vw 48vw at 96% 28%, rgba(var(--scene-glow), 0.12), transparent 70%);
    transition: background 0.8s ease;
}

/* Fine film grain for a modern tactile finish */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
    background: var(--accent);
    color: #fff;
}

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

a:hover {
    text-decoration: underline;
}

/* Fixed 3D background */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* Soft reading lane: dimensional artifacts stay visible at the edges. */
.hero::after,
.chapter::after,
.epilogue::after {
    content: "";
    position: absolute;
    inset: 4% max(0px, calc(50% - 560px));
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, var(--content-glow) 0%, rgba(250, 248, 243, 0.76) 48%, rgba(250, 248, 243, 0.22) 72%, transparent 84%);
    filter: blur(30px);
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--teal));
    z-index: 100;
}

/* Back link */
.back-link {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 100;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px -10px rgba(34, 32, 46, 0.25);
    transition: color 0.25s, border-color 0.25s, transform 0.25s;
}

.back-link:hover {
    color: var(--ink);
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    perspective: 900px;
}

.hero-inner {
    transform-style: preserve-3d;
}

.hero-kicker {
    font-size: 13px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero-title {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: clamp(48px, 9vw, 120px);
    line-height: 1.02;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
    text-shadow: 0 20px 50px rgba(34, 32, 46, 0.15);
}

.hero-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.hero-title .line span {
    display: inline-block;
}

.hero-sub {
    font-size: clamp(16px, 2.2vw, 21px);
    font-weight: 300;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 48px;
}

.scroll-hint {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.mouse {
    display: inline-block;
    width: 24px;
    height: 38px;
    border: 2px solid var(--muted);
    border-radius: 14px;
    position: relative;
    margin-bottom: 10px;
}

.wheel {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 3px;
    height: 8px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--accent);
    animation: wheel 1.6s ease-in-out infinite;
}

@keyframes wheel {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* ===== Chapters ===== */
.chapter {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 16vh 24px;
}

.chapter-head {
    position: relative;
    margin-bottom: 48px;
}

.chapter-num {
    display: block;
    font-family: "Playfair Display", serif;
    font-size: 15px;
    color: var(--accent);
    letter-spacing: 0.5em;
    margin-bottom: 8px;
}

.chapter-title {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* Giant ghost numeral floating behind each chapter head */
.chapter-head::before {
    content: attr(data-num);
    position: absolute;
    top: -0.55em;
    right: -0.1em;
    z-index: -1;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: clamp(140px, 22vw, 260px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(34, 32, 46, 0.08);
    pointer-events: none;
    user-select: none;
}

.chapter-tag {
    margin-top: 10px;
    color: var(--muted);
    font-style: italic;
    font-size: 17px;
}

.chapter-body .lead {
    font-size: clamp(19px, 2.6vw, 24px);
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 22px;
}

.chapter-body p:not(.lead) {
    color: var(--body-text);
    margin-bottom: 20px;
    max-width: 720px;
}

.chapter-body strong {
    color: var(--ink);
}

.chapter-footnote {
    margin-top: 34px;
    font-size: 14px;
    color: var(--muted) !important;
}

/* Research cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 40px;
    perspective: 1200px;
}

.card {
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    transform-style: preserve-3d;
    transition: box-shadow 0.35s, border-color 0.35s;
    will-change: transform;
}

.card:hover {
    border-color: rgba(61, 110, 201, 0.45);
    box-shadow: var(--shadow-lift);
}

.card-venue {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue);
    border: 1px solid rgba(61, 110, 201, 0.55);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 14px;
}

.card h3 {
    font-family: "Playfair Display", serif;
    font-size: 20px;
    margin-bottom: 8px;
}

.card p {
    font-size: 14px;
    color: var(--muted);
}

/* ===== Football chapter ===== */
.chapter-football .chapter-num,
.chapter-football .chapter-tag {
    color: var(--green);
}

.cr7-block {
    position: relative;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.cr7-number {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: clamp(160px, 30vw, 380px);
    line-height: 0.85;
    color: transparent;
    -webkit-text-stroke: 2px rgba(46, 158, 95, 0.3);
    user-select: none;
    flex-shrink: 0;
    text-shadow: none;
}

.siu {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(28px, 5vw, 44px);
    color: var(--green);
    margin-top: 28px;
}

/* ===== LoL chapter ===== */
.chapter-lol .chapter-num,
.chapter-lol .chapter-tag {
    color: var(--teal);
}

.lol-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin: 44px 0 20px;
}

.lol-stat {
    display: flex;
    flex-direction: column;
    padding: 18px 26px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
}

.lol-stat-num {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: clamp(40px, 7vw, 64px);
    color: var(--teal);
    line-height: 1;
}

.lol-stat-label {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
}

.gg {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: clamp(22px, 4vw, 34px);
    color: var(--teal);
    opacity: 0.85;
}

/* ===== Photography chapter ===== */
.gear {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 30px 0 60px;
}

.gear-item {
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 8px 18px;
    border: 1px solid rgba(168, 126, 47, 0.55);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.4);
}

.album {
    margin-bottom: 80px;
}

.album-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.album-head h3 {
    font-family: "Playfair Display", serif;
    font-size: clamp(26px, 4vw, 38px);
}

.album-date {
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
}

.album-intro {
    color: var(--muted);
    max-width: 640px;
    margin-bottom: 26px !important;
    font-size: 15px;
}

.gallery {
    columns: 2;
    column-gap: 18px;
    perspective: 1400px;
}

.photo {
    break-inside: avoid;
    margin-bottom: 18px;
    border-radius: 14px;
    overflow: hidden;
    cursor: zoom-in;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    transform-style: preserve-3d;
    transition: box-shadow 0.35s;
    will-change: transform;
}

.photo:hover {
    box-shadow: var(--shadow-lift);
}

.photo img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo:hover img {
    transform: scale(1.04);
}

.photo figcaption {
    font-size: 12.5px;
    color: var(--muted);
    padding: 10px 14px;
    line-height: 1.5;
}

/* ===== Epilogue ===== */
.epilogue {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 18vh 24px 60px;
}

.epilogue-line {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: clamp(22px, 4vw, 34px);
    max-width: 640px;
    margin: 0 auto 40px;
}

.epilogue-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 60px;
}

.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.05em;
    box-shadow: 0 12px 30px -12px rgba(168, 126, 47, 0.7);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -12px rgba(168, 126, 47, 0.8);
    text-decoration: none;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.5);
    color: var(--accent);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 18px 40px -12px rgba(168, 126, 47, 0.8);
}

.copyright {
    font-size: 12px;
    color: var(--muted);
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(24, 22, 32, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 40px 24px;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 92vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.lightbox p {
    max-width: 720px;
    text-align: center;
    font-size: 14px;
    color: #b7b2c4;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #eae6df;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
    #bg-canvas {
        opacity: 0.82;
    }

    body::before {
        background:
            radial-gradient(90vw 90vw at 0% 42%, rgba(var(--scene-glow), 0.13), transparent 72%),
            radial-gradient(85vw 85vw at 100% 20%, rgba(var(--scene-glow), 0.1), transparent 74%);
    }

    .cr7-block {
        flex-direction: column;
        gap: 8px;
    }

    .cr7-number {
        font-size: 130px;
    }

    .gallery {
        columns: 1;
    }

    .lol-stats {
        gap: 16px;
    }

    .chapter {
        padding: 12vh 20px;
    }

    .chapter-head::before {
        font-size: 120px;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wheel {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    .photo img,
    .card,
    .photo,
    .back-link,
    .btn {
        transition: none;
    }
}
