/* ============================================================
   LA EcoExplorers — shared by index, stories, about, contact
   Design reference: docs/design/2026-09-26-landing-mockup.png
   ============================================================ */

:root {
    color-scheme: light;
    --ink: #123524;
    --ink-soft: #2c4a3b;
    --forest: #0f4d32;
    --forest-hover: #0b3d27;
    --page: #fbfaf4;
    --sky: #e4f2fb;
    --green-bg: #e5f2de;
    --blue-bg: #e2eff9;
    --yellow-bg: #fdf1cd;
    --coral-bg: #fde5db;
    --blue: #1d6fb8;
    --radius: 28px;
    --gutter: clamp(16px, 4vw, 40px);
    --max: 1240px;
    --topbar-h: 80px;   /* measured; the hero fills the first screen below it */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}

/* Sticky footer: the short pages (Contact) keep the footer at the bottom of the screen */
body {
    display: flex; flex-direction: column; min-height: 100vh;
    margin: 0;
    /* Sky at the top, fading through the cream page colour to a green ground at the foot.
       It spans the whole document, so a long page shades gradually and a short one fully. */
    background: var(--page) linear-gradient(180deg, #e6f3fb 0%, var(--page) 30%, #f5f1df 68%, #dfeed6 100%);
    color: var(--ink);
    font: 600 1.0625rem/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.05; color: var(--forest); }
p { margin: 0; }
a { color: inherit; }

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

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

.nowrap { white-space: nowrap; }

/* --- Top bar ------------------------------------------------ */
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    width: 100%; max-width: var(--max); margin: 0 auto;
    padding: 14px var(--gutter);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 52px; height: 52px; flex: none; transform-origin: 30% 85%; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.brand-text b { transition: color .2s ease, letter-spacing .3s ease; }
/* Hover: the leaf sways like it caught a breeze and the name opens up a little */
.brand:hover .brand-mark,
.brand:focus-visible .brand-mark { transform: rotate(-10deg) scale(1.08); animation: leaf-sway 1.6s ease-in-out .35s infinite; }
.brand:hover .brand-text b,
.brand:focus-visible .brand-text b { color: #1f7a45; letter-spacing: .03em; }
@keyframes leaf-sway {
    0%, 100% { transform: rotate(-10deg) scale(1.08); }
    50%      { transform: rotate(4deg) scale(1.08); }
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 900; line-height: 1;
    color: var(--forest); letter-spacing: .01em;
}

.nav { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.pill {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 10px 22px; border-radius: 16px;
    font-size: 1.1rem; font-weight: 800; text-decoration: none; color: var(--ink);
    transition: background-color .15s ease;
}
.pill svg { width: 26px; height: 26px; flex: none; }
.pill--green  { background: var(--green-bg); }
.pill--blue   { background: var(--blue-bg); }
.pill--yellow { background: var(--yellow-bg); }
.pill--coral  { background: var(--coral-bg); }
.pill--green:hover  { background: #d3e9c9; }
.pill--blue:hover   { background: #cfe3f4; }
.pill--yellow:hover { background: #fae6ae; }
.pill--coral:hover  { background: #fbd3c3; }
.pill[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--forest); }

/* --- Hero --------------------------------------------------- */
/* The hero scales as one composition. --u is 1/100 of the 1440-wide design, bounded by
   the screen's width AND its height, so a wide-but-short screen (2560x1080, a laptop with
   the dock up) shrinks it to fit and a big screen grows it instead of leaving the type
   stranded at its rem ceiling. 40 = the design's height in u (its copy column plus padding,
   about 580px at 1440); 26px caps it at 1.8x for ultrawides. */
.hero {
    --u: min(1vw, (100vh - var(--topbar-h)) / 40, 26px);
    --u: min(1vw, (100svh - var(--topbar-h)) / 40, 26px);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center;
    gap: calc(1.7 * var(--u));
    max-width: none;
    /* Left edge: in line with the logo until the composition outgrows the 1240 header,
       then centred on the scaled composition (43u = half of 1240 at the design size).
       % not vw: vw includes a classic scrollbar (Windows), which put the text off the logo. */
    padding: calc(2.5 * var(--u)) 0 calc(4.4 * var(--u))
             min(max(0px, (100% - var(--max)) / 2) + var(--gutter), 50% - 43 * var(--u) + var(--gutter));
    /* Sampled from the illustration's own sky so its edges disappear into the band. The
       last stretch fades to transparent so the band melts into the page gradient behind
       it instead of ending on a hard edge. */
    background: linear-gradient(180deg, #c7eafe 0%, #d6f0fe 45%, #e8f6fd 70%, rgba(232, 246, 253, 0) 100%);
    overflow: hidden;
    position: relative;
    min-height: calc(100vh - var(--topbar-h));
    min-height: calc(100svh - var(--topbar-h));
}
.hero-copy { position: relative; z-index: 1; min-width: 0; }

.hero h1 {
    font-size: max(2.9rem, 6.2 * var(--u));
    letter-spacing: -.02em; line-height: .98;
}
.spark { width: .5em; height: .5em; vertical-align: top; margin-left: .06em; }

.hero-copy p {
    margin-top: calc(1.5 * var(--u)); max-width: 34ch;
    font-size: max(1.1rem, 1.55 * var(--u)); line-height: 1.35; color: var(--ink);
}

.cta {
    display: inline-flex; align-items: center; gap: 14px;
    margin-top: 28px; padding: 16px 40px; border-radius: 999px;
    background: var(--forest); color: #fff; text-decoration: none;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 800;
    box-shadow: 0 6px 18px rgba(15, 77, 50, .28);
    transition: background .15s ease;
}
.hero .cta {
    gap: max(14px, var(--u)); margin-top: max(24px, 1.9 * var(--u));
    padding: max(14px, 1.1 * var(--u)) max(32px, 2.8 * var(--u));
    font-size: max(1.15rem, 1.55 * var(--u));
}
.cta:hover { background: var(--forest-hover); }

.hero-art { justify-self: stretch; width: 100%; max-width: none; }
/* Runs off the right edge like the mockup; the left, top and bottom edges are feathered.
   The top fade hides the seam where the art's sky meets the band's slightly different blue.
   max-width keeps it inside the band on extreme ultrawides (32:9 and beyond): 2.284 is the
   art's aspect ratio (964/422). */
.hero-art img {
    width: 100%;
    max-width: calc((100svh - var(--topbar-h) - 7 * var(--u)) * 2.284);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%),
                        linear-gradient(180deg, transparent 0, #000 7%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(90deg, transparent 0, #000 9%),
                        linear-gradient(180deg, transparent 0, #000 7%, #000 88%, transparent 100%);
            mask-composite: intersect;
}

/* --- Panels ------------------------------------------------- */
main > .panel,
main > .topics,
main > .stories,
main > .team {
    max-width: var(--max); margin-left: auto; margin-right: auto;
    width: calc(100% - 2 * var(--gutter));
}

.panel {
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 32px);
}

/* --- Inner page header (stories / about / impact / contact) */
.page-head {
    max-width: var(--max); width: calc(100% - 2 * var(--gutter));
    margin: 8px auto 0; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px);
    border-radius: var(--radius);
}
.page-head--green  { background: var(--green-bg); }
.page-head--blue   { background: var(--blue-bg); }
.page-head--yellow { background: var(--yellow-bg); }
.page-head--coral  { background: var(--coral-bg); }
.page-head h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); letter-spacing: -.02em; }
.page-head p { margin-top: 14px; max-width: 52ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.4; }

/* About: the origin story. Longer than any other page-head copy, so it reads as prose:
   a lighter body at a reading measure, the first paragraph as the lede, the last line as the payoff. */
.origin { max-width: 66ch; margin-top: 26px; padding-top: 24px; border-top: 3px solid rgba(29, 111, 184, .22); }
.origin h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.page-head .origin p { max-width: none; font-size: 1.125rem; line-height: 1.65; color: var(--ink-soft); }
.page-head .origin .origin-lede { font-size: clamp(1.15rem, 1.7vw, 1.3rem); line-height: 1.55; font-weight: 700; color: var(--ink); }
.page-head .origin .origin-end { margin-top: 22px; font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.3; font-weight: 900; color: var(--forest); }
@media (min-width: 900px) {
    /* Wide screens: heading left, story right, so the box has no empty half */
    .origin { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 56px; align-items: start; }
    .origin h2 { grid-row: 1 / span 3; font-size: clamp(2rem, 3vw, 2.6rem); }
    .origin p { grid-column: 2; max-width: 66ch; }
    .page-head .origin .origin-lede { margin-top: 0; }
}

/* Impact: the LAUSD classrooms and the LA Zoo partnership. Same prose treatment as the About
   origin story; each image sits beside its text on wide screens and below it on phones. */
.impact { max-width: 66ch; margin-top: 26px; padding-top: 24px; border-top: 3px solid rgba(217, 96, 59, .25); }
.impact h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.page-head .impact p { max-width: none; font-size: 1.125rem; line-height: 1.65; color: var(--ink-soft); }
.page-head .impact .impact-lede { font-size: clamp(1.15rem, 1.7vw, 1.3rem); line-height: 1.55; font-weight: 700; color: var(--ink); }
.page-head .impact .impact-end { margin-top: 22px; font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.3; font-weight: 900; color: var(--forest); }
.impact-seal { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; object-fit: contain; margin: 26px auto 0; }
.impact-photo { display: block; width: 100%; max-width: 560px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin-top: 26px; border-radius: 20px; }
@media (min-width: 900px) {
    .impact { max-width: none; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); grid-template-rows: auto 1fr; gap: 0 56px; align-items: start; }
    .impact h2, .impact-copy { grid-column: 1; }
    .impact-seal { grid-column: 2; grid-row: 1 / span 2; max-width: 380px; margin: 4px auto 0; }
    .impact-photo { grid-column: 2; grid-row: 1 / span 2; max-width: none; margin-top: 4px; }
}

/* Trail cam: pulled up so it overlaps the bottom of the hero, as in the mockup */
.trailcam {
    position: relative; margin-top: 0;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px;
    background: var(--blue-bg);
    box-shadow: 0 -2px 0 rgba(255, 255, 255, .7), 0 10px 30px rgba(29, 111, 184, .08);
}
.trailcam-intro { display: flex; gap: 16px; align-items: flex-start; }
.trailcam-icon { width: 64px; height: 56px; flex: none; margin-top: -4px; }
.trailcam h2 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); color: #102a3c; white-space: nowrap; }
.trailcam-intro p { margin-top: 10px; color: var(--ink-soft); }
.trailcam-intro .trailcam-motto { font-weight: 800; color: var(--forest); }
.trailcam-intro .trailcam-source {
    display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 999px;
    background: #fff; color: var(--blue); font-weight: 900; text-decoration: none;
}
.trailcam-intro .trailcam-source:hover { text-decoration: underline; }

.clips {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.clip h3 { margin-top: 10px; font-size: 1.1rem; font-weight: 800; color: #102a3c; }
.clip-frame { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; background: #1b2b33; }
.clip-meta { margin-top: 2px; font-size: .9rem; color: var(--ink-soft); }

/* --- Topics ------------------------------------------------- */
.topics {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
    margin-top: 18px;
}
.topic {
    display: flex; gap: 18px; align-items: center;
    padding: 22px 26px; border-radius: var(--radius);
    text-decoration: none; color: var(--ink-soft);
    border: 2px solid transparent;
    transition: border-color .15s ease;
}
.topic:hover { border-color: currentColor; }
.topic .count { display: block; margin-top: 8px; font-style: normal; font-weight: 800; color: var(--forest); }
.topic svg { width: 86px; height: 86px; flex: none; }
.topic span { display: block; }
.topic b { display: block; margin-bottom: 4px; font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 900; line-height: 1.05; color: #102a1d; }
.topic--green  { background: var(--green-bg); }
.topic--blue   { background: var(--blue-bg); }
.topic--yellow { background: var(--yellow-bg); }

/* --- Stories ------------------------------------------------ */
.stories { margin-top: 64px; scroll-margin-top: 16px; }
.page-head + .stories { margin-top: 36px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
    min-height: 44px; padding: 8px 18px; border-radius: 999px;
    border: 2px solid #cfe2d4; background: #fff; color: var(--ink);
    font: inherit; font-weight: 800; cursor: pointer;
}
.filters button:hover { border-color: var(--forest); }
.filters button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }

.filter-status { min-height: 1.5em; margin-top: 10px; color: var(--ink-soft); font-size: .95rem; }

.story-grid {
    list-style: none; margin: 8px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px;
}
.story[hidden] { display: none; }
.story a {
    display: flex; flex-direction: column; height: 100%;
    border-radius: 18px; overflow: hidden; text-decoration: none;
    background: #fff; border: 2px solid #e2eadd;
    transition: border-color .15s ease;
}
.story a:hover { border-color: var(--forest); }
.story a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e2eadd; }
.story-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 18px; color: var(--ink-soft); }
.story-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.parts { font-size: .9rem; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.story-body b { font-size: 1.35rem; font-weight: 900; line-height: 1.15; color: var(--forest); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: var(--ink); }
.tag--green  { background: var(--green-bg); }
.tag--blue   { background: var(--blue-bg); }
.tag--yellow { background: var(--yellow-bg); }

/* --- About / Contact --------------------------------------- */
.team h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }

.team { margin-top: 40px; }
.profiles {
    list-style: none; margin: 18px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 22px;
}
.profile {
    display: flex; gap: 20px; align-items: flex-start;
    padding: clamp(20px, 3vw, 28px); border-radius: var(--radius);
    background: #fff; border: 2px solid #e2eadd;
}
.avatar {
    display: grid; place-items: center; flex: none;
    width: 88px; height: 88px; border-radius: 50%;
    font-size: 1.9rem; font-weight: 900; color: var(--forest);
}
.avatar--green  { background: var(--green-bg); }
.avatar--yellow { background: var(--yellow-bg); color: #7a5300; }
.profile h3 { font-size: 1.5rem; }
.profile .role { margin-top: 4px; font-weight: 800; color: var(--blue); }
.profile p:not(.role) { margin-top: 10px; color: var(--ink-soft); }
.profile .email { font-weight: 700; color: var(--blue); overflow-wrap: anywhere; }

.footer { width: 100%; max-width: var(--max); margin: auto auto 0; padding: 72px var(--gutter) 40px; color: var(--ink-soft); font-size: .95rem; }

/* --- Responsive --------------------------------------------- */
/* Stacked hero: narrow screens, and any window taller than it is wide, where two columns
   leave a band of empty sky above and below. Width-scaled, since it stacks vertically. */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
    .hero {
        --u: min(1vw, 26px);
        grid-template-columns: 1fr; align-content: center; gap: 24px;
        padding: 20px var(--gutter) 64px;
    }
    .hero h1 { font-size: clamp(2.9rem, 6.8vw, 5.6rem); }
    .hero-copy p { margin-top: 22px; font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
    .hero-art img { max-width: 100%; }
}

@media (max-width: 1024px) {
    .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topics { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    :root { --topbar-h: 144px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .nav { justify-content: flex-start; }
}

@media (max-width: 600px) {
    .brand-mark { width: 42px; height: 42px; }
    .nav { gap: 8px; width: 100%; flex-wrap: nowrap; }
    .pill { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 4px;
            min-height: 64px; padding: 8px 4px; font-size: .9rem; text-align: center; }
    .pill svg { width: 22px; height: 22px; }
    .clips { grid-template-columns: 1fr; }
    .topic { padding: 18px; }
    .profile { flex-direction: column; }
    .trailcam-icon { width: 40px; height: 35px; }
    /* icon beside the heading only; the text below it uses the full width */
    .trailcam-intro { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
    .trailcam-icon { margin-top: 0; }
    .trailcam-intro > div { display: contents; }
    .trailcam-intro > div > :not(h2) { grid-column: 1 / -1; justify-self: start; }
    .avatar { width: 72px; height: 72px; font-size: 1.6rem; }
    .topic svg { width: 64px; height: 64px; }
    .story-grid { grid-template-columns: 1fr; }
}
