/* ============================================================
   SHORT STORIES — sub-site stylesheet
   A sibling of the Jackrabbit and Trust Us sites: same skeleton
   (navbar / burger / footer), its own weather.
   Palette: night ink, warm reading paper, and one accent colour
   that each story can retune by overriding --accent on <body>.
   ============================================================ */

/* ----- Accessibility: skip link ----- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background-color: var(--accent-bright);
    color: var(--night);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-ui);
    font-weight: 500;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

/* ----- Base ----- */
:root {
    --ink: #1a2030;
    --night: #0d1221;
    --night-soft: #1a2236;
    --muted: #5f687c;
    --mist: #b4bdcc;
    --paper: #f6f3ec;
    --card: #fdfcf8;
    --line: #e2ddd1;
    --accent: #2b6699;
    --accent-bright: #8cc8ee;
    --accent-deep: #1d4c76;
    --log-bg: #edf1f5;
    --log-line: #d3dce6;
    --light-text: #f2f0ea;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Literata', Georgia, serif;
    --font-ui: 'Jost', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    --box-shadow: 0 6px 18px rgba(13, 18, 33, 0.10);
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 { font-size: 3.6rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 1.7rem; }

p { margin-bottom: 1.5rem; }

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

a:hover { color: var(--accent); }

a:focus-visible,
.burger:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}

section { padding: 4rem 0; }

/* Small spaced capitals used above headings */
.kicker {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

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

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ----- Navigation ----- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background-color: var(--night);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

.navbar.scrolled {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.logo a {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--light-text);
    white-space: nowrap;
}

.logo a em {
    font-style: italic;
    color: var(--accent-bright);
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li { margin-left: 2rem; }

.nav-links a {
    color: var(--light-text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    padding: 0.5rem;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links .active {
    color: var(--accent-bright);
}

.nav-links .nav-return {
    border: 1px solid rgba(180, 189, 204, 0.45);
    border-radius: 4px;
    padding: 0.45rem 0.9rem;
}

.nav-links .nav-return:hover { border-color: var(--accent-bright); }

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--light-text);
    margin: 5px;
    transition: var(--transition);
}

/* ----- Starfield used behind dark bands ----- */
.starfield {
    background-color: var(--night);
    background-image:
        radial-gradient(1.2px 1.2px at 12% 22%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
        radial-gradient(1px 1px at 31% 68%, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 47% 14%, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 82%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 73% 36%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 86% 61%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 93% 12%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
        radial-gradient(1px 1px at 5% 84%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
        radial-gradient(ellipse 60% 70% at 0% 0%, rgba(255, 221, 140, 0.10), transparent 70%),
        linear-gradient(180deg, #090d1a 0%, #121a30 100%);
    background-size:
        340px 260px, 340px 260px, 340px 260px, 340px 260px,
        340px 260px, 340px 260px, 340px 260px, 340px 260px,
        100% 100%, 100% 100%;
}

/* ----- Page header (contents page) ----- */
.page-header {
    color: var(--light-text);
    text-align: center;
    padding: 9rem 0 4.5rem;
}

.page-header .kicker { color: var(--accent-bright); }

.page-header h1 {
    font-size: 4.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.page-header h1 em {
    font-style: italic;
    color: var(--accent-bright);
}

.page-header p {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.12rem;
    color: var(--mist);
}

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    margin: 10px 0;
    padding: 0.75rem 1.8rem;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
    transition: var(--transition);
}

.btn-accent {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-accent:hover {
    background-color: var(--accent-deep);
    color: #ffffff;
}

.btn-ghost {
    background-color: transparent;
    color: var(--light-text);
    border: 1px solid rgba(180, 189, 204, 0.55);
}

.btn-ghost:hover {
    border-color: var(--accent-bright);
    color: var(--accent-bright);
}

.btn-ghost.dark {
    color: var(--ink);
    border-color: var(--muted);
}

.btn-ghost.dark:hover {
    color: var(--accent-deep);
    border-color: var(--accent-deep);
}

/* ----- Contents list ----- */
.contents { padding: 4.5rem 0 5rem; }

.contents .container { max-width: 980px; }

.contents-title {
    text-align: center;
    margin-bottom: 1.8rem;
}

.story-list { list-style: none; }

.story-entry {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.story-entry + .story-entry { margin-top: 2.5rem; }

.story-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(13, 18, 33, 0.16);
}

.story-art {
    display: block;
    background-color: var(--night);
    min-height: 100%;
}

.story-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 68% 50%;
    transition: transform 0.6s ease;
}

.story-entry:hover .story-art img { transform: scale(1.03); }

.story-summary { padding: 2.4rem 2.4rem 2.2rem; }

.story-summary h2 {
    font-size: 2.5rem;
    margin-bottom: 0.4rem;
}

.story-summary h2 a { color: var(--ink); }
.story-summary h2 a:hover { color: var(--accent-deep); }

.story-meta {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 1.3rem;
}

.story-teaser { font-size: 1.05rem; }

.story-summary .btn { margin-bottom: 0; }

.list-note {
    text-align: center;
    font-style: italic;
    color: var(--muted);
    margin: 3rem 0 0;
}

/* ----- Story hero (story pages) ----- */
.story-hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: flex-end;
    color: var(--light-text);
    background-color: var(--night);
    background-size: cover;
    background-position: 70% 22%;
    padding: 7rem 0 4rem;
}

.story-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(9, 13, 26, 0.92) 0%, rgba(9, 13, 26, 0.6) 42%, rgba(9, 13, 26, 0) 70%),
        linear-gradient(0deg, rgba(9, 13, 26, 0.7) 0%, rgba(9, 13, 26, 0) 45%);
}

.story-hero .container {
    position: relative;
    animation: fadeIn 1.4s ease-out;
}

.story-hero .kicker { color: var(--accent-bright); }

.story-hero .kicker a { color: inherit; }
.story-hero .kicker a:hover { color: var(--light-text); }

.story-hero h1 {
    font-size: 5rem;
    font-weight: 500;
    max-width: 9em;
    line-height: 1;
    margin-bottom: 1.2rem;
}

.story-byline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--light-text);
    margin-bottom: 0.4rem;
}

.story-hero .story-meta {
    color: var(--mist);
    margin-bottom: 0;
}

.hero-benevolence-deferred {
    background-image: url("../images/benevolence_deferred.svg");
}

/* ----- Reading column ----- */
.story {
    background-color: var(--card);
    padding: 4.5rem 0 5rem;
}

.story-body {
    max-width: 40rem;
    width: 90%;
    margin: 0 auto;
    font-size: 1.14rem;
    line-height: 1.85;
}

.story-body p { margin-bottom: 1.35rem; }

.story-part { padding: 0; }

.story-part + .story-part { margin-top: 4.5rem; }

.story-part h2 {
    text-align: center;
    font-size: 2.3rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 2.4rem;
}

.story-part h2::after {
    content: "";
    display: block;
    width: 2.6rem;
    height: 2px;
    margin: 1rem auto 0;
    background-color: var(--accent);
}

/* Opening paragraph of the first scene */
.story-body .opening::first-letter {
    font-family: var(--font-display);
    font-size: 4.4rem;
    font-weight: 600;
    float: left;
    line-height: 0.8;
    margin: 0.06em 0.1em 0 0;
    color: var(--accent-deep);
}

/* "Day 31,058." markers between scenes */
.dateline {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 2.8rem 0 1.3rem;
}

.story-part h2 + .dateline { margin-top: 0; }

.dateline::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--line);
}

/* Mission log entries, set like a printed record */
.log {
    background-color: var(--log-bg);
    border: 1px solid var(--log-line);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 1.7rem 1.9rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.75;
    color: #253049;
}

.story-body .log p { margin-bottom: 1rem; }

.story-body .log .log-head {
    color: var(--accent-deep);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--log-line);
}

.story-body .log .log-sign {
    text-align: right;
    margin: 1.4rem 0 0;
}

.story-end {
    text-align: center;
    font-family: var(--font-mono);
    letter-spacing: 0.5em;
    color: var(--muted);
    margin: 3.5rem 0 0;
}

/* ----- Author's note ----- */
.author-note {
    max-width: 40rem;
    width: 90%;
    margin: 4rem auto 0;
    padding: 2.2rem 2.2rem 1.6rem;
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 0 0 8px 8px;
    font-size: 0.97rem;
    line-height: 1.7;
}

.author-note h2 {
    font-size: 1.9rem;
    margin-bottom: 1.2rem;
}

.author-note h3 {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.6rem 0 0.6rem;
}

.author-note p { margin-bottom: 1rem; }

.author-note .sources { list-style: none; }

.author-note .sources li {
    padding-left: 1.1rem;
    margin-bottom: 0.7rem;
    position: relative;
}

.author-note .sources li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--accent);
}

.author-note a {
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-color: rgba(43, 102, 153, 0.35);
    text-underline-offset: 2px;
}

.author-note a:hover { text-decoration-color: var(--accent); }

.story-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 40rem;
    width: 90%;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}

/* ----- Footer ----- */
footer {
    background-color: var(--night);
    color: var(--light-text);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo h3 { margin-bottom: 0.4rem; }

.footer-logo p {
    color: var(--mist);
    font-style: italic;
    margin-bottom: 0;
}

.footer-links ul { list-style: none; }

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
    color: var(--light-text);
    font-family: var(--font-ui);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
}

.footer-links a:hover { color: var(--accent-bright); }

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(242, 240, 234, 0.12);
    font-size: 0.9rem;
    color: var(--mist);
}

.copyright p { margin-bottom: 0; }

/* ----- Animations ----- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes navLinkFade {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----- Responsive ----- */
@media screen and (max-width: 1080px) and (min-width: 769px) {
    .logo a { font-size: 1.6rem; }

    .nav-links li { margin-left: 0.6rem; }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.3rem;
    }

    .nav-links .nav-return { padding: 0.4rem 0.6rem; }
}

@media screen and (max-width: 768px) {
    h1 { font-size: 2.6rem; }
    h2 { font-size: 1.9rem; }

    .nav-links {
        position: absolute;
        right: 0;
        height: 92vh;
        top: 8vh;
        background-color: var(--night);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 3rem;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 999;
    }

    .nav-links li {
        opacity: 0;
        margin: 1.2rem 0;
    }

    .burger { display: block; }

    .nav-active { transform: translateX(0%); }

    .page-header { padding: 7.5rem 0 3.5rem; }
    .page-header h1 { font-size: 3rem; }
    .page-header p { font-size: 1.02rem; }

    .story-entry { grid-template-columns: 1fr; }
    .story-art { aspect-ratio: 16 / 9; }
    .story-summary { padding: 1.8rem 1.5rem; }
    .story-summary h2 { font-size: 2.1rem; }

    .story-hero {
        min-height: 72vh;
        background-position: 75% 30%;
        padding: 6rem 0 2.8rem;
    }

    .story-hero::before {
        background: linear-gradient(0deg, rgba(9, 13, 26, 0.94) 0%, rgba(9, 13, 26, 0.55) 55%, rgba(9, 13, 26, 0.15) 100%);
    }

    .story-hero h1 { font-size: 3.3rem; }
    .story-byline { font-size: 1.08rem; }

    .story { padding: 3rem 0 3.5rem; }
    .story-body { font-size: 1.04rem; line-height: 1.8; }
    .story-part + .story-part { margin-top: 3.5rem; }
    .story-part h2 { font-size: 2rem; }

    .log {
        padding: 1.3rem 1.2rem;
        font-size: 0.84rem;
    }

    .author-note { padding: 1.8rem 1.3rem 1.2rem; }

    .footer-content { flex-direction: column; }
}
