/* Longhouse Stories */

:root {
    --ground: #F6F6F3;
    --ink: #141416;
    --soft: #3A3A40;
    --muted: #5A5A60;
    --line: #D9D9D4;
    --tint: #ECECE7;
    --accent: #43307A;
    --accent-light: #9C8AD6;
    --on-dark: #F6F6F3;
    --on-dark-soft: #D8D8DE;
    --on-dark-muted: #B9B9C2;
    --sans: 'Jost', 'Century Gothic', sans-serif;
    --serif: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
}

/* Header */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 32px;
    padding: 20px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    text-decoration: none;
    color: var(--ink);
}

.brand-bar { display: block; width: 44px; height: 6px; background: var(--accent); }

.brand-name {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--sans);
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
}

.site-nav .nav-current a,
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }

/* Shared type */

.label,
.label-light,
.label-strong {
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.label { color: var(--muted); }
.label a { color: inherit; text-decoration: none; }
.label a:hover { text-decoration: underline; }
.label-light { color: var(--on-dark-muted); }
.label-strong { margin: 0; font-weight: 500; font-size: 14px; letter-spacing: 0.24em; color: var(--ink); }

.meta { font-family: var(--sans); font-size: 14px; color: var(--muted); }

.display { margin: 0; font-weight: 500; font-size: clamp(38px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.01em; }
.display-xl { margin: 0; font-weight: 400; font-size: clamp(44px, 7vw, 80px); line-height: 1; letter-spacing: -0.015em; }
.h2 { margin: 0; font-weight: 500; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; }

.lede { margin: 0; font-size: 21px; line-height: 1.55; max-width: 30em; text-wrap: pretty; }
.lede-lg { margin: 0; font-size: 24px; line-height: 1.5; max-width: 30em; text-wrap: pretty; }

.rule { display: block; width: 120px; height: 2px; background: var(--accent); }
.rule-light { display: block; width: min(320px, 60%); height: 2px; background: var(--accent-light); }

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 0;
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

.btn-accent { background: var(--accent); color: var(--on-dark); }
.btn-accent:hover { background: var(--ink); color: var(--on-dark); }
.btn-dark { background: var(--ink); color: var(--on-dark); }
.btn-dark:hover { background: var(--accent); color: var(--on-dark); }
.btn-ghost-light { border-color: var(--on-dark); color: var(--on-dark); }
.btn-ghost-light:hover { background: var(--on-dark); color: var(--ink); }

/* Dark panels */

.panel { background: var(--ink); color: var(--on-dark); }

.hero {
    min-height: 380px;
    padding: 40px clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    text-align: center;
}

.hero-words { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.phrase {
    margin: 0;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(20px, 7vw, 56px);
    line-height: 1.2;
    white-space: nowrap;
}

.phrase-sm { font-size: clamp(20px, 6vw, 34px); }
.gloss { margin: 0; font-size: 21px; color: var(--on-dark-soft); }
.hero .btn { margin-top: 20px; }

.novel-hero {
    min-height: 480px;
    padding: 48px clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
}

.novel-hero-words { display: flex; flex-direction: column; gap: 24px; max-width: 760px; }
.novel-title { margin: 0; font-weight: 400; font-size: clamp(44px, 8vw, 96px); line-height: 1; letter-spacing: -0.015em; }

/* Home: featured novel */

.feature {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 48px;
    align-items: center;
    padding: 96px 0;
}

.feature-text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.feature-cover { display: flex; justify-content: center; }
.cover-img { width: min(300px, 100%); }

.cover {
    width: min(300px, 100%);
    aspect-ratio: 2 / 3;
    background: var(--accent);
    color: var(--on-dark);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cover-rule { display: block; width: 100%; height: 2px; background: var(--on-dark); }
.cover-title { font-family: var(--sans); font-weight: 500; font-size: 26px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.35; }
.cover-author { font-family: var(--sans); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; }

/* Sections and rows */

.section { border-top: 1px solid var(--ink); padding: 40px 0 96px; display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; min-height: 44px; }

.story { padding: 96px 0; display: flex; flex-direction: column; gap: 20px; }

.page-head { padding: 80px 0 48px; display: flex; flex-direction: column; gap: 20px; border-top: 1px solid var(--ink); }

.rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.rows-page { margin-bottom: 96px; }

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 4px 24px;
    align-items: baseline;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
}

.row-two { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.row-title { font-size: 26px; line-height: 1.2; }
.row:hover .row-title { color: var(--accent); }

.empty { margin: 0; padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); font-style: italic; }

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin: -48px 0 96px;
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Reading view */

.reading { max-width: 680px; margin: 0 auto; padding: 88px 0 72px; display: flex; flex-direction: column; gap: 56px; border-top: 1px solid var(--ink); }
.reading-head { display: flex; flex-direction: column; gap: 20px; }
.reading-title { margin: 0; font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1.05; letter-spacing: -0.015em; }

.reading-body { font-size: 21px; line-height: 1.7; }
.reading-body > * { margin: 0 0 24px; }
.reading-body > *:last-child { margin-bottom: 0; }
.reading-body h2 { font-weight: 500; font-size: 30px; line-height: 1.2; margin-top: 48px; }
.reading-body h3 { font-weight: 500; font-size: 24px; line-height: 1.25; margin-top: 40px; }
.reading-body blockquote { margin-left: 0; margin-right: 0; padding-left: 24px; font-style: italic; color: var(--soft); }
.reading-body img { display: block; margin-left: auto; margin-right: auto; }
.reading-body figcaption { margin-top: 8px; font-family: var(--sans); font-size: 14px; color: var(--muted); text-align: center; }

/* A divider in the Ghost editor becomes the scene break bar */
.reading-body hr { width: 44px; height: 6px; margin: 40px auto; border: 0; background: var(--ink); }

/* Required by Ghost for wide and full width editor cards */
.gh-content .kg-width-wide { position: relative; width: min(100vw - 40px, 920px); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }

.reading-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 32px; border-top: 1px solid var(--ink); }
.nav-link { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 44px; text-decoration: none; color: var(--ink); font-family: var(--sans); }
.nav-right { text-align: right; }
.nav-title { font-size: 18px; }
.nav-link:hover .nav-title { color: var(--accent); }

.comments { display: flex; flex-direction: column; gap: 16px; padding-top: 32px; border-top: 1px solid var(--ink); }

/* Signup */

.signup {
    background: var(--tint);
    padding: clamp(32px, 6vw, 64px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 32px 48px;
    align-items: end;
}

.signup-text { display: flex; flex-direction: column; gap: 12px; }
.signup-text p { margin: 0; color: var(--soft); }
.signup-form { display: flex; flex-direction: column; gap: 8px; }
.signup-row { display: flex; flex-wrap: wrap; gap: 12px; }

.signup-row input {
    flex: 1 1 220px;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
}

.form-msg { display: none; margin: 4px 0 0; font-family: var(--sans); font-size: 15px; }
.signup-form.success .form-success { display: block; color: var(--accent); }
.signup-form.error .form-error { display: block; color: #8A1F1F; }
.signup-form.loading .btn { opacity: 0.6; }

/* About and other pages */

.about {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 48px 72px;
    align-items: start;
    padding: 88px 0 96px;
    border-top: 1px solid var(--ink);
}

.about-panel {
    aspect-ratio: 4 / 5;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.about-panel .gloss { font-size: 18px; }
.about-text { display: flex; flex-direction: column; gap: 24px; }
.about-text .reading-body { color: var(--soft); line-height: 1.65; }

/* Coming soon */

.soon {
    min-height: 380px;
    margin-bottom: 96px;
    padding: 40px clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    text-align: center;
}

.soon-title {
    margin: 0;
    padding-left: 0.4em;
    font-family: var(--sans);
    font-weight: 500;
    font-size: clamp(18px, 5vw, 36px);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    white-space: nowrap;
}

.soon-text { font-size: 21px; color: var(--on-dark-soft); }
.soon-text > * { margin: 0; }
.soon-text:empty { display: none; }

/* Contact */

.contact { padding: 80px 0 96px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 28px; }
.contact-block { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.contact-email { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(19px, 5.2vw, 32px); overflow-wrap: anywhere; }

/* Footer */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 40px 0 56px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--muted);
}

/* Phones: stack the site name, one word per line */

.brand-name { white-space: nowrap; }

@media (max-width: 480px) {
    .brand-name { white-space: normal; width: min-content; line-height: 1.6; }
}

.home-gap { height: 96px; }
