/* ==========================================================================
   Elimisha Makueni - public site
   Warm paper, murram red and acacia sun, taken from the county's own photos.
   ========================================================================== */

:root {
    --paper: #f6f0e4;
    --paper-deep: #ece2cf;
    --card: #fffaf1;
    --line: rgba(23, 34, 46, 0.09);

    --ink: #17222e;
    --ink-2: #44505c;
    --ink-3: #6f7a84;

    --blue: #1d4f91;
    --blue-deep: #123661;
    --soil: #b3522f;
    --soil-deep: #93401f;
    --soil-soft: #f3dccd;
    --sun: #e3a531;
    --sun-soft: #f4e2b8;
    --leaf: #2f6b43;
    --leaf-soft: #dcebdf;

    --display: "Fraunces", Georgia, "Times New Roman", serif;
    --text: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

    --radius: 18px;
    --radius-lg: 28px;
    --shadow-sm: 0 1px 2px rgba(23, 34, 46, 0.05), 0 8px 24px -16px rgba(23, 34, 46, 0.35);
    --shadow: 0 2px 4px rgba(23, 34, 46, 0.04), 0 30px 60px -32px rgba(23, 34, 46, 0.45);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

.em-body {
    margin: 0;
    font-family: var(--text);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(900px 560px at 105% -10%, rgba(227, 165, 49, 0.2), transparent 60%),
        radial-gradient(760px 520px at -12% 38%, rgba(179, 82, 47, 0.08), transparent 60%);
    -webkit-font-smoothing: antialiased;
}

.em-body img {
    max-width: 100%;
    display: block;
}

.em-body a {
    color: inherit;
}

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

.em-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.em-shell {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 40px);
}

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

.em-display {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(3.2rem, 8vw, 6.4rem);
    line-height: 0.92;
    letter-spacing: -0.025em;
    margin: 0 0 24px;
}

.em-display em {
    display: block;
    font-style: italic;
    font-weight: 500;
    color: var(--soil);
}

.em-display-md {
    font-size: clamp(2.6rem, 5.6vw, 4.6rem);
    line-height: 1;
}

.em-display-md em {
    display: inline;
}

.em-h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    margin: 0;
}

.em-kicker {
    margin: 0 0 12px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--soil);
}

.em-lede {
    margin: 0 0 32px;
    max-width: 36ch;
    font-size: clamp(1.05rem, 1.6vw, 1.22rem);
    color: var(--ink-2);
}

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

.em-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border: 0;
    border-radius: 999px;
    font: 600 0.98rem/1 var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.em-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.em-btn:hover svg {
    transform: translateX(3px);
}

.em-body .em-btn-soil {
    background: var(--soil);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(179, 82, 47, 0.8);
}

.em-body .em-btn-soil:hover {
    background: var(--soil-deep);
    transform: translateY(-1px);
}

.em-body .em-btn-ink {
    background: var(--ink);
    color: var(--paper);
    padding: 11px 18px;
}

.em-body .em-btn-ink:hover {
    background: var(--blue-deep);
}

.em-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
}

.em-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.em-link:hover svg {
    transform: translateX(4px);
}

/* --- Navigation: a floating capsule, never a full-width bar ---------------- */

.em-nav-wrap {
    position: sticky;
    top: 12px;
    z-index: 50;
    padding-inline: clamp(12px, 3vw, 32px);
}

.em-nav {
    position: relative;
    max-width: 1200px;
    margin: 12px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 8px 8px 18px;
    background: rgba(255, 250, 241, 0.86);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.em-brand img {
    height: 42px;
    width: auto;
}

.em-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.em-nav-links a:not(.em-btn) {
    display: block;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.em-nav-links a:not(.em-btn):hover,
.em-nav-links a[aria-current="page"] {
    color: var(--ink);
    background: var(--paper-deep);
}

.em-nav-cta {
    margin-left: 6px;
}

.em-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--paper-deep);
    color: var(--ink);
    cursor: pointer;
}

.em-nav-toggle svg {
    width: 22px;
    height: 22px;
}

/* --- Hero ---------------------------------------------------------------- */

.em-hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    align-items: center;
    gap: clamp(32px, 6vw, 72px);
    padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px);
}

.em-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 28px;
    padding: 6px 16px 6px 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-2);
}

.em-eyebrow img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Application window card */
.em-window {
    max-width: 520px;
    margin-bottom: 16px;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.em-window-text {
    margin: 14px 0 0;
    color: var(--ink-2);
}

.em-window-text > :last-child {
    margin-bottom: 0;
}

.em-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--paper-deep);
    color: var(--ink-2);
}

.em-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.em-status-open {
    background: var(--leaf-soft);
    color: var(--leaf);
}

.em-status-open::before {
    animation: em-pulse 2s ease-out infinite;
}

.em-status-closed {
    background: var(--soil-soft);
    color: var(--soil-deep);
}

@keyframes em-pulse {
    0% { box-shadow: 0 0 0 0 rgba(47, 107, 67, 0.5); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(47, 107, 67, 0); }
}

.em-countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 18px 0;
}

.em-countdown div {
    padding: 10px 4px 8px;
    text-align: center;
    background: var(--paper);
    border-radius: 14px;
}

.em-countdown span {
    display: block;
    font-family: var(--display);
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.em-countdown small {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.em-countdown.is-over span {
    color: var(--ink-3);
}

.em-window-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.em-deadline {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ink-2);
}

.em-deadline strong {
    display: block;
    color: var(--ink);
}

/* Photo collage: arch, orb, sun */
.em-hero-art {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 4 / 5;
    justify-self: end;
    isolation: isolate;
}

.em-hero-art figure {
    margin: 0;
    overflow: hidden;
}

.em-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-arch {
    position: absolute;
    inset: 0 0 9% 13%;
    z-index: 1;
    border-radius: 999px 999px 32px 32px;
    box-shadow: var(--shadow);
}

.em-arch img {
    object-position: 36% 50%;
}

.em-orb {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 46%;
    aspect-ratio: 1;
    border: 10px solid var(--paper);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.em-sun {
    position: absolute;
    top: -3%;
    right: -7%;
    z-index: 0;
    width: 36%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--sun);
}

.em-badge {
    position: absolute;
    right: -5%;
    bottom: 20%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 18px 12px 14px;
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.em-badge strong {
    font-family: var(--display);
    font-size: 2.4rem;
    line-height: 1;
    color: var(--soil);
}

.em-badge span {
    max-width: 11ch;
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--ink-2);
}

/* --- Sections ------------------------------------------------------------ */

.em-section {
    padding-block: clamp(56px, 8vw, 104px);
}

.em-section-head {
    max-width: 640px;
    margin-bottom: clamp(32px, 5vw, 52px);
}

.em-section-head-split {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px 40px;
}

.em-section-lede {
    max-width: 42ch;
    margin: 0;
    color: var(--ink-2);
}

/* Steps: staggered cards */
.em-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.em-step {
    padding: clamp(24px, 3vw, 32px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.em-step:nth-child(2) {
    margin-top: 40px;
    border-radius: 120px 120px var(--radius-lg) var(--radius-lg);
    padding-top: 48px;
}

.em-step:nth-child(3) {
    margin-top: 80px;
}

.em-step-num {
    display: block;
    margin-bottom: 20px;
    font-family: var(--display);
    font-size: 3.2rem;
    font-style: italic;
    line-height: 1;
    color: var(--soil);
}

.em-step h3 {
    margin: 0 0 8px;
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
}

.em-step p {
    margin: 0;
    color: var(--ink-2);
}

/* Stories: bento of photos */
.em-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(6, 118px);
    gap: 16px;
}

.em-tile {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--paper-deep);
}

.em-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.em-tile:hover img {
    transform: scale(1.04);
}

.em-tile figcaption {
    position: absolute;
    left: 14px;
    bottom: 14px;
    right: 14px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(23, 34, 46, 0.58);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.em-tile-a { grid-column: 1 / 8; grid-row: 1 / 4; }
.em-tile-b { grid-column: 8 / 13; grid-row: 1 / 7; border-radius: 999px 999px var(--radius-lg) var(--radius-lg); }
.em-tile-b img { object-position: 50% 30%; }
.em-tile-c { grid-column: 1 / 5; grid-row: 4 / 7; }
.em-tile-c img { object-position: 50% 60%; }

.em-quote {
    grid-column: 5 / 8;
    grid-row: 4 / 7;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px;
    background: var(--soil);
    color: #fff;
}

.em-quote blockquote {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    font-style: italic;
    line-height: 1.2;
}

.em-faces {
    display: flex;
    padding-left: 12px;
}

.em-faces img {
    width: 54px;
    height: 54px;
    margin-left: -12px;
    object-fit: cover;
    border: 3px solid var(--soil);
    border-radius: 50%;
}

.em-quote-foot {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Mission & vision */
.em-promise {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.em-promise-card {
    padding: clamp(28px, 4vw, 48px);
    border-radius: var(--radius-lg);
}

.em-promise-card .em-kicker {
    color: inherit;
    opacity: 0.8;
}

.em-promise-mission {
    background: var(--blue-deep);
    color: var(--paper);
    border-top-right-radius: 140px;
}

.em-promise-vision {
    background: var(--sun-soft);
    color: var(--ink);
    border-top-left-radius: 140px;
}

.em-promise-text {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    line-height: 1.25;
}

.em-promise-more {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 4px;
}

/* About page */
.em-hero-about .em-lede {
    max-width: 52ch;
}

.em-hero-about .em-arch img {
    object-position: 50% 30%;
}

.em-hero-about .em-orb img {
    object-position: 60% 50%;
}

.em-about-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
    margin-bottom: clamp(36px, 5vw, 56px);
}

.em-about-text p {
    margin: 0 0 1em;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--ink-2);
}

.em-faces-wall {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.em-faces-wall img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.em-faces-wall li:nth-child(odd) img {
    border-radius: 50%;
}

.em-faces-wall li:nth-child(3n) img {
    border-radius: 999px 999px var(--radius) var(--radius);
}

.em-faces-wall li:nth-child(even) {
    margin-top: 28px;
}

/* --- Footer: an inset card ---------------------------------------------- */

.em-footer-wrap {
    margin-block: clamp(24px, 6vw, 72px) 20px;
}

.em-footer {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
    padding: clamp(28px, 5vw, 56px);
    background: var(--ink);
    color: #e9e1d2;
    border-radius: 32px;
}

.em-logo-plate {
    display: inline-block;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: var(--paper);
    border-radius: 16px;
}

.em-logo-plate img {
    height: 40px;
    width: auto;
}

.em-footer p {
    margin: 0;
    max-width: 40ch;
    color: #c9c2b5;
}

.em-footer-title {
    margin: 4px 0 14px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sun);
}

.em-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.em-footer li + li {
    margin-top: 8px;
}

.em-footer a {
    color: #e9e1d2;
    text-decoration: none;
}

.em-footer a:hover {
    color: var(--sun-soft);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.em-body .em-footer-legal {
    grid-column: 1 / -1;
    max-width: none;
    padding-top: 8px;
    font-size: 0.85rem;
    color: #9aa3ab;
}

/* --- Reveal on scroll (only when JS is running) ------------------------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 980px) {
    .em-hero {
        grid-template-columns: 1fr;
    }

    .em-hero-art {
        justify-self: center;
        max-width: 460px;
    }

    .em-steps {
        grid-template-columns: 1fr;
    }

    .em-step:nth-child(2),
    .em-step:nth-child(3) {
        margin-top: 0;
    }

    .em-bento {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
    }

    .em-tile-a,
    .em-tile-b,
    .em-tile-c,
    .em-quote {
        grid-column: auto;
        grid-row: auto;
    }

    .em-tile-a {
        grid-column: 1 / -1;
        aspect-ratio: 16 / 10;
    }

    .em-tile-b,
    .em-tile-c {
        aspect-ratio: 3 / 4;
    }

    .em-quote {
        grid-column: 1 / -1;
        gap: 20px;
    }

    .em-about-grid,
    .em-footer {
        grid-template-columns: 1fr 1fr;
    }

    .em-about-grid > :first-child,
    .em-footer-brand {
        grid-column: 1 / -1;
    }

    .em-faces-wall {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 860px) {
    .em-nav {
        padding-left: 14px;
    }

    .em-brand img {
        height: 34px;
    }

    .em-nav-toggle {
        display: inline-flex;
    }

    .em-nav-links {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 24px;
        box-shadow: var(--shadow);
    }

    .em-nav.is-open .em-nav-links {
        display: flex;
    }

    .em-nav-cta {
        margin: 4px 0 0;
    }

    .em-nav-cta .em-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .em-promise,
    .em-about-grid,
    .em-footer {
        grid-template-columns: 1fr;
    }

    .em-promise-card {
        border-radius: var(--radius-lg);
    }

    .em-bento {
        grid-template-columns: 1fr;
    }

    .em-tile-b,
    .em-tile-c {
        aspect-ratio: 4 / 3;
    }

    .em-tile-b {
        border-radius: var(--radius-lg);
    }

    .em-badge {
        right: 0;
    }

    .em-sun {
        right: -2%;
    }

    .em-faces-wall li:nth-child(even) {
        margin-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .em-status-open::before {
        animation: none;
    }

    .em-tile img,
    .em-btn,
    .em-btn svg,
    .em-link svg {
        transition: none;
    }
}
