/* ==========================================================================
   Samunnati For All Foundation — style.css
   Mirrors the supplied design file: same colours, type scale, spacing,
   breakpoints (860 / 800 / 760 / 700 / 560 / 460px) and light/dark themes.
   Layout uses Bootstrap rows and columns; gutters are set per section.
   ========================================================================== */

/* ---------- 1. Theme tokens (from the design) ---------- */
:root {
    --paper: #F1F3F0;
    --ink: #0F1F4B;
    --soft: #4A5573;
    --sun: #F29B2E;
    --leaf: #1E8E8A;
    --rule: #C9CFD6;
    --panel: #E3E8EC;
    --night: #0F1F4B;
    --onnight: #F1F3F0;

    --serif: Newsreader, Georgia, serif;
    --sans: Figtree, system-ui, sans-serif;
    --sans-label: Figtree, sans-serif;
    --ease: cubic-bezier(.22, .61, .36, 1);

    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #0B1636; --ink: #EEF1F6; --soft: #AAB4CC; --rule: #2A3860;
        --panel: #13214A; --night: #060D24; --onnight: #EEF1F6;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --paper: #0B1636; --ink: #EEF1F6; --soft: #AAB4CC; --rule: #2A3860;
    --panel: #13214A; --night: #060D24; --onnight: #EEF1F6;
    color-scheme: dark;
}

/* ---------- 2. Base (also neutralises Bootstrap reboot where it differs) ---------- */
html {
    scroll-padding-top: env(safe-area-inset-top, 0px);
    scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--sans);
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.08;
    margin: 0;
    letter-spacing: -.01em;
    color: inherit;
}
h2 { font-size: clamp(2rem, 5vw, 3.4rem); }

p { margin: 0 0 1em; max-width: 62ch; }

a, a:hover { color: inherit; }

img { max-width: 100%; }

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

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Bootstrap container → design wrapper (max 1120px, fluid below) */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: clamp(1.1rem, 4vw, 2.5rem);
    padding-right: clamp(1.1rem, 4vw, 2.5rem);
}

section { padding: clamp(3rem, 8vw, 6rem) 0; }

.intro { margin-top: 1rem; }
.soft { color: var(--soft); }
.tbd { color: var(--soft); font-style: italic; }

.ph-tag {
    display: inline-block;
    font: 600 .75rem var(--sans-label);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--soft);
    border: 1px dashed var(--soft);
    padding: .2rem .6rem;
    margin-bottom: 1rem;
}

/* ---------- 3. Logo mark ---------- */
.logo-mark {
    width: 44px;
    height: 44px;
    color: var(--ink);
    --s: var(--sun);
    --l: var(--leaf);
}

/* ---------- 4. Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding-top: env(safe-area-inset-top, 0px);
}
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    text-decoration: none;
    font-family: var(--serif);
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    line-height: 1.05;
}
.brand small {
    display: block;
    font: 600 clamp(.72rem, 1.6vw, .85rem) var(--sans-label);
    letter-spacing: .16em;
    color: var(--soft);
    margin-top: .2rem;
}
.brand .logo-mark { width: clamp(58px, 8vw, 76px); height: clamp(58px, 8vw, 76px); }

/* Bootstrap navbar reset → design header */
.site-header .navbar { padding: 0; }
.site-header .navbar > .container { flex-wrap: wrap; }

/* Links: one row on desktop, never a scrollbar */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .2rem 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .95rem;
}
.main-nav a {
    display: block;
    text-decoration: none;
    white-space: nowrap;
    padding: .4rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color .25s var(--ease);
}
.main-nav a:hover { border-color: var(--sun); }
.main-nav a[aria-current="page"] { border-color: var(--sun); }

/* Desktop: give the header row enough width for all nine links */
@media (min-width: 1200px) {
    .site-header .container { max-width: 1320px; }
    .site-header .navbar > .container { flex-wrap: nowrap; }
    .site-header .brand { flex-shrink: 0; }
    .site-header .navbar-collapse { flex-grow: 1; justify-content: flex-end; }
    .main-nav { gap: .2rem 1.15rem; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .main-nav { gap: .2rem .7rem; font-size: .87rem; }
}

/* Hamburger button (tablet & mobile) */
.nav-toggle {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 2px;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.nav-toggle:focus { box-shadow: none; }
.nav-toggle:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Tablet & mobile: links drop down as a vertical list */
@media (max-width: 1199.98px) {
    .site-header .navbar-collapse { flex-basis: 100%; }
    .main-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        margin-top: .7rem;
        border-top: 1px solid var(--rule);
        font-size: 1rem;
    }
    .main-nav a { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
    .main-nav li:last-child a { border-bottom: 0; }
    .main-nav a:hover { border-bottom-color: var(--rule); color: var(--leaf); }
}

/* ---------- 5. Grid helpers (design breakpoints on Bootstrap columns) ---------- */
.gutter-hero,
.gutter-cols { --g: clamp(1.5rem, 5vw, 4rem); --bs-gutter-x: var(--g); --bs-gutter-y: var(--g); }

/* Unequal splits use the design's fr ratios exactly: (row − 2·gutter) × ratio + gutter */
@media (min-width: 861px) {
    /* 1.5fr / 1fr — the text column never shrinks below its longest word, like the design's grid */
    .col-hero-text   { flex: 1.5 1 0; min-width: min-content; }
    .col-hero-emblem { flex: 1 1 0; }
    .gutter-cols > .col-third      { flex: 0 0 auto; width: calc((100% - 2 * var(--g)) / 3 + var(--g)); }
    .gutter-cols > .col-two-thirds { flex: 0 0 auto; width: calc((100% - 2 * var(--g)) * 2 / 3 + var(--g)); }
    .col-third { flex: 0 0 auto; width: 33.333333%; }
}
@media (min-width: 701px) {
    .col-pair { flex: 0 0 auto; width: 50%; }
}
@media (min-width: 801px) {
    .col-third-800 { flex: 0 0 auto; width: 33.333333%; }
    .col-half-800  { flex: 0 0 auto; width: 50%; }
}

/* ---------- 6. Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.btn-site {
    display: inline-block;
    padding: .85rem 1.4rem;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--ink);
    border-radius: 2px;
    transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn-site.fill { background: var(--ink); color: var(--paper); }
.btn-site:hover { background: var(--sun); border-color: var(--sun); color: #0F1F4B; }
.btn-site[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- 7. Hero ---------- */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero h1 { font-size: clamp(3rem, 9.5vw, 7.2rem); font-weight: 600; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--leaf); }
.hero .lede { font-size: 1.2rem; margin-top: 1.6rem; color: var(--soft); }

.emblem {
    background: var(--night);
    color: var(--onnight);
    padding: 2rem;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.emblem .logo-mark {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    flex: 1;
    min-height: 0;
    color: var(--onnight);
}
.emblem p { font-family: 'Noto Serif Devanagari', Newsreader, serif; font-size: 1.5rem; margin: 0; }
.emblem span { font: italic 1.1rem var(--serif); color: var(--sun); }

.byline {
    margin-top: 3rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 0;
    color: var(--soft);
    font-size: .98rem;
}

/* ---------- 8. Why we exist ---------- */
.essentials {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}
.pair { --bs-gutter-x: 2rem; --bs-gutter-y: 2rem; margin-top: -1em; }
.pair h3 { font-size: 1.6rem; margin-bottom: .5rem; color: var(--leaf); }

/* ---------- 8b. Co-founders ---------- */
.founders { border-top: 1px solid var(--rule); }
.duo {
    --bs-gutter-x: clamp(1.5rem, 4vw, 3rem);
    --bs-gutter-y: clamp(1.5rem, 4vw, 3rem);
    margin-top: calc(2.5rem - 1em - var(--bs-gutter-y));
}
.person {
    height: 100%;
    background: var(--panel);
    border-top: 3px solid var(--leaf);
    padding: clamp(1.3rem, 3vw, 2rem);
    display: flow-root;
}
.person img {
    float: left;
    width: 180px;
    height: 225px;
    object-fit: cover;
    border-radius: 3px;
    margin: .3rem 1.5rem 1rem 0;
}
@media (max-width: 520px) {
    .person img { float: none; vertical-align: baseline; width: 100%; max-width: 280px; height: auto; margin: 0 0 1.2rem; }
}
.person h3 { font-size: 1.9rem; }
.person .role {
    font: 600 .85rem var(--sans-label);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--leaf);
    margin: .35rem 0 1rem;
}
.person .focus {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.4;
    border-left: 3px solid var(--sun);
    padding-left: .9rem;
    margin: 1.1rem 0 0;
}
.person .focus + p { margin-top: 1.1rem; }
.person .facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .35rem 1rem;
    font-size: .95rem;
    margin-top: 1.1rem;
}
.person .facts span { color: var(--soft); }

/* ---------- 9. Programmes ---------- */
.programmes { background: var(--panel); }
.prog-list { margin-top: 2rem; }
.prog { border-top: 2px solid var(--ink); padding: 1.4rem 0; }
.col-prog-body { margin-top: 1rem; }
@media (min-width: 761px) {
    .col-prog-title { flex: 0 0 auto; width: calc((100% - 3rem) / 3); }
    .col-prog-body  { flex: 0 0 auto; width: calc((100% - 3rem) * 2 / 3); margin-top: 0; margin-left: 3rem; }
}
.prog h3 { font-size: 1.9rem; }
.prog h3 small {
    display: block;
    font: 600 .85rem var(--sans-label);
    color: var(--leaf);
    margin-top: .35rem;
    letter-spacing: .02em;
}
.art { display: block; width: 100%; max-width: 340px; height: auto; margin-top: 1.1rem; border-radius: 4px; }
.cap { font-size: .9rem; color: var(--soft); margin: .5rem 0 0; max-width: 340px; }
@media (max-width: 760px) { .art, .cap { max-width: 100%; } }
.prog ul { margin: .5rem 0; padding-left: 1.1rem; color: var(--soft); }
.prog li { margin: .25rem 0; max-width: 62ch; }
.prog .note { font-style: italic; color: var(--soft); font-size: .95rem; }

/* ---------- 10. Activities ---------- */
.done { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; margin-top: calc(2rem - 1em - var(--bs-gutter-y)); }
.card-box { height: 100%; border: 2px dashed var(--rule); padding: 1.3rem; }
.card-box h3 { font-size: 1.4rem; margin-bottom: .6rem; }
.card-desc { margin: 1rem 0 0; }

.fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .45rem 1.2rem;
    margin: .8rem 0 0;
    font-size: .97rem;
}
.fields span { color: var(--soft); }
.fields b { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- 11. Gallery ---------- */
.gallery-section { padding-top: 0; }
.gallery { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; margin-top: calc(2rem - 1em - var(--bs-gutter-y)); }
@media (min-width: 461px) { .col-gallery { flex: 0 0 auto; width: 50%; } }
@media (min-width: 761px) { .col-gallery { width: 33.333333%; } }
.tile {
    aspect-ratio: 4 / 3;
    border: 2px dashed var(--rule);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    text-align: center;
    padding: 1rem;
    color: var(--soft);
    font-size: .92rem;
}
.tile-icon {                        /* images/icon-camera.svg, tinted with the text colour */
    width: 34px;
    height: 34px;
    background: currentColor;
    -webkit-mask: url("../images/icon-camera.svg") center / contain no-repeat;
            mask: url("../images/icon-camera.svg") center / contain no-repeat;
}
.tile b { color: var(--ink); font-weight: 600; }
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

/* Photo tiles (home grid + gallery page) */
.gallery-link {
    display: block;
    overflow: hidden;
    background: var(--panel);
}
.gallery-link img { transition: transform .6s var(--ease); }
.gallery-link:hover img,
.gallery-link:focus-visible img { transform: scale(1.04); }
/* In the two-column range an odd last photo fills the row, so no gap is left */
@media (min-width: 461px) and (max-width: 760px) {
    .gallery .col-gallery:last-child:nth-child(odd) { width: 100%; }
}
.view-more { margin-top: 2rem; }
/* Tall photos cropped to 4:3 tiles keep the top (faces) in view */
.gallery .crop-top img { object-position: center 22%; }

/* ---------- 11b. Media coverage ---------- */
.media { background: var(--panel); }
.media-list { margin-top: 2rem; }
.media-item { border-top: 2px solid var(--ink); padding: 1.4rem 0; }
.col-media-body { margin-top: 1.2rem; }
@media (min-width: 761px) {
    .col-media-img  { flex: 0 0 auto; width: calc((100% - 3rem) / 3); }
    .col-media-body { flex: 0 0 auto; width: calc((100% - 3rem) * 2 / 3); margin-top: 0; margin-left: 3rem; }
}
.media-thumb {
    display: block;
    max-width: 340px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--rule);
    background: #fff;
}
.media-thumb img { display: block; width: 100%; height: auto; transition: transform .6s var(--ease); }
.media-thumb:hover img,
.media-thumb:focus-visible img { transform: scale(1.03); }
@media (max-width: 760px) { .media-thumb { max-width: 100%; } }
.media-meta {
    font: 600 .85rem var(--sans-label);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--leaf);
    margin: 0 0 .6rem;
}
.media-item h3 {
    font-family: 'Noto Serif Devanagari', Newsreader, serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.35;
    letter-spacing: 0;
    margin-bottom: 1.4rem;
}

/* ---------- 11c. Gallery page ---------- */
.page-head { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem); }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 600; }
.breadcrumb-nav ol {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.2rem;
    padding: 0;
    list-style: none;
    font-size: .9rem;
    color: var(--soft);
}
.breadcrumb-nav li + li::before { content: "/"; margin-right: .5rem; color: var(--rule); }
.breadcrumb-nav a { text-decoration-color: var(--sun); text-underline-offset: 3px; }
.breadcrumb-nav a:hover { color: var(--leaf); }

.gallery-page { padding-top: 0; }
.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.6rem;
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    font: 600 .92rem var(--sans);
    color: var(--ink);
    background: transparent;
    border: 2px solid var(--ink);
    border-radius: 2px;
    transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.filter-btn:hover { background: var(--sun); border-color: var(--sun); color: #0F1F4B; }
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filter-btn[aria-pressed="true"]:hover { background: var(--sun); border-color: var(--sun); color: #0F1F4B; }
.filter-count { font-weight: 400; opacity: .75; font-size: .85em; }
.masonry-item[hidden] { display: none; }
/* Video tile: poster image with a play button */
.masonry-item.is-video { position: relative; }
.play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(15, 31, 75, .75);
    border: 2px solid rgba(241, 243, 240, .8);
    transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.play-badge svg { width: 26px; height: 26px; fill: #F1F3F0; margin-left: 3px; }
.masonry-item.is-video:hover .play-badge { background: var(--sun); transform: translate(-50%, -50%) scale(1.06); }
.masonry-item.is-video:hover .play-badge svg { fill: #0F1F4B; }
.masonry { column-count: 3; column-gap: 1rem; }
@media (max-width: 760px) { .masonry { column-count: 2; } }
@media (max-width: 460px) { .masonry { column-count: 1; } }
.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}
.masonry-item img { display: block; width: 100%; height: auto; }
.back-home { margin: 1.5rem 0 0; }

/* ---------- 11d. Image viewer (pop-up slider) ---------- */
html.lb-open { overflow: hidden; }
.lightbox {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: clamp(.75rem, 3vw, 2rem);
    border: 0;
    background: transparent;
    color: #F1F3F0;
}
.lightbox[open] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(.5rem, 2vw, 1.5rem);
}
.lightbox::backdrop { background: rgba(6, 13, 36, .95); }
.lb-figure {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lb-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 13rem);
    max-height: calc(100dvh - 13rem);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #0B1636;
    animation: lbFade .35s var(--ease);
    touch-action: pan-y;
}
.lb-video {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 13rem);
    max-height: calc(100dvh - 13rem);
    background: #000;
    animation: lbFade .35s var(--ease);
}
.lb-img[hidden], .lb-video[hidden] { display: none; }
.lb-img[data-dir="next"], .lb-video[data-dir="next"] { animation-name: lbFromRight; }
.lb-img[data-dir="prev"], .lb-video[data-dir="prev"] { animation-name: lbFromLeft; }
.lb-count { margin-top: .8rem; font-size: .9rem; opacity: .8; }

.lb-btn {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #F1F3F0;
    background: rgba(15, 31, 75, .6);
    border: 2px solid rgba(241, 243, 240, .45);
    border-radius: 2px;
    transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.lb-btn:hover { background: var(--sun); border-color: var(--sun); color: #0F1F4B; }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn[hidden] { display: none; }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-close { position: absolute; top: clamp(.75rem, 3vw, 2rem); right: clamp(.75rem, 3vw, 2rem); z-index: 2; }

/* Thumbnail strip */
.lb-thumbs {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: .5rem;
    justify-content: safe center;
    overflow-x: auto;
    padding: .25rem .25rem .4rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(241, 243, 240, .35) transparent;
}
.lb-thumbs[hidden] { display: none; }
.lb-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 2px;
    background: #0B1636;
    opacity: .55;
    overflow: hidden;
    transition: opacity .25s var(--ease), border-color .25s var(--ease);
}
.lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: .9; }
.lb-thumb[aria-current="true"] { opacity: 1; border-color: var(--sun); }
.lb-thumb.is-video { position: relative; }
.lb-thumb.is-video::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 0;
    height: 0;
    transform: translate(-35%, -50%);
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #fff;
}

@media (max-width: 600px) {
    .lightbox[open] { grid-template-columns: minmax(0, 1fr); }
    .lb-figure { grid-column: 1; }
    .lb-prev, .lb-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        width: 42px;
        height: 42px;
    }
    .lb-prev { left: .5rem; }
    .lb-next { right: .5rem; }
    .lb-img { max-height: calc(100dvh - 11rem); }
    .lb-thumb { width: 56px; height: 42px; }
}
@keyframes lbFade      { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lbFromRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes lbFromLeft  { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

/* ---------- 12. Technology ---------- */
.tech { background: var(--night); color: var(--onnight); }
.tech .tag {
    display: inline-block;
    border: 1px solid var(--sun);
    color: var(--sun);
    padding: .25rem .7rem;
    font-size: .9rem;
    margin-bottom: 1.2rem;
}
.tech h2 { max-width: 16ch; }
.tech .intro { margin-top: 1.2rem; }

.steps {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
    margin-top: calc(2.5rem - 1em - var(--bs-gutter-y));
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    counter-reset: s;
}
@media (min-width: 561px) { .col-step { flex: 0 0 auto; width: 50%; } }
@media (min-width: 901px) { .col-step { width: 25%; } }
.step {
    position: relative;
    padding-top: calc(1rem + 3px);   /* 3px sun rule + 1rem, as in the design */
    counter-increment: s;
}
.step::after {                      /* 3px sun rule (draws in on reveal) */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--sun);
}
.step::before {
    content: counter(s);
    font: italic 2.4rem var(--serif);
    color: var(--sun);
    display: block;
    line-height: 1;
}
.step h3 { font-size: 1.35rem; margin: .5rem 0; }
.step p { font-size: .97rem; opacity: .88; }
.care {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(241, 243, 240, .25);
    max-width: 70ch;
}

/* ---------- 13. Approach ---------- */
.approach ol { list-style: none; padding: 0; margin: 2rem 0 0; }
.approach li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
}
.approach li b { font: italic 3.4rem/1 var(--serif); color: var(--sun); min-width: 2ch; }
.approach h3 { font-size: 1.7rem; margin-bottom: .4rem; }

/* ---------- 14. Get involved ---------- */
.involve { background: var(--panel); }
.three { --bs-gutter-x: 2rem; --bs-gutter-y: 2rem; margin-top: calc(2rem - var(--bs-gutter-y)); }
.three-item { border-top: 2px solid var(--ink); padding-top: 1rem; }
.three-item h3 { font-size: 1.7rem; margin-bottom: .4rem; }
.write-to { margin-top: 2rem; font-size: 1.2rem; }
.write-to a { font-weight: 600; text-decoration-color: var(--sun); text-underline-offset: 4px; }

/* ---------- 15. Donate ---------- */
.donate { background: var(--panel); }
.give { --bs-gutter-x: 2rem; --bs-gutter-y: 2rem; margin-top: calc(2rem - 1em - var(--bs-gutter-y)); }
.give-box { height: 100%; background: var(--paper); padding: 1.6rem; border-top: 3px solid var(--sun); }
.give-box h3 { font-size: 1.6rem; margin-bottom: .6rem; }
.gateway-note { margin: 1rem 0 0; }
.qr {
    width: 150px;
    aspect-ratio: 1;
    border: 2px dashed var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--soft);
    font-size: .85rem;
    margin-top: 1.2rem;
    padding: .5rem;
}
.qr-img { display: block; width: 150px; height: auto; margin-top: 1.2rem; }
.donate-note { margin-top: 1.5rem; }

/* ---------- 16. Transparency ---------- */
.trust dl { margin: 2rem 0 0; }
.trust dt {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 400;
    padding-top: 1.3rem;
    border-top: 1px solid var(--rule);
}
.trust dd { display: flow-root; margin: .4rem 0 1.3rem; color: var(--soft); max-width: 70ch; }
.reg { margin: .8rem 0 1.3rem; max-width: 560px; }

/* ---------- 17. Footer ---------- */
.site-footer {
    background: var(--night);
    color: var(--onnight);
    padding: 3rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
}
.footer-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.site-footer .logo-mark { color: var(--onnight); width: 64px; height: 64px; }
.site-footer p { margin: .2rem 0; font-size: .95rem; opacity: .85; }
.site-footer .footer-name { font-family: var(--serif); font-size: 1.3rem; opacity: 1; }

/* ---------- 18. Animations (end state = the static design) ---------- */
@keyframes heroIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

.js .anim-hero { opacity: 0; }
.js.is-loaded .anim-hero { animation: heroIn .9s var(--ease) both; }
.js.is-loaded .lede.anim-hero   { animation-delay: .12s; }
.js.is-loaded .btns.anim-hero   { animation-delay: .24s; }
.js.is-loaded .emblem.anim-hero { animation-delay: .3s; }
.js.is-loaded .page-head h1.anim-hero     { animation-delay: .08s; }
.js.is-loaded .page-head .intro.anim-hero { animation-delay: .16s; }

.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal[data-delay="1"] { transition-delay: .1s; }
.js .reveal[data-delay="2"] { transition-delay: .2s; }
.js .reveal[data-delay="3"] { transition-delay: .3s; }
.js .reveal.is-visible { opacity: 1; transform: none; }

.js .step::after { transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease) .2s; }
.js .reveal.is-visible .step::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal, .js .anim-hero { opacity: 1; transform: none; }
    .js .step::after { transform: none; }
}

/* ---------- 19. Very small phones (≤ 359px): keep logo and menu button on one line ---------- */
@media (max-width: 359.98px) {
    .brand { gap: .6rem; font-size: 1.4rem; }
    .brand small { letter-spacing: .1em; }
    .brand .logo-mark { width: 48px; height: 48px; }
    .nav-toggle { width: 42px; height: 42px; }
}
