:root {
    --bg: #f7f0e8;
    --bg-soft: #fffaf4;
    --surface: #fff8f1;
    --text: #4a3426;
    --text-soft: #6f5645;
    --accent: #b86b3f;
    --accent-dark: #8f4f2c;
    --border: #e8d5c3;
    --shadow: 0 12px 30px rgba(74, 52, 38, 0.08);
    --radius: 18px;
    --max-width: 1100px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Source Sans 3", sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(255, 236, 214, 0.8), transparent 38%),
        linear-gradient(180deg, #f9f2ea 0%, var(--bg) 100%);
}

h1,
h2,
h3 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent-dark);
}

.container {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
}

.narrow {
    width: min(calc(100% - 2rem), 900px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 248, 241, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
}

.brand {
    text-decoration: none;
    color: inherit;
}

.brand-title {
    display: block;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
}

.brand-tagline {
    display: block;
    font-size: 0.92rem;
    color: var(--text-soft);
}

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text);
}

.site-nav a:hover {
    color: var(--accent-dark);
}

.hero {
    padding: 4.5rem 0 3rem;
}

.hero-inner {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

.hero h1 {
    font-size: clamp(2.6rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--text-soft);
    max-width: 42rem;
}

.stories {
    padding: 1rem 0 4rem;
}

.name-roll {
    padding: 0 0 2.5rem;
}

.name-roll-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.name-roll-list a {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    border-bottom: 2px solid rgba(184, 107, 63, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.name-roll-list a:hover {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

.section-heading {
    margin-bottom: 2rem;
}

.section-heading h2 {
    font-size: 2.2rem;
}

.section-heading p,
.story-bio,
.story-title,
.empty-state p {
    color: var(--text-soft);
}

.story-title {
    font-style: italic;
    margin-top: -0.35rem;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.story-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.story-card-body {
    padding: 1.5rem 1.5rem 0.5rem;
}

.story-card h3 {
    font-size: 1.8rem;
}

.story-name {
    color: inherit;
    text-decoration: none;
}

.story-name:hover {
    color: var(--accent-dark);
}

.story-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.2rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.button-secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}

.button-secondary:hover {
    background: rgba(184, 107, 63, 0.08);
}

.text-link {
    font-size: 0.95rem;
}

.empty-state,
.not-found {
    padding: 3rem 0 4rem;
}

.empty-state,
.not-found .container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.story-page {
    margin: 0;
    padding: 0;
}

.story-intro {
    padding: 2rem 0 1.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    text-decoration: none;
    font-weight: 500;
}

.story-page h1 {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
}

.pdf-toolbar {
    margin: 1.5rem 0 0;
}

.pdf-viewer {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    background: #fff;
    min-height: 70vh;
}

.pdf-viewer-full {
    width: 100%;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
}

.pdf-viewer iframe,
.pdf-viewer embed,
.pdf-frame {
    display: block;
    width: 100%;
    border: 0;
}

.pdf-view-page {
    min-height: 100dvh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.pdf-view-page .header-inner {
    padding: 0.75rem 0;
}

.pdf-view-page main {
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.pdf-view-page .story-page {
    height: 100%;
    margin: 0;
    padding: 0;
}

.pdf-view-page .pdf-viewer {
    min-height: 0;
    height: 100%;
    border: none;
    border-radius: 0;
}

.pdf-view-page .pdf-frame {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.empty-state code {
    background: rgba(184, 107, 63, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

@media (max-width: 720px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero {
        padding-top: 3rem;
    }
}
