/* ==========================================================================
   HEY — Home for Empowering the Youth
   Brand system derived from the HEY logo:
   ember orange (letters), lagoon teal (house), harbor navy (tagline).
   ========================================================================== */

:root {
    --ember: #F05414;
    --ember-deep: #C93F06;
    --lagoon: #38B2C1;
    --lagoon-deep: #1E8796;
    --harbor: #154A60;
    --deep: #0C2C3B;
    --mist: #E9F5F7;
    --peach: #FFE6D8;
    --paper: #FFFFFF;
    --ink: #10303F;
    --muted: #4E6873;
    --line: #CFE1E6;

    --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;

    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --section: clamp(72px, 10vw, 128px);

    /* House-shaped clip used across photos (the logo's gable roof) */
    --gable: polygon(0 18%, 50% 0, 100% 18%, 100% 100%, 0 100%);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 3px solid var(--lagoon);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 2000;
    background: var(--deep); color: #fff; padding: 10px 16px; border-radius: 8px;
    text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.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;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--harbor);
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 800; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.2; }
h4 { font-size: 1.05rem; font-weight: 700; }

.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 62ch; }
.prose p { max-width: 68ch; }
.prose p + p { margin-top: 1em; }

.section { padding: var(--section) 0; }
.section--mist { background: var(--mist); }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 760px; }
.section-head--split {
    max-width: none; grid-template-columns: 1fr auto; align-items: end;
}

/* ---------- Buttons & links ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 26px;
    border-radius: 999px; border: 2px solid transparent;
    font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--ember { background: var(--ember); color: #fff; }
.btn--ember:hover { background: var(--ember-deep); }
.btn--ghost-light { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost-light:hover { background: #fff; color: var(--harbor); }
.btn--outline { border-color: var(--harbor); color: var(--harbor); }
.btn--outline:hover { background: var(--harbor); color: #fff; }
.btn--light { background: #fff; color: var(--ember-deep); }
.btn--light:hover { background: var(--deep); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }

.text-link {
    font-weight: 700; color: var(--ember-deep); text-decoration: underline;
    text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.text-link:hover { color: var(--harbor); }

/* ---------- Navigation ---------- */

.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: #fff;
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(12,44,59,.06); }

.nav {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    min-height: 76px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { height: 42px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
    display: block; padding: 10px 12px; border-radius: 8px;
    text-decoration: none; font-weight: 600; font-size: .97rem; color: var(--ink);
}
.nav-links a:hover { color: var(--ember-deep); }
.nav-links a[aria-current="page"], .nav-links a.is-active {
    color: var(--ember-deep);
    box-shadow: inset 0 -3px 0 var(--ember);
    border-radius: 0;
}
.nav-links .nav-cta a {
    margin-left: 8px; background: var(--harbor); color: #fff; border-radius: 999px; padding: 10px 20px;
    box-shadow: none;
}
.nav-links .nav-cta a:hover { background: var(--ember); color: #fff; }

.menu-toggle {
    display: none; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer;
    border-radius: 10px; position: relative;
}
.menu-toggle span {
    position: absolute; left: 12px; right: 12px; height: 2.5px; background: var(--harbor); border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 23px; }
.menu-toggle span:nth-child(3) { top: 30px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero (home) — full-bleed ---------- */

.hero {
    position: relative;
    width: 100%;
    background: var(--harbor);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.hero::before {
    /* faint roof lines echoing the logo house */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(155deg, transparent 0 62%, rgba(56,178,193,.18) 62% 62.4%, transparent 62.4%),
        linear-gradient(25deg, transparent 0 70%, rgba(240,84,20,.16) 70% 70.4%, transparent 70.4%);
}
.hero-grid {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px);
    align-items: center;
    padding-top: clamp(56px, 8vw, 104px);
    padding-bottom: clamp(56px, 8vw, 104px);
}
.hero-kicker { font-weight: 600; color: #BFE7EC; margin-bottom: 20px; font-size: 1.02rem; }
.hero h1 { color: #fff; max-width: 13ch; }
.hero h1 .line { display: block; }
.hero-lead { margin-top: 28px; font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: rgba(255,255,255,.88); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.pillars-inline {
    display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 44px; padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.22);
    font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: .06em;
}
.pillars-inline span:nth-child(1) { color: #FF8A57; }
.pillars-inline span:nth-child(2) { color: #7BD6E1; }
.pillars-inline span:nth-child(3) { color: #fff; }

.hero-figure { position: relative; }
.hero-figure .gable-photo { aspect-ratio: 4 / 4.4; }
.hero-figure figcaption { margin-top: 12px; font-size: .9rem; color: rgba(255,255,255,.75); }

.gable-photo {
    position: relative; overflow: hidden;
    clip-path: var(--gable);
    background: var(--mist);
}
.gable-photo img { width: 100%; height: 100%; object-fit: cover; }
.gable-photo .placeholder-flag { top: auto; bottom: 12px; }

.rays { position: absolute; left: 50%; top: -6%; transform: translateX(-50%); width: 22%; color: var(--ember); pointer-events: none; }

/* one orchestrated load moment */
@media (prefers-reduced-motion: no-preference) {
    .hero h1 .line { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
    .hero h1 .line:nth-child(2) { animation-delay: .08s; }
    .hero h1 .line:nth-child(3) { animation-delay: .16s; }
    .hero-figure .gable-photo { animation: unveil 1.1s cubic-bezier(.2,.7,.2,1) .15s both; }
    .hero-figure .rays { animation: fadeIn .6s ease 1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: polygon(0 100%, 50% 100%, 100% 100%, 100% 100%, 0 100%); } to { clip-path: var(--gable); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Page hero (subpages) — full-bleed ---------- */

.page-hero { width: 100%; background: var(--harbor); color: #fff; position: relative; overflow: hidden; }
.page-hero::after {
    content: ""; position: absolute; right: -60px; bottom: -40px; width: 340px; height: 300px;
    border: 3px solid rgba(56,178,193,.35);
    clip-path: polygon(0 34%, 50% 0, 100% 34%, 100% 100%, 0 100%);
    background: rgba(56,178,193,.08);
}
.page-hero .wrap { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4.4rem); max-width: 18ch; }
.page-hero .lead { color: rgba(255,255,255,.86); margin-top: 20px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-bottom: 22px; font-size: .95rem; color: #BFE7EC; }
.breadcrumb a { color: #fff; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; opacity: .6; }

/* ---------- Impact ---------- */

.impact { background: var(--mist); }
.impact-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 3px solid var(--harbor);
}
.impact-item { padding: 32px 28px 8px 0; }
.impact-item + .impact-item { padding-left: 28px; border-left: 1px solid var(--line); }
.impact-icon { width: 40px; height: 40px; color: var(--lagoon-deep); margin-bottom: 18px; }
.impact-number {
    font-family: var(--font-display); font-weight: 800; line-height: 1;
    font-size: clamp(3rem, 5.6vw, 4.6rem); letter-spacing: -0.04em; color: var(--ember-deep);
    font-variant-numeric: tabular-nums;
}
.impact-item:nth-child(2) .impact-number { color: var(--lagoon-deep); }
.impact-number--word { font-size: clamp(2.3rem, 4vw, 3.3rem); color: var(--harbor); padding-top: .2em; }
.impact-label { margin-top: 12px; font-weight: 700; color: var(--harbor); font-size: 1.05rem; }
.impact-note { margin-top: 6px; color: var(--muted); font-size: .95rem; max-width: 26ch; }

/* ---------- Mission ---------- */

.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
.mission-text .lead { margin-top: 20px; }
.pillars { margin-top: 40px; display: grid; gap: 0; }
.pillar { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.pillar:last-child { border-bottom: 1px solid var(--line); }
.pillar-word { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.pillar:nth-child(1) .pillar-word { color: var(--ember-deep); }
.pillar:nth-child(2) .pillar-word { color: var(--lagoon-deep); }
.pillar:nth-child(3) .pillar-word { color: var(--harbor); }
.pillar p { color: var(--muted); }

.photo-figure { position: relative; }
.photo-figure .gable-photo { aspect-ratio: 4 / 4.2; }
.photo-figure .rays { width: 18%; top: -5%; }
.photo-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--harbor); margin-top: 18px; }
.photo-figure figcaption { color: var(--muted); font-size: .95rem; margin-top: 4px; }

/* ---------- What we do ---------- */

.activities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 3px solid var(--harbor); }
.activity { padding: 32px 32px 36px 0; }
.activity + .activity { padding-left: 32px; border-left: 1px solid var(--line); }
.activity-icon { width: 52px; height: 52px; color: var(--ember); margin-bottom: 20px; }
.activity h3 { margin-bottom: 10px; }
.activity p { color: var(--muted); }

.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
.door {
    position: relative; display: flex; flex-direction: column;
    background: #fff; padding: 64px 32px 32px;
    clip-path: polygon(0 34px, 50% 0, 100% 34px, 100% 100%, 0 100%);
    border-radius: 0 0 18px 18px;
    text-decoration: none; color: inherit;
    transition: background-color .2s ease;
}
.door:hover { background: #F6FBFC; }
.door-icon { width: 44px; height: 44px; color: var(--lagoon-deep); margin-bottom: 16px; }
.door h3 { margin-bottom: 10px; }
.door p { color: var(--muted); flex-grow: 1; }
.door .text-link { margin-top: 22px; align-self: flex-start; }

/* ---------- Success stories carousel ---------- */

.story-carousel { position: relative; }
.story-slide { display: none; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.story-slide.is-active { display: grid; }
@media (prefers-reduced-motion: no-preference) {
    .story-slide.is-active { animation: fadeIn .45s ease both; }
}
.story-slide .gable-photo { aspect-ratio: 5 / 4; }
.story-project { font-weight: 700; color: var(--lagoon-deep); margin-bottom: 10px; }
.story-slide h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.12; margin-bottom: 18px; }
.story-slide p { color: var(--muted); max-width: 56ch; }
.story-slide .text-link { display: inline-block; margin-top: 22px; }

.carousel-controls { display: flex; align-items: center; gap: 16px; margin-top: 40px; }
.carousel-btn {
    width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--harbor); background: transparent;
    color: var(--harbor); cursor: pointer; display: grid; place-items: center;
}
.carousel-btn:hover { background: var(--harbor); color: #fff; }
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot { width: 28px; height: 6px; border-radius: 3px; border: 0; background: var(--line); cursor: pointer; }
.carousel-dot[aria-current="true"] { background: var(--ember); }

/* ---------- News ---------- */

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
.news-grid--home .news-card.is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; }
.news-card {
    position: relative; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.news-card:hover { border-color: var(--lagoon); box-shadow: 0 14px 36px rgba(12,44,59,.08); }
.news-media { position: relative; aspect-ratio: 16 / 10; background: var(--mist); overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-card.is-featured .news-media { aspect-ratio: auto; min-height: 340px; }
.news-body { display: flex; flex-direction: column; flex-grow: 1; padding: 26px 26px 28px; }
.news-card.is-featured .news-body { padding: clamp(28px, 4vw, 48px); justify-content: center; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.tag {
    display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700;
    background: var(--peach); color: var(--ember-deep);
}
.tag--upcoming { background: var(--lagoon); color: #062A31; }
.news-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.news-card.is-featured h3 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
.news-card h3 a { text-decoration: none; }
.news-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.news-card h3 a:focus-visible { outline: none; }
.news-card:has(h3 a:focus-visible) { outline: 3px solid var(--lagoon); outline-offset: 3px; }
.news-card p { color: var(--muted); flex-grow: 1; }
.news-card .read-more { margin-top: 18px; font-weight: 700; color: var(--ember-deep); }

.placeholder-flag {
    position: absolute; left: 12px; top: 12px; z-index: 1;
    background: rgba(12,44,59,.85); color: #fff; font-size: .78rem; font-weight: 600;
    padding: 4px 10px; border-radius: 6px;
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter-bar button {
    min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line);
    background: #fff; font-weight: 600; cursor: pointer;
}
.filter-bar button[aria-pressed="true"] { background: var(--harbor); border-color: var(--harbor); color: #fff; }

.center-cta { margin-top: 48px; }

/* ---------- Empty state ---------- */

.empty-state {
    display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start;
    padding: clamp(28px, 4vw, 48px); border: 2px dashed var(--line); border-radius: 18px; background: #fff;
}
.empty-state svg { width: 64px; height: 64px; color: var(--lagoon); }
.empty-state h2, .empty-state h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 60ch; }
.empty-state .btn { margin-top: 22px; }

/* ---------- Article ---------- */

.article-layout { display: grid; grid-template-columns: 280px 1fr; gap: clamp(32px, 5vw, 72px); }
.facts { border-top: 3px solid var(--harbor); align-self: start; position: sticky; top: 100px; }
.facts dt { font-size: .85rem; font-weight: 700; color: var(--lagoon-deep); margin-top: 18px; }
.facts dd { color: var(--ink); }
.article-media { margin-bottom: 40px; }
.article-media .gable-photo { aspect-ratio: 16 / 9; clip-path: polygon(0 10%, 50% 0, 100% 10%, 100% 100%, 0 100%); }
.article-media figcaption { color: var(--muted); font-size: .92rem; margin-top: 10px; }
.article-body h2 { font-size: 1.5rem; margin: 36px 0 10px; }
.article-body h2:first-child { margin-top: 0; }
.article-body p { max-width: 68ch; }
.article-nav { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ---------- Get involved ---------- */

.involve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.involve {
    display: flex; flex-direction: column; padding: 36px 32px; border-radius: 18px; background: var(--mist);
    border-top: 6px solid var(--ember);
}
.involve:nth-child(2) { border-top-color: var(--lagoon); }
.involve:nth-child(3) { border-top-color: var(--harbor); }
.involve-icon { width: 48px; height: 48px; color: var(--harbor); margin-bottom: 20px; }
.involve h3 { margin-bottom: 10px; }
.involve p { color: var(--muted); flex-grow: 1; }
.involve .btn { margin-top: 26px; align-self: flex-start; }

/* ---------- Newsletter ---------- */

.newsletter { background: var(--ember); color: #fff; }
.newsletter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.newsletter h2 { color: #fff; }
.newsletter p { color: rgba(255,255,255,.92); margin-top: 12px; max-width: 46ch; }
.inline-form { display: flex; gap: 12px; }
.inline-form input {
    flex: 1; min-width: 0; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
    background: #fff; color: var(--ink);
}
.inline-form input:focus { outline: none; border-color: var(--deep); }
.newsletter .form-status { color: #fff; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 6vw, 88px); }
.contact-list { list-style: none; display: grid; gap: 26px; margin-top: 32px; }
.contact-list li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.contact-list svg { width: 48px; height: 48px; padding: 11px; border-radius: 14px; background: var(--mist); color: var(--ember-deep); }
.contact-list h3 { font-size: 1.05rem; margin-bottom: 2px; }
.contact-list p, .contact-list address { font-style: normal; color: var(--muted); }
.contact-list a { color: var(--harbor); font-weight: 600; }

.socials { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.socials a {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
    background: var(--harbor); color: #fff; transition: background-color .2s ease, transform .2s ease;
}
.socials a:hover { background: var(--ember); transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }
.contact-socials { margin-top: 36px; }
.contact-socials h3 { font-size: 1.05rem; margin-bottom: 12px; }

.form { display: grid; gap: 18px; background: var(--mist); padding: clamp(24px, 4vw, 44px); border-radius: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; color: var(--harbor); font-size: .97rem; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px;
    border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--lagoon-deep); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #B42318; }
.field-error { color: #B42318; font-size: .9rem; font-weight: 600; min-height: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .9rem; color: var(--muted); }
.form-status { font-weight: 600; border-radius: 12px; }
.form-status:empty { display: none; }
.form-status.is-success { background: #E3F6EC; color: #11603A; padding: 14px 16px; }
.form-status.is-error { background: #FDECEA; color: #8F1D14; padding: 14px 16px; }
.newsletter .form-status.is-success, .newsletter .form-status.is-error { margin-top: 12px; }

/* ---------- About ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.timeline { list-style: none; border-left: 3px solid var(--line); margin-left: 8px; }
.timeline li { position: relative; padding: 0 0 30px 32px; }
.timeline li::before {
    content: ""; position: absolute; left: -11px; top: 4px; width: 19px; height: 17px; background: var(--ember);
    clip-path: polygon(0 40%, 50% 0, 100% 40%, 100% 100%, 0 100%);
}
.timeline time { font-weight: 700; color: var(--lagoon-deep); display: block; }
.timeline p { color: var(--ink); max-width: 60ch; }

.projects-table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.projects-table th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 700; padding: 0 12px 12px 0; border-bottom: 3px solid var(--harbor); }
.projects-table td { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.projects-table td:first-child { font-family: var(--font-display); font-weight: 800; color: var(--ember-deep); width: 52px; }
.projects-table a { font-weight: 700; color: var(--harbor); }
.table-scroll { overflow-x: auto; }

.numbers { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px solid var(--harbor); }
.numbers div { padding: 24px 20px 0 0; }
.numbers div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.numbers strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--ember-deep); line-height: 1; }
.numbers span { display: block; margin-top: 10px; color: var(--muted); }
.source-note { margin-top: 20px; font-size: .9rem; color: var(--muted); }

.team { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; }
.team li { padding: 20px 0; border-top: 1px solid var(--line); }
.team strong { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--harbor); }
.team span { color: var(--muted); }

.partners { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.partners li { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--harbor); }

.legal {
    background: #fff; border-radius: 22px; padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--line); border-top: 8px solid var(--harbor);
}
.legal dl { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; }
.legal dt, .legal dd { padding: 16px 0; border-bottom: 1px solid var(--line); }
.legal dt { font-weight: 700; color: var(--harbor); padding-right: 24px; }
.legal dd { color: var(--ink); overflow-wrap: anywhere; }
.legal dd a { color: var(--lagoon-deep); font-weight: 600; }
.legal dl > :nth-last-child(-n+2) { border-bottom: 0; }
.legal-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.legal-head img { width: 64px; height: auto; }

/* ---------- Resources ---------- */

.doc-card {
    display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
    padding: 28px; border-radius: 18px; background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--ember);
}
.doc-card svg { width: 52px; height: 52px; color: var(--ember-deep); }
.doc-card h3 { margin-bottom: 4px; }
.doc-card p { color: var(--muted); }
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 28px; }

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

.site-footer { background: var(--deep); color: rgba(255,255,255,.82); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; padding-top: 80px; padding-bottom: 56px; }
.footer-brand img { width: 220px; height: auto; margin-bottom: 22px; }
.footer-brand address { font-style: normal; line-height: 1.7; }
.footer-brand strong { color: #fff; }
.footer-brand a { color: #fff; }
.site-footer h2 { font-size: 1.05rem; color: #fff; margin-bottom: 16px; letter-spacing: 0; }
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer ul a { color: rgba(255,255,255,.82); text-decoration: none; }
.site-footer ul a:hover { color: #fff; text-decoration: underline; }
.site-footer .socials { margin-top: 24px; display: flex; }
.site-footer .socials a { background: rgba(255,255,255,.1); }
.site-footer .socials a:hover { background: var(--ember); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 24px; padding-bottom: 28px; font-size: .92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Reveal (light, once) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
    .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .nav-links a { padding: 10px 8px; font-size: .93rem; }
    .nav-links .nav-cta a { padding: 10px 16px; }
}

@media (max-width: 980px) {
    .menu-toggle { display: block; margin-left: auto; }
    .nav > nav { position: absolute; width: 0; }
    .nav-links {
        position: fixed; left: 0; right: 0; top: 76px; bottom: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; padding: 16px var(--gutter) 40px; overflow-y: auto;
        display: none;
    }
    .nav-links.is-open { display: flex; }
    .nav-links a { padding: 16px 4px; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
    .nav-links a[aria-current="page"], .nav-links a.is-active { box-shadow: inset 4px 0 0 var(--ember); padding-left: 14px; }
    .nav-links .nav-cta a { margin: 20px 0 0; text-align: center; border-bottom: 0; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-figure { max-width: 520px; }
    .impact-grid { grid-template-columns: 1fr 1fr; }
    .impact-item:nth-child(3) { padding-left: 0; border-left: 0; }
    .impact-item:nth-child(n+3) { border-top: 1px solid var(--line); }
    .mission-grid, .split, .contact-grid, .newsletter-grid { grid-template-columns: 1fr; }
    .activities { grid-template-columns: 1fr; }
    .activity, .activity + .activity { padding: 28px 0; border-left: 0; }
    .activity + .activity { border-top: 1px solid var(--line); }
    .doors, .involve-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr 1fr; }
    .news-grid--home .news-card.is-featured { grid-template-columns: 1fr; }
    .news-card.is-featured .news-media { min-height: 0; aspect-ratio: 16 / 9; }
    .story-slide { grid-template-columns: 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .facts { position: static; }
    .numbers { grid-template-columns: 1fr 1fr; }
    .numbers div:nth-child(3) { padding-left: 0; border-left: 0; }
    .numbers div:nth-child(n+3) { margin-top: 24px; }
    .team { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }
    .page-hero::after { display: none; }
    .brand img { height: 36px; }
    .section-head--split { grid-template-columns: 1fr; }
    .impact-item { padding: 24px 14px 20px 0; }
    .impact-item:nth-child(even) { padding-left: 14px; padding-right: 0; }
    .impact-number { font-size: 2.6rem; }
    .impact-number--word { font-size: 1.9rem; }
    .impact-note { display: none; }
    .pillar { grid-template-columns: 1fr; gap: 6px; }
    .news-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .inline-form { flex-direction: column; }
    .inline-form .btn { width: 100%; }
    .hero-actions .btn { flex: 1 1 auto; }
    .empty-state { grid-template-columns: 1fr; }
    .doc-card { grid-template-columns: 1fr; }
    .legal dl { grid-template-columns: 1fr; }
    .legal dt { border-bottom: 0; padding-bottom: 0; }
    .legal dd { padding-top: 4px; }
    .numbers { grid-template-columns: 1fr; }
    .numbers div, .numbers div + div { padding: 20px 0 0; border-left: 0; margin-top: 0 !important; }
    .team { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .projects-table thead { display: none; }
    .projects-table tr { display: grid; grid-template-columns: 44px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .projects-table td { border: 0; padding: 2px 0; }
    .projects-table td:first-child { grid-row: span 4; }
}

.legal .socials a { color: #fff; }

.article-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 44px; }
@media (max-width: 640px) { .article-gallery { grid-template-columns: 1fr; } }
.article-gallery img { width: 100%; height: auto; border-radius: 14px; background: var(--mist); }
.project-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; float: left; margin-right: 14px; }
@media (max-width: 640px) { .project-thumb { width: 60px; height: 40px; } }
