:root {
    --bg: #f3eee6;
    --bg-2: #ebe4d8;
    --paper: #fffaf3;
    --ink: #171411;
    --ink-soft: #5e574d;
    --muted: #8a8174;
    --line: #e4d9c8;
    --line-strong: #d4c7b2;
    --accent: #c45c26;
    --accent-2: #1e4a42;
    --accent-3: #c9a66b;
    --ok: #2f6f4e;
    --warn: #b45309;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(23, 20, 17, 0.08);
    --shadow-sm: 0 8px 24px rgba(23, 20, 17, 0.06);
    --radius: 22px;
    --radius-sm: 14px;
    --nav-h: 76px;
    --font-display: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    --bg: #12100e;
    --bg-2: #1a1714;
    --paper: #1c1916;
    --ink: #f4efe6;
    --ink-soft: #c9c0b2;
    --muted: #9a9184;
    --line: #2c271f;
    --line-strong: #3d362c;
    --accent: #e07a5f;
    --accent-2: #7dbaa8;
    --accent-3: #d4b483;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    padding-top: var(--nav-h);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4000;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 0.5em;
}

.grow { flex: 1; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.check input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.wrap { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.wrap-narrow { width: min(780px, calc(100% - 2rem)); margin-inline: auto; }

.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s;
}
.site-nav.is-scrolled {
    border-bottom-color: var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.site-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1180px, calc(100% - 2rem));
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}
.brand img, .brand-mark {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-strong);
}
.brand-mark {
    display: grid;
    place-items: center;
    background: var(--accent-2);
    color: #f4efe6;
    font-family: var(--font-display);
    font-size: 0.9rem;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 1.05rem; font-weight: 700; }
.brand-copy span { font-size: 0.78rem; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 0.15rem; }
.nav-links a, .nav-links button.linkish {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.nav-cta { display: flex; align-items: center; gap: 0.5rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.75rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, color 0.25s;
    background: var(--ink);
    color: var(--paper);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn-accent { background: var(--accent); color: #fffaf3; }
.btn-pine { background: var(--accent-2); color: #f4efe6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.icon-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.nav-toggle { display: none; }

.hero {
    position: relative;
    padding: 2.4rem 0 2rem;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 3rem;
    align-items: center;
}
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.hero h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    margin-bottom: 0.75rem;
}
.hero h1 em {
    font-style: normal;
    color: var(--accent);
    font-weight: 700;
}
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 38rem; margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.stat-stack { display: grid; gap: 0.9rem; }
.stat-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.3rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.stat-card i {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--accent) 12%, var(--paper));
    color: var(--accent);
}
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.6rem; }
.stat-card span { color: var(--muted); font-size: 0.85rem; }

.section { padding: 1.5rem 0 4rem; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.section-head h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin: 0; }
.section-head p { color: var(--muted); margin: 0.35rem 0 0; }

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.85fr);
    gap: 1.75rem;
    align-items: start;
}

.story {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.story-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.person { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent-2);
    color: #f4efe6;
    display: grid; place-items: center;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person strong { display: block; font-size: 0.95rem; }
.meta { color: var(--muted); font-size: 0.82rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }
.story h3 { font-size: 1.25rem; margin: 0 0 0.8rem; }
.story-media {
    border-radius: 18px;
    overflow: hidden;
    margin: 0.4rem 0 1rem;
    background: var(--bg-2);
}
.story-media img { width: 100%; height: 280px; object-fit: cover; }
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.gallery img, .gallery .more {
    height: 110px;
    object-fit: cover;
    width: 100%;
    border-radius: 12px;
}
.gallery .more {
    position: relative;
    display: grid; place-items: center;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
}
.excerpt { color: var(--ink-soft); margin-bottom: 1.1rem; }
.story-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--bg);
}

.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1.35rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow-sm);
}
.panel h4 { margin-bottom: 0.7rem; font-size: 1.15rem; }
.panel p { color: var(--ink-soft); margin: 0 0 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips a {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: 0.85rem;
}
.chips a:hover, .chips a.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cause {
    display: grid;
    gap: 0.7rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.cause:last-child { border: 0; margin: 0; padding: 0; }
.cause img { width: 100%; height: 120px; object-fit: cover; border-radius: 14px; }
.bar { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

.action-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}
.action-row:last-child { border: 0; }
.action-ico {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--bg);
    color: var(--accent);
}

.empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--paper);
    border: 1px dashed var(--line-strong);
    border-radius: 28px;
}
.empty h3 { font-size: 1.8rem; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 3rem 0 2rem;
    margin-top: 2rem;
    color: var(--ink-soft);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.site-footer h5 { color: var(--ink); margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.35rem 0; }
.legal { border-top: 1px solid var(--line); padding-top: 1rem; font-size: 0.85rem; color: var(--muted); }

.page-hero { padding: 2rem 0 1.25rem; }
.page-hero h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.form-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
label, .label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--ink-soft); }
.field { margin-bottom: 1.1rem; }
.input, select.input, textarea.input {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input:focus {
    border-color: var(--accent);
    background: var(--paper);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input.is-invalid { border-color: var(--danger); }
.hint, .error { font-size: 0.8rem; margin-top: 0.35rem; }
.error { color: var(--danger); }
.dropzone {
    border: 1.5px dashed var(--line-strong);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    background: var(--bg);
    cursor: pointer;
}
.dropzone.has-file { border-style: solid; border-color: var(--ok); }

.alert {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    background: var(--paper);
}
.alert-ok { background: color-mix(in srgb, var(--ok) 10%, var(--paper)); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.alert-bad { background: color-mix(in srgb, var(--danger) 10%, var(--paper)); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.alert-warn { background: color-mix(in srgb, var(--warn) 10%, var(--paper)); }

.article { background: var(--paper); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-sm); }
.article-hero { width: 100%; height: min(52vw, 420px); object-fit: cover; }
.article-body { padding: 2rem; }
.article-body h1 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); }
.prose { font-size: 1.08rem; color: var(--ink-soft); white-space: pre-wrap; }
.video { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; margin: 1rem 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.comment { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border: 0; }

.list-card {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: 0.8rem;
}
.thumb, .thumb-ph {
    width: 84px; height: 84px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--accent-2);
    color: #fff;
    display: grid; place-items: center;
}

.file-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: 0.75rem;
}
.file-ico {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--bg);
    color: var(--accent);
    font-size: 1.25rem;
}

.cause-card { overflow: hidden; padding: 0; }
.cause-card img { width: 100%; height: 180px; object-fit: cover; }
.cause-card .inner { padding: 1.2rem; }

.badge {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-2);
}
.badge-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge-accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(23, 20, 17, 0.46);
    display: none;
    place-items: center;
    padding: 1rem;
    z-index: 80;
}
.modal.is-open { display: grid; }
.modal-card {
    width: min(640px, 100%);
    background: var(--paper);
    border-radius: 24px;
    padding: 1.5rem;
    max-height: 90vh;
    overflow: auto;
}

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.86); display: none; place-items: center; z-index: 90; padding: 1rem; }
.lightbox.is-open { display: grid; }
.lightbox img { max-height: 86vh; border-radius: 12px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.45rem 0.25rem 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
}
.user-chip .avatar { width: 32px; height: 32px; font-size: 0.75rem; }

.mobile-drawer {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--bg);
    z-index: 40;
    padding: 1.25rem;
    overflow: auto;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer a, .mobile-drawer button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.9rem 0.2rem;
    border: 0;
    background: none;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
}

.to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 0;
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 30;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1.5rem; }

@media (max-width: 900px) {
    .hero-grid, .layout, .footer-grid, .list-card, .cards-2 { grid-template-columns: 1fr; }
    .nav-links, .nav-cta .ghost-hide { display: none; }
    .nav-toggle { display: grid; }
    .hero { padding-top: 2.4rem; }
    .list-card { grid-template-columns: 72px 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .file-row { grid-template-columns: auto 1fr; }
}
@media (max-width: 640px) {
    .hero-actions, .story-foot { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .nav-cta .btn { width: auto; }
    .gallery { grid-template-columns: 1fr 1fr; }
}
