/* Liberty Free — polished shared styles */

:root {
    --bg: #f6f8ff;
    --bg2: #eef3ff;
    --card: rgba(255, 255, 255, 0.88);
    --card-solid: #ffffff;
    --text: #0f172a;
    --muted: #5b6475;
    --muted-2: #6f7890;
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.16);
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --accent: #2563eb;
    --accent2: #0ea5a4;
    --danger: #ef4444;
    --good: #22c55e;
    --radius: 20px;
    --radius-sm: 14px;
    --maxw: 1180px;
    --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0b1020;
    --bg2: #0f1733;
    --card: rgba(15, 24, 54, 0.88);
    --card-solid: #0f1836;
    --text: #e8ecff;
    --muted: #b7c0dd;
    --muted-2: #c6d0ec;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.20);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.24);
    --accent: #7c5cff;
    --accent2: #2de2e6;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1000px 600px at 14% 0%, color-mix(in oklab, var(--accent) 16%, transparent) 0%, transparent 55%),
        radial-gradient(900px 550px at 86% 8%, color-mix(in oklab, var(--accent2) 14%, transparent) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
    line-height: 1.6;
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: min(var(--maxw), calc(100% - 2rem));
    margin-inline: auto;
}

.section {
    padding: 3rem 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0.75rem;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    z-index: 999;
    box-shadow: var(--shadow-soft);
}

.skip-link:focus {
    left: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: color-mix(in oklab, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 78px;
    padding: 0.9rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    min-width: 0;
}

.brand img {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--card-solid);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.brand-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.brand-title span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.3;
}

/* Nav */

.nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.nav a,
.nav .btn {
    min-height: 46px;
    padding: 0.72rem 1rem;
    border-radius: 12px;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav a:hover {
    background: color-mix(in oklab, var(--card-solid) 86%, transparent);
    color: var(--text);
}

.nav a[aria-current="page"] {
    background: color-mix(in oklab, var(--accent) 12%, var(--card-solid));
    border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--border));
    color: var(--text);
    box-shadow: none;
}

.mobile-only {
    display: none;
}

/* Crisis bar */

.crisis-bar {
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--danger) 12%, var(--bg));
}

.crisis-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.crisis-inner p {
    margin: 0;
}

.crisis-inner strong {
    white-space: nowrap;
}

/* Buttons */

.btn {
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--card-solid) 82%, transparent);
    color: var(--text);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.btn:hover {
    transform: translateY(-1px);
    background: color-mix(in oklab, var(--accent) 8%, var(--card-solid));
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 24px color-mix(in oklab, var(--accent) 32%, transparent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 30px color-mix(in oklab, var(--accent) 40%, transparent);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: color-mix(in oklab, var(--accent) 6%, transparent);
    color: var(--text);
}

.icon {
    line-height: 1;
}

/* Common blocks */

.card {
    background: color-mix(in oklab, var(--card-solid) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-soft);
}

.lead {
    font-size: 1.08rem;
    line-height: 1.75;
    color: var(--muted);
    max-width: 68ch;
}

.muted {
    color: var(--muted);
}

.grad {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.pill {
    font-size: 0.78rem;
    padding: 0.28rem 0.62rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: color-mix(in oklab, var(--card-solid) 84%, transparent);
}

.pill.good {
    background: color-mix(in oklab, var(--good) 14%, transparent);
    border-color: color-mix(in oklab, var(--good) 22%, var(--border));
    color: var(--text);
}

/* Grid / cards */

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in oklab, var(--card-solid) 94%, transparent);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--accent2) 35%, var(--border));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.item h3 {
    margin: 0.1rem 0 0.55rem;
    font-size: 1.15rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.item p {
    margin: 0.2rem 0 1rem;
    color: var(--muted);
    line-height: 1.7;
}

/* Polished generated cards */

.item-polished {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-height: 100%;
}

.item-polished.is-featured {
    border-color: color-mix(in oklab, var(--accent) 28%, var(--border));
    box-shadow: 0 16px 36px color-mix(in oklab, var(--accent) 10%, transparent);
}

.item-body {
    display: grid;
    gap: 0.85rem;
}

.item-body .meta {
    margin-bottom: 0;
}

.item-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: -0.1rem;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.32rem 0.62rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in oklab, var(--card-solid) 86%, transparent);
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: auto;
    padding-top: 0.2rem;
}

.card-actions .btn {
    min-width: 140px;
}

.video .card-actions {
    padding-top: 0.1rem;
}

.video .item-body {
    gap: 0.9rem;
}

/* Hero */

.hero {
    padding: 3.5rem 0 3rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
    gap: 1.35rem;
    align-items: start;
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    max-width: 12ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.2rem 0 0.35rem;
}

/* Toolbar / filters */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.4rem 0 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in oklab, var(--card-solid) 90%, transparent);
    box-shadow: var(--shadow-soft);
}

.search {
    flex: 1 1 320px;
}

.search input,
.filters select,
.form input,
.form textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--card-solid) 96%, transparent);
    color: var(--text);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search input::placeholder,
.form input::placeholder,
.form textarea::placeholder {
    color: color-mix(in oklab, var(--muted) 82%, white);
}

.search input:focus,
.filters select:focus,
.form input:focus,
.form textarea:focus {
    border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
    background: var(--card-solid);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

/* Shared section headings */

.section-heading {
    margin-bottom: 1.15rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.section-heading h2,
.contact-card h2 {
    margin: 0 0 0.45rem;
    font-size: 1.9rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Directory pages */

.directory-page {
    padding-top: 3rem;
}

.page-hero {
    padding: 1.75rem;
    margin-bottom: 1rem;
}

.page-hero .section-heading {
    margin-bottom: 0.9rem;
}

.page-title {
    margin: 0 0 0.55rem;
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0;
}

.page-hero .meta {
    margin-bottom: 0;
}

.directory-controls .section-heading,
.directory-results .section-heading {
    margin-bottom: 0.9rem;
}

.directory-controls .toolbar {
    margin-top: 0;
}

.directory-results {
    padding-top: 1rem;
}

.directory-results h2,
.directory-controls h2 {
    margin: 0 0 0.35rem;
}

.directory-controls p,
.directory-results p {
    margin: 0;
}

.result-pill strong {
    font-weight: 700;
}

.empty-state {
    margin-top: 1rem;
}

.empty-state h2 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.empty-state p {
    margin: 0;
}

/* About page */

.about-page {
    padding-top: 3.25rem;
}

.about-stack {
    display: grid;
    gap: 1rem;
}

.about-intro {
    padding: 1.75rem;
}

.about-intro h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.about-intro p {
    margin: 0 0 1.1rem;
}

.about-intro p:last-child {
    margin-bottom: 0;
}

.contact-card {
    padding: 1.6rem;
}

.form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.form label {
    display: block;
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.form textarea {
    min-height: 180px;
    resize: vertical;
    padding-top: 0.95rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.form-note {
    margin: 0;
    max-width: 44ch;
    font-size: 0.92rem;
    color: var(--muted);
}

/* Quick start / stacked cards */

.stack {
    display: grid;
    gap: 0.85rem;
}

.link-card {
    text-decoration: none;
}

.link-card h3 {
    margin-bottom: 0.35rem;
}

.link-card p {
    margin-bottom: 0;
}

.note-card {
    margin-top: 1rem;
    padding: 1rem 1rem 0.95rem;
}

.note-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.note-card p {
    margin: 0;
    font-size: 0.94rem;
}

/* Video cards */

.ratio {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
    margin: 0.75rem 0 1rem;
}

.ratio iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* Mobile menu */

.mobile-menu {
    margin: 0 0 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in oklab, var(--card-solid) 95%, transparent);
    box-shadow: var(--shadow-soft);
}

.mobile-menu:not([hidden]) {
    display: grid;
    gap: 0.6rem;
    animation: mobileMenuIn 0.18s ease;
}

.mobile-menu a,
.mobile-menu button {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--card-solid) 98%, transparent);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.mobile-menu a:hover {
    background: color-mix(in oklab, var(--accent) 7%, var(--card-solid));
}

.mobile-menu a[aria-current="page"] {
    border-color: color-mix(in oklab, var(--accent) 24%, var(--border));
    background: color-mix(in oklab, var(--accent) 10%, var(--card-solid));
}

@keyframes mobileMenuIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */

.footer {
    border-top: 1px solid var(--border);
    padding: 1.4rem 0 2rem;
    color: var(--muted);
    text-align: center;
}

/* Responsive */

@media (max-width: 980px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(var(--maxw), calc(100% - 1rem));
    }

    .section {
        padding: 2rem 0;
    }

    .directory-page {
        padding-top: 2rem;
    }

    .header-inner {
        align-items: flex-start;
        min-height: auto;
    }

    .brand {
        align-items: flex-start;
        gap: 0.75rem;
        max-width: calc(100% - 110px);
    }

    .brand img {
        width: 50px;
        height: 50px;
    }

    .brand-title strong {
        font-size: 1rem;
    }

    .brand-title span {
        font-size: 0.88rem;
    }

    .nav {
        display: none;
    }

    .mobile-only {
        display: inline-flex;
    }

    #mobileMenuBtn {
        min-width: 96px;
    }

    .crisis-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding-top: 2.25rem;
        padding-bottom: 2.5rem;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .filters > * {
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .card,
    .item,
    .about-intro,
    .contact-card,
    .page-hero {
        padding: 1.15rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .hero h1,
    .about-intro h1,
    .page-title {
        font-size: 2rem;
    }

    .btn,
    .mobile-menu a {
        font-size: 0.98rem;
    }

    .search input,
    .filters select,
    .form input,
    .form textarea {
        padding: 0.82rem 0.9rem;
    }
}