/*
  TWD Tday Web — site.css
  Cut: October 26, 2026 8:13 AM
  Palette pulled from the hero: candle-gold, dried-blood red, bone, soot.
  Change log:
    Oct 26, 2026 8:13 AM  Added .companion badge (paw + "Comes with a companion")
                          for survivors whose Markdown frontmatter has companion:.
    Oct 26, 2026 8:05 AM  Hero <picture> was covering the hero buttons on desktop
                          (clicks never reached them). Picture moved behind, copy
                          lifted above. Smooth scroll added; "What's this?" now lands
                          What to Expect at the top of the window.
    Oct 26, 2026 12:05 AM First cut.
*/

:root {
    --soot: #0c0908;
    --soot-2: #140f0d;
    --panel: #1a1310;
    --panel-2: #221915;
    --line: #3a2a22;
    --line-soft: #2a1f1a;
    --bone: #e9dfcc;
    --bone-dim: #b9ab96;
    --ash: #8a7c6c;
    --blood: #8f1d18;
    --blood-hi: #c8382c;
    --gold: #c19a5b;
    --gold-dim: #8d7042;
    --good: #b7a35f;
    --bad: #b8483c;
    --f-display: "IM Fell English", "Georgia", serif;
    --f-sc: "IM Fell English SC", "Georgia", serif;
    --f-body: "Spectral", "Georgia", serif;
    --f-type: "Special Elite", "Courier New", monospace;
    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--soot);
    color: var(--bone);
    font-family: var(--f-body);
    font-size: 1.075rem;
    line-height: 1.65;
    overflow-x: hidden;
}

    /* faint grain over everything */
    body::after {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        opacity: .06;
        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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        z-index: 50;
    }

a {
    color: var(--gold);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

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

strong {
    color: #f4ead8;
    font-weight: 600;
}

em {
    color: var(--bone-dim);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--gold);
    color: var(--soot);
    padding: 6px 12px;
    z-index: 100;
}

    .skip:focus {
        left: 8px;
    }

/* ---------- top bar ---------- */
.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px var(--gutter);
    font-family: var(--f-type);
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bone-dim);
}

    .topbar a {
        color: var(--bone-dim);
        text-decoration: none;
    }

        .topbar a:hover {
            color: var(--bone);
        }

    .topbar .mark {
        color: var(--bone);
    }

        .topbar .mark span {
            color: var(--blood-hi);
        }

/* ---------- hero ---------- */
.hero {
    position: relative;
    min-height: min(92vh, 860px);
    display: flex;
    align-items: flex-end;
    isolation: isolate;
    overflow: hidden;
}

    .hero picture, .hero img.hero-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .hero picture {
        z-index: -2;
    }

    .hero img.hero-img {
        object-fit: cover;
        object-position: 50% 30%;
        z-index: -2;
    }

    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(180deg, rgba(12,9,8,.70) 0%, rgba(12,9,8,0) 18%), linear-gradient(0deg, var(--soot) 0%, rgba(12,9,8,.92) 22%, rgba(12,9,8,.35) 55%, rgba(12,9,8,0) 75%), radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%);
    }

.hero-copy {
    width: 100%;
    padding-bottom: clamp(28px, 6vh, 64px);
    position: relative;
    z-index: 1;
}

.eyebrow {
    font-family: var(--f-type);
    font-size: .85rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 .6rem;
}

.hero h1 {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(2.8rem, 8.2vw, 6.6rem);
    line-height: .92;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--bone);
    text-shadow: 0 2px 30px rgba(0,0,0,.8);
}

    .hero h1 .feast {
        color: var(--blood-hi);
        display: block;
    }

.tagline {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(1.2rem, 2.4vw, 1.65rem);
    line-height: 1.35;
    color: var(--bone);
    max-width: 34ch;
    margin: 1.1rem 0 1.6rem;
    text-shadow: 0 2px 16px rgba(0,0,0,.9);
}

    .tagline .dead {
        color: var(--blood-hi);
    }

.btn {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    font-family: var(--f-type);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .9rem;
    padding: .85em 1.4em;
    border: 1px solid var(--blood-hi);
    background: var(--blood);
    color: var(--bone);
    text-decoration: none;
    transition: background .2s, transform .2s;
}

    .btn:hover {
        background: var(--blood-hi);
        color: #fff;
        transform: translateY(-1px);
    }

    .btn.ghost {
        background: transparent;
        border-color: var(--gold-dim);
        color: var(--bone);
    }

        .btn.ghost:hover {
            background: rgba(193,154,91,.12);
        }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- premise ---------- */
.premise {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 64px);
    /* land the intro + What to Expect panel near the top of the window, not the section's padding */
    scroll-margin-top: calc(24px - clamp(40px, 7vw, 88px));
}

#survivors {
    scroll-margin-top: 0;
}

.premise .lead p:first-child {
    font-size: 1.28rem;
    line-height: 1.55;
}

    .premise .lead p:first-child::first-letter {
        font-family: var(--f-display);
        float: left;
        font-size: 4.2em;
        line-height: .82;
        padding: .06em .1em 0 0;
        color: var(--blood-hi);
    }

.dossier {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    padding: 26px 26px 20px;
    position: relative;
    align-self: start;
}

    .dossier::before {
        content: "";
        position: absolute;
        top: -1px;
        left: 22px;
        right: 22px;
        height: 3px;
        background: var(--blood);
    }

    .dossier h2 {
        font-family: var(--f-sc);
        font-weight: 400;
        font-size: 1.5rem;
        margin: 0 0 .8rem;
        color: var(--gold);
        letter-spacing: .02em;
    }

    .dossier ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .dossier li {
        padding: .5rem 0 .5rem 1.6rem;
        border-top: 1px dashed var(--line-soft);
        position: relative;
        font-size: 1rem;
        line-height: 1.45;
    }

        .dossier li:first-child {
            border-top: 0;
        }

        .dossier li::before {
            content: "✕";
            position: absolute;
            left: 0;
            top: .52rem;
            color: var(--blood-hi);
            font-size: .85rem;
        }

/* ---------- section heads ---------- */
.section-head {
    border-top: 1px solid var(--line);
    padding-top: clamp(36px, 6vw, 64px);
    margin-bottom: 28px;
}

    .section-head h2 {
        font-family: var(--f-display);
        font-weight: 400;
        font-size: clamp(2.1rem, 5vw, 3.4rem);
        line-height: 1;
        margin: 0 0 .9rem;
    }

    .section-head p {
        max-width: 68ch;
        color: var(--bone-dim);
        margin: 0 0 .7rem;
    }

    .section-head .note {
        font-family: var(--f-display);
        font-style: italic;
        color: var(--bone);
        font-size: 1.15rem;
    }

/* ---------- roster ---------- */
.roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 18px;
    margin: 0 0 clamp(56px, 8vw, 96px);
    padding: 0;
    list-style: none;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    padding: 22px 22px 18px;
    color: var(--bone);
    text-decoration: none;
    transition: border-color .2s, transform .2s, background .2s;
    overflow: hidden;
}

    .card::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--blood);
        transform: scaleY(0);
        transform-origin: top;
        transition: transform .25s;
    }

    .card:hover {
        border-color: var(--gold-dim);
        background: var(--panel-2);
        transform: translateY(-2px);
        color: var(--bone);
    }

        .card:hover::after {
            transform: scaleY(1);
        }

    .card .num {
        position: absolute;
        right: 14px;
        top: 2px;
        font-family: var(--f-display);
        font-size: 4.4rem;
        line-height: 1;
        color: rgba(193,154,91,.10);
    }

    .card .file {
        font-family: var(--f-type);
        font-size: .74rem;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--ash);
    }

    .card h3 {
        font-family: var(--f-display);
        font-weight: 400;
        font-size: 1.95rem;
        line-height: 1.05;
        margin: .25rem 0 .35rem;
    }

    .card .style {
        font-family: var(--f-type);
        font-size: .8rem;
        color: var(--gold);
        letter-spacing: .04em;
        margin-bottom: .8rem;
    }

    .card p {
        font-size: .98rem;
        line-height: 1.55;
        color: var(--bone-dim);
        margin: 0 0 1rem;
    }

        .card p strong {
            color: var(--bone);
        }

    .card .stats {
        margin-top: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: .9rem;
        border-top: 1px dashed var(--line);
    }

.chip {
    font-family: var(--f-type);
    font-size: .74rem;
    letter-spacing: .05em;
    padding: .25em .6em;
    border: 1px solid var(--line);
    color: var(--bone-dim);
    background: var(--soot-2);
    white-space: nowrap;
}

    .chip b {
        color: var(--bone);
        font-weight: 400;
    }

    .chip.top {
        border-color: var(--gold-dim);
        color: var(--gold);
    }

.card .go {
    font-family: var(--f-type);
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--blood-hi);
    margin-top: .9rem;
}

.card:hover .go {
    color: var(--bone);
}

/* ---------- companion badge (frontmatter: companion) ---------- */
.companion {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 1rem;
    padding: 10px 14px;
    border: 1px solid var(--gold-dim);
    background: linear-gradient(90deg, rgba(193,154,91,.16), rgba(193,154,91,.03));
    font-family: var(--f-sc);
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--bone);
}

    .companion .paw {
        flex: none;
        width: 30px;
        height: 30px;
        fill: var(--gold);
    }

    .companion small {
        display: block;
        font-family: var(--f-type);
        font-size: .68rem;
        letter-spacing: .14em;
        text-transform: uppercase;
        color: var(--gold);
        margin-bottom: 2px;
    }

.profile-hero .companion {
    display: inline-flex;
    margin: 0 0 1.3rem;
    font-size: 1.3rem;
    padding: 12px 18px;
}

    .profile-hero .companion .paw {
        width: 36px;
        height: 36px;
    }

/* ---------- footer ---------- */
.site-foot {
    border-top: 1px solid var(--line);
    background: var(--soot-2);
    padding: 36px 0 44px;
    color: var(--ash);
    font-size: .92rem;
    line-height: 1.6;
}

    .site-foot p {
        margin: 0 0 .5rem;
        max-width: 80ch;
    }

    .site-foot strong {
        color: var(--bone-dim);
    }

    .site-foot .stamp {
        font-family: var(--f-type);
        font-size: .72rem;
        letter-spacing: .08em;
        text-transform: uppercase;
        margin-top: 1rem;
        color: #6b5f52;
    }

/* ---------- survivor profile ---------- */
.profile-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 96px 0 40px;
    border-bottom: 1px solid var(--line);
}

    .profile-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -2;
        background: url("../img/hero-896.webp") center 35% / cover no-repeat;
        filter: grayscale(.35) blur(2px);
        transform: scale(1.05);
    }

    .profile-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(90deg, rgba(12,9,8,.97) 0%, rgba(12,9,8,.88) 50%, rgba(12,9,8,.70) 100%), linear-gradient(0deg, var(--soot) 0%, rgba(12,9,8,0) 40%);
    }

.crumbs {
    font-family: var(--f-type);
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ash);
    margin-bottom: 1.2rem;
}

    .crumbs a {
        color: var(--bone-dim);
        text-decoration: none;
    }

        .crumbs a:hover {
            color: var(--gold);
        }

.profile-hero h1 {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(2.8rem, 8vw, 5.4rem);
    line-height: .95;
    margin: 0 0 .7rem;
}

    .profile-hero h1 .the {
        display: block;
        font-size: .42em;
        color: var(--gold);
        letter-spacing: .04em;
        margin-bottom: .1em;
    }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 1.3rem;
    padding: 0;
    list-style: none;
}

    .tags li {
        font-family: var(--f-type);
        font-size: .82rem;
        padding: .3em .75em;
        border: 1px solid var(--blood);
        color: var(--bone);
        background: rgba(143,29,24,.18);
    }

.profile-hero .intro {
    max-width: 62ch;
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
    gap: clamp(24px, 4vw, 56px);
    padding: clamp(32px, 5vw, 56px) 0;
}

.profile-side {
    align-self: start;
    position: sticky;
    top: 20px;
    display: grid;
    gap: 18px;
}

.why {
    border-left: 3px solid var(--blood-hi);
    padding: 4px 0 4px 18px;
    margin: 0 0 2rem;
    font-family: var(--f-display);
    font-size: 1.28rem;
    line-height: 1.45;
    font-style: italic;
}

    .why strong {
        font-style: normal;
        color: var(--gold);
        font-family: var(--f-sc);
        font-weight: 400;
    }

.panel {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    padding: 20px 20px 16px;
}

    .panel h2 {
        font-family: var(--f-type);
        font-weight: 400;
        font-size: .82rem;
        letter-spacing: .16em;
        text-transform: uppercase;
        color: var(--gold);
        margin: 0 0 14px;
    }

.traits {
    display: grid;
    gap: 7px;
    margin: 0;
}

.trait {
    display: grid;
    grid-template-columns: 6.2em 1fr 2.4em;
    align-items: center;
    gap: 10px;
    font-size: .95rem;
}

    .trait dt {
        color: var(--bone-dim);
    }

    .trait dd {
        margin: 0;
    }

    .trait .val {
        font-family: var(--f-type);
        text-align: right;
        color: var(--bone);
    }

    .trait.pos .val {
        color: var(--good);
    }

    .trait.neg .val {
        color: var(--bad);
    }

    .trait.best dt {
        color: var(--bone);
    }
/* diverging pips: 2 negative slots | center | 3 positive slots */
.pips {
    display: grid;
    grid-template-columns: repeat(2, 1fr) 2px repeat(3, 1fr);
    gap: 3px;
    height: 10px;
}

    .pips i {
        background: var(--line-soft);
    }

        .pips i.c {
            background: var(--ash);
        }

        .pips i.on-pos {
            background: var(--good);
        }

        .pips i.on-neg {
            background: var(--bad);
        }

.durability {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
}

.stat {
    background: var(--soot-2);
    border: 1px solid var(--line-soft);
    padding: 10px 8px 8px;
    text-align: center;
}

    .stat dt {
        font-family: var(--f-type);
        font-size: .68rem;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--ash);
    }

    .stat dd {
        margin: 0;
        font-family: var(--f-display);
        font-size: 2rem;
        line-height: 1.1;
        color: var(--bone);
    }

    .stat.armor {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        text-align: left;
        padding: 10px 14px;
    }

        .stat.armor dd {
            font-size: 1.5rem;
        }

        .stat.armor .sub {
            font-family: var(--f-type);
            font-size: .78rem;
            color: var(--bone-dim);
            margin-left: .5em;
        }

.profile-main h2 {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: 1.85rem;
    margin: 2.2rem 0 .9rem;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 14px;
}

    .profile-main h2::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

    .profile-main h2:first-of-type {
        margin-top: 0;
    }

.profile-main p {
    margin: 0 0 1rem;
}

.entries {
    display: grid;
    gap: 12px;
    margin: 0;
}

.entry {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    padding: 14px 18px;
}

    .entry dt {
        font-family: var(--f-sc);
        font-size: 1.2rem;
        color: var(--bone);
        line-height: 1.25;
    }

        .entry dt .cost {
            font-family: var(--f-type);
            font-size: .74rem;
            letter-spacing: .06em;
            color: var(--gold);
            margin-left: .5em;
            white-space: nowrap;
        }

    .entry dd {
        margin: .3rem 0 0;
        color: var(--bone-dim);
        font-size: 1rem;
        line-height: 1.55;
    }

.issue {
    background: linear-gradient(90deg, rgba(143,29,24,.22), rgba(143,29,24,.04));
    border: 1px solid rgba(200,56,44,.35);
    padding: 16px 18px;
}

    .issue dt {
        font-family: var(--f-sc);
        font-size: 1.25rem;
        color: var(--blood-hi);
    }

    .issue dd {
        margin: .35rem 0 0;
        color: var(--bone);
    }

.gear p {
    color: var(--bone-dim);
}

.gear strong {
    color: var(--bone);
}

.join {
    font-family: var(--f-display);
    font-size: 1.3rem;
    line-height: 1.5;
    font-style: italic;
}

.spoiler-note {
    margin-top: 2.4rem;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    font-size: .9rem;
    color: var(--ash);
    font-style: italic;
}

.pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
    border-top: 1px solid var(--line);
    padding: 28px 0 56px;
}

    .pager a {
        text-decoration: none;
        color: var(--bone);
        padding: 12px 16px;
        border: 1px solid var(--line-soft);
        background: var(--panel);
        display: flex;
        flex-direction: column;
    }

        .pager a:hover {
            border-color: var(--gold-dim);
        }

    .pager small {
        font-family: var(--f-type);
        font-size: .7rem;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--ash);
    }

    .pager span {
        font-family: var(--f-display);
        font-size: 1.3rem;
    }

    .pager .next {
        text-align: right;
    }

    .pager .all {
        justify-content: center;
        align-items: center;
        font-family: var(--f-type);
        font-size: .78rem;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

/* ---------- 404 ---------- */
.lost {
    min-height: 80vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px var(--gutter);
}

    .lost h1 {
        font-family: var(--f-display);
        font-weight: 400;
        font-size: clamp(3rem, 10vw, 6rem);
        margin: 0;
        color: var(--blood-hi);
    }

    .lost p {
        color: var(--bone-dim);
        font-size: 1.2rem;
    }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .premise {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-side {
        position: static;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 1.02rem;
    }

    .hero {
        min-height: auto;
        display: block;
    }

        .hero picture, .hero img.hero-img {
            position: relative;
            display: block;
            height: auto;
            aspect-ratio: 16 / 10;
        }

        .hero::before {
            background: linear-gradient(0deg, var(--soot) 0%, rgba(12,9,8,0) 30%), linear-gradient(180deg, rgba(12,9,8,.75) 0%, rgba(12,9,8,0) 30%);
            bottom: auto;
            aspect-ratio: 16 / 10;
        }

    .hero-copy {
        margin-top: -18px;
        position: relative;
    }

    .topbar .crumb-text {
        display: none;
    }

    .pager {
        grid-template-columns: 1fr 1fr;
    }

        .pager .all {
            grid-column: 1 / -1;
            order: 3;
        }

    .durability {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
