/* ==========================================================
   ws-home.css
   Front page. Template-scoped, front page only.
   Owns wshome prefix. Only main.css brand tokens shared.
   Retuned from Archivo comp to Lato, same as A11y landing.
   ========================================================== */

/* === Tokens. Home only === */
:root {
    /* Site gutter. Edges match header and footer */
    --wshome-gutter: 24px;
    --wshome-max: 1140px;
    /* Header bar height. Hero pulls up by this */
    --wshome-header-h: 80px;
    /* Header plus air. Anchors land below bar */
    --wshome-anchor: 96px;
    /* Hero dark both themes. Not role tokens on purpose */
    --wshome-hero-bg: var(--ws-charcoal);
    --wshome-hero-fade: rgba(28, 28, 30, 0.85);
    --wshome-hero-clear: rgba(28, 28, 30, 0);
    --wshome-hero-line: #34343A;
    --wshome-hero-edge: rgba(255, 255, 255, 0.4);
    /* Paper. Reserved for testimonial section */
    --wshome-section: var(--ws-tint);
    /* CTA box dark both themes. Page rhythm survives flip */
    --wshome-band-bg: var(--ws-charcoal);
    --wshome-band-fg: var(--ws-white);
    /* Grey on charcoal 7.6:1. Light grey too loud */
    --wshome-band-muted: var(--ws-grey);
}

/* Dark page is charcoal. Box steps up one so it still reads.
   Section tint matches A11y landing */
[data-theme="dark"] {
    --wshome-section: #202024;
    --wshome-band-bg: var(--ws-charcoal-darkmode);
}

/* === Page shell === */
/* Footer floats up without this */
.wshome { flex: 1 0 auto; }

/* Sticky header hid focus and anchor targets.
   WCAG 2.4.11. Covers #services too. Front page only */
html { scroll-padding-top: var(--wshome-anchor); }

/* === Header === */
/* Sticky, home only. Dark both themes, sits on hero.
   Clear at top so photo runs under it. Solid once scrolled */
.wshome-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: transparent;
    /* Shadow, not border. Border added 1px, hero pull-up missed it */
    box-shadow: 0 1px 0 transparent;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.wshome-header.is-stuck {
    background: var(--wshome-hero-bg);
    box-shadow: 0 1px 0 var(--wshome-hero-line);
}
/* Admin bar covers sticky top when logged in */
.admin-bar .wshome-header { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .wshome-header { top: 46px; }
}
/* Admin bar scrolls away under 600 */
@media (max-width: 600px) {
    .admin-bar .wshome-header { top: 0; }
}

/* Fixed height. Hero pulls up by same amount */
.wshome-header__inner {
    max-width: var(--wshome-max);
    height: var(--wshome-header-h);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.wshome-header__brand {
    display: block;
    flex: none;
    color: var(--ws-white);
}
.wshome-header__brand:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 4px; }
/* Full lockup desktop. Matches site header weight */
.wshome-header__lockup { display: block; width: auto; height: 40px; }
.wshome-header__mark { display: none; width: 32px; height: 32px; }

.wshome-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
/* Tracking matches switch labels. Grey on charcoal 7.6:1 */
.wshome-nav__link {
    padding: 8px 0;
    font-family: var(--ws-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    line-height: 18px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ws-grey);
    transition: color 0.2s ease;
}
@media (hover: hover) {
    .wshome-nav__link:hover { color: var(--ws-white); }
}
.wshome-nav__link:focus-visible {
    color: var(--ws-white);
    outline: 2px solid var(--ws-accent);
    outline-offset: 2px;
}
.wshome-nav__cta { white-space: nowrap; }

/* === Hero === */
/* Charcoal both themes. Photo right, copy left.
   Pulled up under header so photo reaches top edge */
.wshome-hero {
    position: relative;
    margin-top: calc(-1 * var(--wshome-header-h));
    background: var(--wshome-hero-bg);
    color: var(--ws-white);
    overflow: hidden;
}

.wshome-hero__photo {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 64%;
}
/* Subjects sit left of center. Crop keeps them */
.wshome-hero__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 42% 50%;
}
/* Charcoal bleeds into photo. Top fade keeps nav legible
   over bright streak (was 2:1). Side fade covers station
   sign. Bottom melts into section edge */
.wshome-hero__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, var(--wshome-hero-bg) 0%, var(--wshome-hero-fade) 9%, var(--wshome-hero-clear) 24%),
        linear-gradient(90deg, var(--wshome-hero-bg) 0%, var(--wshome-hero-fade) 26%, var(--wshome-hero-clear) 60%),
        linear-gradient(0deg, var(--wshome-hero-bg) 0%, var(--wshome-hero-clear) 22%);
}

.wshome-hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--wshome-max);
    margin: 0 auto;
    padding: calc(var(--wshome-header-h) + clamp(56px, 8vw, 112px)) 24px clamp(88px, 10vw, 136px);
}
/* Measure caps on headline and lead */
.wshome-hero__copy { max-width: 680px; }

.wshome-hero__h1 {
    max-width: 540px;
    margin: 0;
    font-size: clamp(2.6rem, 4.6vw, 4.25rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.02em;
    color: var(--ws-white);
    text-wrap: balance;
}
/* Lime as display text. Large, on charcoal, 11:1 */
.wshome-hero__accent { color: var(--ws-accent); }

.wshome-hero__lead {
    max-width: 540px;
    margin: 24px 0 0;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--ws-light-grey);
    text-wrap: pretty;
}
.wshome-hero__actions { margin: 36px 0 0; }

/* Secondary on dark. Neutral variant reads text color,
   black in light mode. White edge, lime on hover */
.wshome-hero .wshome-hero__alt {
    background: transparent;
    color: var(--ws-white);
    border-color: var(--wshome-hero-edge);
}
.wshome-hero .wshome-hero__alt:hover,
.wshome-hero .wshome-hero__alt:focus {
    background: transparent;
    color: var(--ws-white);
    border-color: var(--ws-accent);
}

/* Copy is just there. Only buttons rise in, one after other.
   CSS only, no-JS still lands */
.wshome-hero__actions .ws-button {
    opacity: 0;
    animation: wshomeRise 0.5s var(--ws-ease) 0.2s forwards;
}
.wshome-hero__actions .ws-button + .ws-button { animation-delay: 0.35s; }

@keyframes wshomeRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .wshome-hero__actions .ws-button { opacity: 1; animation: none; }
}

/* Small laptops. Photo ran under copy, headline 2.3:1. Narrower photo */
@media (min-width: 1024px) and (max-width: 1279px) {
    .wshome-hero__photo { width: 52%; }
}

/* Stack under 1024. Tablets too, photo would sit under copy.
   Photo becomes strip under copy */
@media (max-width: 1023px) {
    .wshome-hero { display: flex; flex-direction: column; }
    .wshome-hero__inner {
        order: 1;
        width: 100%;
        padding: calc(var(--wshome-header-h) + 40px) var(--wshome-gutter) 40px;
    }
    .wshome-hero__photo {
        order: 2;
        position: relative;
        width: 100%;
        height: clamp(240px, 45vw, 380px);
    }
    .wshome-hero__photo img { object-position: 40% 50%; }
    .wshome-hero__photo::after {
        background: linear-gradient(180deg, var(--wshome-hero-bg) 0%, var(--wshome-hero-clear) 35%, var(--wshome-hero-clear) 75%, var(--wshome-hero-bg) 100%);
    }
}

/* === Sections === */
.wshome-section {
    padding: clamp(64px, 8vw, 96px) var(--wshome-gutter);
    transition: background-color 0.3s ease;
}

.wshome-section--tint {
    background: var(--wshome-section);
    border-top: 1px solid var(--ws-border);
}

/* CTA is a box, not a band. Hero owns full bleed.
   Box hands off to footer. No shadow: dark on white
   separates itself, shadow under charcoal reads muddy */
.wshome-section--band {
    padding-top: 0;
    padding-bottom: clamp(32px, 4vw, 48px);
    text-align: center;
}
.wshome-section--band .wshome-cta {
    padding: clamp(56px, 7vw, 88px) 32px;
    background: var(--wshome-band-bg);
    color: var(--wshome-band-fg);
    border-radius: var(--ws-radius);
}
/* Box sits closer to last row */
.wshome-section--rule { padding-bottom: clamp(48px, 6vw, 72px); }

/* Content edge matches header logo and footer rule.
   Was 24px wider each side */
.wshome-wrap { max-width: calc(var(--wshome-max) - 48px); margin: 0 auto; }

/* === Type === */
/* Sizes match A11y landing. Lato 900 runs wide,
   token h2 at 48px wraps four lines here */
.wshome-h2 {
    font-size: clamp(1.7rem, 2.4vw + 0.5rem, 2.55rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ws-heading);
    text-wrap: balance;
}
.wshome-section--band .wshome-h2 { color: var(--wshome-band-fg); }

/* === Services index === */
/* Light: charcoal to white, line invisible.
   Dark: hero and page share charcoal. Line splits */
.wshome-section--rule { border-top: 1px solid var(--ws-border); }

.wshome-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 48px;
    align-items: end;
    margin: 0 0 48px;
}
.wshome-intro .ws-tag { margin-bottom: 12px; }
.wshome-intro__lead {
    margin: 0;
    max-width: 46ch;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--ws-muted);
    text-wrap: pretty;
}

/* Highlight paused until in view. Wipe ran off-screen on load.
   Beats main.css .js .ws-highlight--wipe at (0,2,0).
   Reduced motion in main.css lands full band */
.js .wshome-hl:not(.is-revealed) { animation-play-state: paused; }

/* Heavy top rule opens list. Hairlines between rows.
   Rules carry structure. No boxes */
.wshome-index {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 2px solid var(--ws-heading);
}
/* Number, name, body, includes. Skim left column, read across */
.wshome-index__row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 0.95fr);
    gap: 32px;
    padding: 40px 0;
    border-bottom: 1px solid var(--ws-border);
    align-items: start;
}
/* Optical. Sits on name cap height */
.wshome-index__num {
    padding-top: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--ws-muted);
}
.wshome-index__name {
    margin: 0;
    font-size: clamp(1.5rem, 1.2vw + 1rem, 1.9rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--ws-heading);
}
.wshome-index__body {
    margin: 0;
    color: var(--ws-muted);
    line-height: 1.6;
    /* No one-word last lines */
    text-wrap: pretty;
}
/* main.css ul padding and margin stripped */
.wshome-index__inc {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.wshome-index__inc li {
    position: relative;
    padding-left: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--ws-text);
}
/* Small lime square. Radius-sm, brand corner */
.wshome-index__inc li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 8px;
    height: 8px;
    background: var(--ws-accent);
    border-radius: var(--ws-radius-sm);
}

/* Stack under 860. Four columns crush body copy */
@media (max-width: 860px) {
    .wshome-intro { grid-template-columns: 1fr; gap: 16px; }
    .wshome-index__row { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
    .wshome-index__num { padding-top: 0; }
    .wshome-index__inc { margin-top: 8px; }
}

/* === Pre-footer CTA === */
.wshome-cta__lead {
    max-width: 520px;
    margin: 16px auto 32px;
    font-size: clamp(1.05rem, 0.55vw + 0.95rem, 1.2rem);
    line-height: 1.55;
    color: var(--wshome-band-muted);
    text-wrap: balance;
}

/* === Phones === */
/* Mark replaces lockup. All three nav items keep room */
@media (max-width: 600px) {
    :root { --wshome-header-h: 64px; }
    .wshome-header__inner { gap: 16px; }
    .wshome-header__lockup { display: none; }
    .wshome-header__mark { display: block; }
    .wshome-nav { gap: 16px; }
    .wshome-nav__link { letter-spacing: 1px; }
}
/* 320 class phones. Nav wrapped, page scrolled sideways */
@media (max-width: 374px) {
    .wshome-header__inner { padding: 0 16px; gap: 12px; }
    .wshome-nav { gap: 12px; }
    .wshome-nav__link { letter-spacing: 0.5px; }
    .wshome-nav__cta { padding-left: 12px; padding-right: 12px; letter-spacing: 2px; }
}
