/* ==========================================================================
   Courageous Victors — design system
   Trauma-informed: calm palette, generous space, high contrast, no motion
   that can't be turned off. Served directly (no build step required).
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
    /* Plum — dignity, depth. Primary brand colour. */
    --plum-900: #2a1526;
    --plum-800: #381c33;
    --plum-700: #4a2545;
    --plum-600: #5e3159;
    --plum-500: #7a4470;
    --plum-100: #efe3ec;

    /* Sand — warmth, breathing room. */
    --sand-50: #fdfbf7;
    --sand-100: #f7f2ea;
    --sand-200: #efe6d8;
    --sand-300: #e0d2bd;

    /* Sage — growth, steadiness. Accent only. */
    --sage-700: #4e6155;
    --sage-600: #63796a;
    --sage-500: #7c9082;
    --sage-100: #e6ece6;

    /* Ink */
    --ink: #241c22;
    --ink-soft: #4a3f47;
    --ink-muted: #6b5f68;

    --white: #fff;

    --font-display: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino,
        Georgia, "Times New Roman", serif;
    --font-body: "Karla", ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Fluid type scale */
    --step--1: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
    --step-0: clamp(1.0625rem, 1rem + 0.28vw, 1.1875rem);
    --step-1: clamp(1.25rem, 1.16rem + 0.42vw, 1.5rem);
    --step-2: clamp(1.5rem, 1.34rem + 0.78vw, 2rem);
    --step-3: clamp(1.875rem, 1.6rem + 1.35vw, 2.75rem);
    --step-4: clamp(2.25rem, 1.75rem + 2.4vw, 4rem);

    --space-xs: 0.5rem;
    --space-sm: 0.875rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: clamp(4rem, 9vw, 7rem);

    --radius-sm: 6px;
    --radius: 14px;

    --shadow-sm: 0 1px 2px rgb(42 21 38 / 6%), 0 4px 12px rgb(42 21 38 / 5%);
    --shadow: 0 2px 4px rgb(42 21 38 / 6%), 0 12px 32px rgb(42 21 38 / 8%);

    --container: 70rem;
    --measure: 38rem;
}

/* --- Reset ---------------------------------------------------------------- */

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Offset for the sticky safety bar when jumping to an anchor. */
    scroll-padding-top: 6rem;
}

body {
    background: var(--sand-50);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--plum-800);
    text-wrap: balance;
}

p,
li {
    text-wrap: pretty;
}

a {
    color: var(--plum-600);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--plum-800);
}

button {
    font: inherit;
    color: inherit;
}

/* One consistent, highly visible focus ring everywhere. */
:focus-visible {
    outline: 3px solid var(--plum-500);
    outline-offset: 3px;
    border-radius: 3px;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Layout primitives ---------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section {
    padding-block: var(--space-2xl);
}

.section--tight {
    padding-block: var(--space-xl);
}

.section--sand {
    background: var(--sand-100);
}

.section--plum {
    background: var(--plum-800);
    color: var(--sand-100);
}

.section--plum h2,
.section--plum h3 {
    color: var(--sand-50);
}

.section--plum a {
    color: var(--sand-200);
}

/* Readable line length for body copy. */
.prose {
    max-width: var(--measure);
}

.prose p + p {
    margin-top: 1.1em;
}

.prose--wide {
    max-width: 46rem;
}

.skip-link {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -120%);
    z-index: 100;
    background: var(--plum-800);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    transform: translate(-50%, 0);
    color: var(--white);
}

/* --- Type helpers --------------------------------------------------------- */

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sage-700);
    margin-bottom: var(--space-sm);
}

.section--plum .eyebrow {
    color: var(--sand-300);
}

.h2 {
    font-size: var(--step-3);
}

.lede {
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--ink-soft);
}

.section--plum .lede {
    color: var(--sand-200);
}

.muted {
    color: var(--ink-muted);
}

.small {
    font-size: var(--step--1);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    /* 48px min target on every button. */
    min-height: 3rem;
    padding: 0.75rem 1.6rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease,
        border-color 0.18s ease, transform 0.18s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn.btn--primary {
    background: var(--plum-700);
    color: var(--sand-50);
}

.btn.btn--primary:hover {
    background: var(--plum-800);
    color: var(--white);
}

.btn.btn--secondary {
    background: transparent;
    border-color: var(--plum-700);
    color: var(--plum-700);
}

.btn.btn--secondary:hover {
    background: var(--plum-100);
    color: var(--plum-800);
}

.btn.btn--onplum {
    background: var(--sand-100);
    color: var(--plum-800);
}

.btn.btn--onplum:hover {
    background: var(--white);
    color: var(--plum-900);
}

.btn.btn--ghost-onplum {
    background: transparent;
    border-color: rgb(247 242 234 / 45%);
    color: var(--sand-100);
}

.btn.btn--ghost-onplum:hover {
    background: rgb(247 242 234 / 12%);
    color: var(--white);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.btn-row--center {
    justify-content: center;
}

/* --- Crisis bar ----------------------------------------------------------- */
/* Sticky so the lifeline number is reachable from anywhere on the page. */

.safety-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--plum-900);
    color: var(--sand-200);
    font-size: var(--step--1);
    border-bottom: 1px solid rgb(247 242 234 / 12%);
}

.safety-bar__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: 3rem;
    padding-block: 0.4rem;
}

.safety-bar__crisis {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.safety-bar__crisis a {
    color: var(--sand-50);
    font-weight: 700;
    white-space: nowrap;
}

.safety-bar__label {
    color: var(--sand-300);
}

/* On narrow phones, drop the trailing description so the prompt and the
   number stay together on one line. */
@media (width <= 34rem) {
    .safety-bar__crisis > .safety-bar__label:last-child {
        display: none;
    }
}

/* --- Masthead + navigation ------------------------------------------------ */

.masthead {
    background: var(--sand-100);
    border-bottom: 1px solid var(--sand-200);
}

.masthead__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-block: var(--space-sm);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--plum-800);
}

.brand img {
    width: 44px;
    height: auto;
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand__tag {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sage-700);
    margin-top: 0.2rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.nav__link:hover {
    background: var(--sand-200);
    color: var(--plum-800);
}

.nav__link[aria-current="page"] {
    color: var(--plum-800);
    box-shadow: inset 0 -2px 0 var(--sage-500);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav__donate {
    margin-left: 0.4rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.95rem;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: 1.5px solid var(--sand-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--plum-800);
    cursor: pointer;
}

.nav-toggle__bars {
    display: grid;
    gap: 4px;
    width: 18px;
}

.nav-toggle__bars span {
    display: block;
    height: 2px;
    background: currentcolor;
    border-radius: 2px;
}

@media (width <= 62rem) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        position: absolute;
        inset-inline: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-sm);
        background: var(--sand-50);
        border-bottom: 1px solid var(--sand-200);
        box-shadow: var(--shadow);
        z-index: 50;
    }

    .nav.is-open {
        display: flex;
    }

    .masthead__inner {
        position: relative;
    }

    .nav__link {
        min-height: 3rem;
        font-size: 1.05rem;
    }

    .nav__donate {
        margin-left: 0;
        margin-top: var(--space-xs);
    }
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
    position: relative;
    background:
        radial-gradient(
            80rem 40rem at 15% -10%,
            rgb(122 68 112 / 10%) 0%,
            transparent 60%
        ),
        linear-gradient(180deg, var(--sand-100) 0%, var(--sand-50) 100%);
    padding-block: clamp(3.5rem, 8vw, 6.5rem);
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    align-items: center;
}

@media (width >= 56rem) {
    .hero__grid {
        grid-template-columns: 1.15fr 0.85fr;
        gap: var(--space-xl);
    }
}

.hero__mark {
    justify-self: center;
    width: min(300px, 70%);
    opacity: 0.92;
}

.hero h1 {
    font-size: var(--step-4);
    margin-bottom: var(--space-md);
}

.hero__lede {
    max-width: 32rem;
}

.hero__acronym {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--sand-300);
    font-size: var(--step--1);
    letter-spacing: 0.02em;
    color: var(--ink-muted);
    max-width: 32rem;
}

.hero__acronym strong {
    color: var(--plum-700);
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
}

/* --- Interior page header ------------------------------------------------- */

.page-hero {
    background:
        radial-gradient(
            60rem 30rem at 85% -20%,
            rgb(124 144 130 / 18%) 0%,
            transparent 60%
        ),
        linear-gradient(180deg, var(--sand-100) 0%, var(--sand-50) 100%);
    padding-block: clamp(3rem, 7vw, 5rem);
    border-bottom: 1px solid var(--sand-200);
}

.page-hero h1 {
    font-size: var(--step-3);
    max-width: 20ch;
}

.page-hero .lede {
    max-width: 42rem;
    margin-top: var(--space-md);
}

/* --- Cards ---------------------------------------------------------------- */

.grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* Columns of unequal length shouldn't stretch a card to match its neighbour. */
.grid--top {
    align-items: start;
}

.card {
    background: var(--white);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.card h3 {
    font-size: var(--step-1);
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--ink-soft);
}

.card--step {
    position: relative;
    padding-top: calc(var(--space-md) + 0.5rem);
}

.card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: var(--space-sm);
    background: var(--sage-100);
    color: var(--sage-700);
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.section--plum .card {
    background: rgb(247 242 234 / 7%);
    border-color: rgb(247 242 234 / 15%);
    box-shadow: none;
}

.section--plum .card p {
    color: var(--sand-200);
}

/* --- Content notice ------------------------------------------------------- */
/* Used ahead of pages describing the effects of abuse, so nobody is caught
   off guard by difficult material. */

.notice {
    display: flex;
    gap: var(--space-sm);
    max-width: 46rem;
    padding: var(--space-md);
    background: var(--sage-100);
    border-left: 4px solid var(--sage-600);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--ink-soft);
    font-size: var(--step--1);
}

.notice strong {
    color: var(--sage-700);
}

/* --- Quote ---------------------------------------------------------------- */

.quote {
    max-width: 44rem;
    margin-inline: auto;
    text-align: center;
}

.quote blockquote {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-style: italic;
    line-height: 1.4;
    color: var(--plum-700);
}

.section--plum .quote blockquote {
    color: var(--sand-50);
}

.quote cite {
    display: block;
    margin-top: var(--space-md);
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sage-700);
}

.section--plum .quote cite {
    color: var(--sand-300);
}

/* --- Lists ---------------------------------------------------------------- */

.list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--space-sm);
}

.list li {
    position: relative;
    padding-left: 1.9rem;
    color: var(--ink-soft);
}

.list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: var(--sage-500);
}

.list li strong {
    color: var(--plum-700);
    font-family: var(--font-display);
    font-weight: 600;
}

.section--plum .list li {
    color: var(--sand-200);
}

.section--plum .list li strong {
    color: var(--sand-50);
}

.section--plum .list li::before {
    background: var(--sand-300);
}

/* --- Founder -------------------------------------------------------------- */

.founder {
    display: grid;
    gap: var(--space-lg);
    align-items: start;
}

@media (width >= 52rem) {
    .founder {
        grid-template-columns: 16rem 1fr;
        gap: var(--space-xl);
    }
}

.founder__portrait {
    width: min(16rem, 60%);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 999px;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

@media (width >= 52rem) {
    .founder__portrait {
        width: 100%;
        position: sticky;
        top: 6rem;
    }
}

.founder__name {
    font-size: var(--step-3);
}

.founder__role {
    font-weight: 700;
    color: var(--sage-700);
    letter-spacing: 0.02em;
}

/* --- Donate --------------------------------------------------------------- */

.donate {
    background: var(--plum-800);
    color: var(--sand-100);
}

.donate h2 {
    color: var(--sand-50);
}

/* The donate band sits on plum, so its supporting text needs the light scale. */
.donate .eyebrow {
    color: var(--sand-300);
}

.donate .lede {
    color: var(--sand-200);
}

.donate__grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    margin-top: var(--space-lg);
}

.donate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--sand-50);
    border-radius: var(--radius);
    text-align: center;
    color: var(--ink);
}

.donate-card h3 {
    font-size: var(--step-1);
    color: var(--plum-800);
}

.donate-card__qr {
    width: 100%;
    max-width: 190px;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--white);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

.donate-card .btn {
    width: 100%;
    margin-top: auto;
}

.donate__note {
    margin-top: var(--space-lg);
    font-size: var(--step--1);
    color: var(--sand-200);
    max-width: 42rem;
}

.donate__note a {
    color: var(--sand-50);
    font-weight: 700;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
    margin-top: auto;
    background: var(--plum-900);
    color: var(--sand-200);
    padding-block: var(--space-xl) var(--space-lg);
    font-size: var(--step--1);
}

.site-footer a {
    color: var(--sand-50);
}

.site-footer h2,
.site-footer h3 {
    color: var(--sand-50);
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.site-footer__grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.site-footer__brand img {
    width: 60px;
    /* Logo art is solid black with transparency — invert to read on plum. */
    filter: invert(1);
    opacity: 0.9;
    margin-bottom: var(--space-sm);
}

.site-footer__motto {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--sand-100);
}

.footer-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.footer-list a {
    display: inline-block;
    min-height: 1.9rem;
}

.crisis {
    padding: var(--space-md);
    background: rgb(247 242 234 / 8%);
    border: 1px solid rgb(247 242 234 / 18%);
    border-radius: var(--radius);
}

.crisis strong {
    display: block;
    font-size: 1.4rem;
    font-family: var(--font-display);
    color: var(--sand-50);
}

.site-footer__bottom {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgb(247 242 234 / 15%);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    justify-content: space-between;
    color: var(--sand-300);
}

/* --- Print ---------------------------------------------------------------- */

@media print {
    .safety-bar,
    .nav,
    .nav-toggle,
    .donate__grid {
        display: none !important;
    }

    body {
        background: #fff;
    }
}
