/* ═══════════════════════════════════════════════════════════
   OAKHURST LABS — FOOTHILL SURVEY
   Colors of the hills around Oakhurst in summer: dry grass gold,
   oak shade, granite. The live terrain map carries the page.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. FONTS ──────────────────────────────────────────────── */
/* Self-hosted latin subsets of two variable fonts (SIL Open Font License) */
@font-face {
    font-family: 'Big Shoulders Display';
    src: url('/fonts/big-shoulders-display-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
    font-family: 'Archivo';
    src: url('/fonts/archivo-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* Fallbacks sized to match, so nothing reflows when the fonts arrive */
@font-face {
    font-family: 'Big Shoulders Fallback';
    src: local('Arial');
    size-adjust: 65.5%;
    ascent-override: 100%;
}

@font-face {
    font-family: 'Archivo Fallback';
    src: local('Arial');
    size-adjust: 98.7%;
}

/* ── 2. TOKENS ─────────────────────────────────────────────── */
:root {
    /* Palette */
    --oak: #1D2A22;
    --oak-2: #25352B;
    --grass: #D9A94F;
    --grass-hi: #EBC277;
    --grass-deep: #745215;
    --granite: #E4E2DA;
    --granite-2: #F1F0EB;
    --manzanita: #A5402A;

    /* Text and rules on each ground */
    --on-oak: #E4E2DA;
    --on-oak-muted: rgba(228, 226, 218, 0.7);
    --on-oak-line: rgba(228, 226, 218, 0.16);
    --on-granite: #1D2A22;
    --on-granite-muted: #4E5A51;
    --on-granite-line: rgba(29, 42, 34, 0.18);

    /* Type */
    --font-display: 'Big Shoulders Display', 'Big Shoulders Fallback', sans-serif;
    --font-body: 'Archivo', 'Archivo Fallback', Arial, sans-serif;
    --step--1: 0.875rem;
    --step-0: 1.0625rem;
    --step-1: 1.25rem;
    --step-2: clamp(1.6rem, 2.4vw, 2.1rem);
    --step-3: clamp(2.6rem, 5.5vw, 4.6rem);
    --step-hero: clamp(4.2rem, 13vw, 12.5rem);

    /* Layout */
    --max-width: 1240px;
    --gutter: clamp(16px, 4vw, 40px);
    --nav-h: 68px;
    --section-pad: clamp(80px, 11vw, 150px);
    --radius: 4px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 3. RESET & BASE ───────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    font-size: 16px;
}

body {
    background: var(--oak);
    color: var(--on-oak);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

img,
svg,
canvas {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

::selection {
    background: var(--grass);
    color: var(--oak);
}

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

.section-granite :focus-visible,
.contact-form :focus-visible {
    outline-color: var(--oak);
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 3000;
    background: var(--grass);
    color: var(--oak);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#main:focus {
    outline: none;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ── 4. NAVBAR ─────────────────────────────────────────────── */
.navbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: var(--nav-h);
    transition: background-color 0.4s, border-color 0.4s, backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled,
.menu-open .navbar {
    background: rgba(29, 42, 34, 0.86);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom-color: var(--on-oak-line);
}

.nav-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 18px;
    height: 16px;
    fill: var(--grass);
    transition: transform 0.5s var(--ease-out);
}

.nav-logo:hover .logo-mark {
    transform: translateY(-2px);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--on-oak);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-links a {
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--on-oak-muted);
    padding: 6px 0;
    transition: color 0.25s;
}

.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--grass);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--on-oak);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links .nav-cta {
    color: var(--grass);
    border: 1px solid rgba(217, 169, 79, 0.6);
    border-radius: var(--radius);
    padding: 9px 18px;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

.nav-links .nav-cta:hover {
    background: var(--grass);
    border-color: var(--grass);
    color: var(--oak);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    position: relative;
}

.nav-toggle span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--on-oak);
    transition: transform 0.35s var(--ease-out);
}

.nav-toggle span:first-child {
    top: 17px;
}

.nav-toggle span:last-child {
    top: 25px;
}

.menu-open .nav-toggle span:first-child {
    transform: translateY(4px) rotate(45deg);
}

.menu-open .nav-toggle span:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* ── 5. HERO ───────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: max(640px, 100svh);
    display: grid;
    align-items: end;
    overflow: hidden;
    background: var(--oak);
    isolation: isolate;
}

.hero-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    touch-action: pan-y;
}

/* Darken the map behind the words so they stay readable */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(29, 42, 34, 0.9) 0%, rgba(29, 42, 34, 0.62) 34%, rgba(29, 42, 34, 0) 68%),
        linear-gradient(0deg, rgba(29, 42, 34, 0.85) 0%, rgba(29, 42, 34, 0) 42%),
        linear-gradient(180deg, rgba(29, 42, 34, 0.7) 0%, rgba(29, 42, 34, 0) 18%);
}

.hero.is-probing {
    cursor: none;
}

.hero.is-probing a {
    cursor: pointer;
}

.hero-inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 48px) var(--gutter) clamp(48px, 9vh, 104px);
    pointer-events: none;
}

.hero-inner a {
    pointer-events: auto;
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--step-hero);
    font-weight: 850;
    line-height: 0.84;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    max-width: 6.2em;
    margin-left: -0.04em;
    color: var(--on-oak);
}

.hero-lede {
    max-width: 34ch;
    margin-top: clamp(24px, 4vh, 40px);
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    line-height: 1.45;
    color: var(--on-oak);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    margin-top: clamp(28px, 4.5vh, 44px);
}

/* Page-load sequence: the title gains weight while the map draws in. The
   title is never hidden, so it paints (and counts for LCP) right away; only
   the map readout waits for the elevation data. */
.hero-title {
    animation: titleWeight 1.9s var(--ease-out) both;
}

.hero-lede {
    animation: rise 1s var(--ease-out) 0.5s both;
}

.hero-actions {
    animation: rise 1s var(--ease-out) 0.65s both;
}

.js .hero:not(.is-ready) .probe {
    opacity: 0;
}

.hero.is-ready .probe {
    animation: rise 1s var(--ease-out) 0.2s both;
}

/* Survey reticle that follows the pointer over the map */
.reticle {
    --x: -100px;
    --y: -100px;
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.hero.is-ready .reticle {
    opacity: 1;
}

.reticle-h,
.reticle-v {
    position: absolute;
    background: rgba(235, 194, 119, 0.28);
}

.reticle-h {
    left: 0;
    right: 0;
    height: 1px;
    top: 0;
    transform: translateY(var(--y));
}

.reticle-v {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 0;
    transform: translateX(var(--x));
}

.reticle-ring {
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid var(--grass-hi);
    border-radius: 50%;
    transform: translate(var(--x), var(--y));
}

.reticle-ring::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: var(--grass-hi);
}

.reticle-tag {
    position: absolute;
    left: 42px;
    top: -2px;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--oak);
    background: var(--grass-hi);
    padding: 3px 8px;
    border-radius: 3px;
}

/* Readout of the point under the reticle */
.probe {
    position: absolute;
    right: var(--gutter);
    bottom: clamp(48px, 9vh, 104px);
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
    pointer-events: none;
}

.probe-caption {
    font-size: var(--step--1);
    color: var(--on-oak-muted);
}

.probe-elev {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--grass-hi);
}

.probe-coords {
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
    color: var(--on-oak-muted);
}

/* ── 6. BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    border-radius: var(--radius);
    transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease-out);
}

.btn-primary {
    background: var(--grass);
    color: var(--oak);
    padding: 17px 28px;
}

.btn-primary:hover {
    background: var(--grass-hi);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-quiet {
    color: var(--on-oak);
    padding: 17px 0;
    background:
        linear-gradient(var(--grass), var(--grass)) 0 calc(100% - 12px) / 100% 1px no-repeat;
    transition: color 0.25s, background-size 0.4s var(--ease-out);
}

.btn-quiet:hover {
    color: var(--grass-hi);
    background-size: 100% 2px;
}

/* ── 7. SECTION SHELLS ─────────────────────────────────────── */
.section {
    padding: var(--section-pad) 0;
}

.section-granite {
    background: var(--granite);
    color: var(--on-granite);
}

.section-oak {
    background: var(--oak);
    color: var(--on-oak);
}

.sec-title {
    font-family: var(--font-display);
    font-size: var(--step-3);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.005em;
    text-transform: uppercase;
}

.sec-desc {
    margin-top: 20px;
    max-width: 42ch;
    font-size: var(--step-1);
    line-height: 1.5;
}

.section-granite .sec-desc {
    color: var(--on-granite-muted);
}

.section-oak .sec-desc {
    color: var(--on-oak-muted);
}

/* ── 8. SERVICES ───────────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px clamp(40px, 6vw, 96px);
}

.sec-intro {
    position: sticky;
    top: calc(var(--nav-h) + 40px);
    align-self: start;
}

.service {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 20px clamp(28px, 4vw, 56px);
    padding: clamp(32px, 4vw, 48px) 0;
    border-top: 1px solid var(--on-granite-line);
}

.service:first-child {
    border-top: 0;
    padding-top: 0;
}

.service h3 {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1;
    margin-bottom: 14px;
}

.service-head > p {
    max-width: 40ch;
}

.service-fact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-weight: 600;
}

.service-fact::before {
    content: '';
    width: 12px;
    height: 11px;
    background: var(--grass-deep);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    flex: none;
}

.service-items {
    display: grid;
    gap: 12px;
    align-content: start;
    padding-top: 6px;
    font-size: 0.98rem;
    color: var(--on-granite-muted);
}

.service-items li {
    position: relative;
    padding-left: 22px;
}

.service-items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 12px;
    height: 1px;
    background: var(--on-granite);
}

/* Link from the Websites service down to the portfolio */
.service-link {
    display: inline-block;
    margin-top: 14px;
    font-weight: 600;
    color: var(--grass-deep);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: text-decoration-thickness 0.2s;
}

.service-link:hover {
    text-decoration-thickness: 2px;
}

/* ── 8b. WORK (website portfolio) ──────────────────────────── */
.section-paper {
    background: var(--granite-2);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: clamp(40px, 5vw, 64px) clamp(24px, 3vw, 40px);
    margin-top: clamp(40px, 6vw, 72px);
}

/* The whole card is the link's hit area (see .work-name a::after) */
.work {
    position: relative;
}

.work-shot {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--granite);
    box-shadow:
        0 0 0 1px var(--on-granite-line),
        0 18px 40px -24px rgba(29, 42, 34, 0.45);
    transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.work-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.7s var(--ease-out);
}

.work-name {
    margin-top: 22px;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}

.work-name a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.work-name a:focus-visible {
    outline: none;
}

.work-name a:focus-visible::after {
    outline: 2px solid var(--grass-deep);
    outline-offset: 8px;
}

.work-what {
    margin-top: 6px;
    color: var(--on-granite-muted);
}

.work-host {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--grass-deep);
}

/* North-east arrow: the link leaves this site */
.work-host::after {
    content: '';
    width: 10px;
    height: 10px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M1.5 8.5 8.5 1.5M3 1.5h5.5V7'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.3s var(--ease-out);
}

@media (hover: hover) {
    .work:hover .work-shot {
        transform: translateY(-4px);
        box-shadow:
            0 0 0 1px var(--on-granite-line),
            0 26px 50px -24px rgba(29, 42, 34, 0.55);
    }

    .work:hover .work-shot img {
        transform: scale(1.035);
    }

    .work:hover .work-host::after {
        transform: translate(2px, -2px);
    }
}

/* Cards rise in as they scroll into view */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) and (min-width: 641px) {
        .work {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }
    }
}

/* Phones: one swipeable row instead of a very long column */
@media (max-width: 640px) {
    .work-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 84%;
        gap: 16px;
        margin-inline: calc(var(--gutter) * -1);
        padding: 4px var(--gutter) 20px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--gutter);
        scrollbar-width: none;
    }

    .work-grid::-webkit-scrollbar {
        display: none;
    }

    .work {
        scroll-snap-align: start;
    }

    .work-name {
        font-size: 1.35rem;
    }
}

/* ── 9. PROCESS ────────────────────────────────────────────── */
.steps-wrap {
    position: relative;
    margin-top: clamp(48px, 7vw, 88px);
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px clamp(24px, 3vw, 48px);
}

.steps-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 30px;
    height: 2px;
    background: var(--grass);
    transform-origin: left center;
}

.step-no {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--oak);
    border: 2px solid var(--grass);
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--grass-hi);
    margin-bottom: 28px;
}

.step h3 {
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
}

.step p {
    color: var(--on-oak-muted);
    max-width: 30ch;
}

/* The line draws itself as the steps scroll into view */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .steps-line {
            animation: drawAcross linear both;
            animation-timeline: view();
            animation-range: entry 30% cover 55%;
        }

        .step-no {
            animation: stepOn linear both;
            animation-timeline: view();
            animation-range: entry 60% cover 50%;
        }
    }
}

/* ── 10. ABOUT / TEAM ───────────────────────────────────────── */
.about-top {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px clamp(40px, 6vw, 96px);
    align-items: center;
}

.about-intro {
    margin-top: 24px;
    max-width: 44ch;
    font-size: var(--step-1);
    line-height: 1.5;
}

.area {
    margin: 0;
}

.area-map {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: #DCD3B4;
}

.area figcaption {
    margin-top: 12px;
    font-size: var(--step--1);
    color: var(--on-granite-muted);
}

.team {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px clamp(28px, 4vw, 56px);
    margin-top: clamp(64px, 9vw, 112px);
    padding-top: clamp(40px, 5vw, 56px);
    border-top: 1px solid var(--on-granite-line);
}

.person h3 {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1;
}

.person-role {
    margin: 8px 0 18px;
    font-weight: 600;
    color: var(--grass-deep);
}

.person p:last-child {
    font-size: 0.98rem;
    color: var(--on-granite-muted);
}

/* ── 11. CONTACT ───────────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 48px clamp(40px, 7vw, 112px);
    align-items: start;
}

.contact-facts {
    display: grid;
    gap: 14px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--on-oak-line);
    color: var(--on-oak-muted);
}

.contact-facts strong {
    color: var(--on-oak);
    font-weight: 600;
}

.contact-form {
    display: grid;
    gap: 22px;
    background: var(--granite);
    color: var(--on-granite);
    padding: clamp(24px, 4vw, 44px);
    border-radius: var(--radius);
}

.hp-field {
    position: absolute;
    left: -9999px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    font: inherit;
    color: var(--on-granite);
    background: var(--granite-2);
    border: 1px solid rgba(29, 42, 34, 0.28);
    border-radius: var(--radius);
    padding: 13px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: rgba(29, 42, 34, 0.5);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
    outline: none;
    border-color: var(--oak);
    box-shadow: 0 0 0 3px rgba(217, 169, 79, 0.55);
}

.btn-submit {
    justify-self: start;
    view-transition-name: submit-button;
}

.btn-submit:disabled {
    cursor: progress;
    opacity: 0.75;
    transform: none;
}

.btn-submit.is-success {
    background: var(--oak);
    color: var(--grass-hi);
}

.btn-submit.is-error {
    background: var(--manzanita);
    color: var(--granite-2);
}

.form-status {
    min-height: 1.6em;
    font-size: 0.95rem;
    color: var(--on-granite-muted);
}

.form-status.is-success {
    color: var(--on-granite);
    font-weight: 600;
}

.form-status.is-error {
    color: var(--manzanita);
    font-weight: 600;
}

.form-note {
    font-size: var(--step--1);
    color: var(--on-granite-muted);
}

.form-note a,
.prose a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.form-note a:hover,
.prose a:hover {
    text-decoration-thickness: 2px;
}

/* ── 12. FOOTER ────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--on-oak-line);
    padding: 44px 0 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px 32px;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.footer-links a {
    color: var(--on-oak-muted);
    transition: color 0.25s;
}

.footer-links a:hover {
    color: var(--grass-hi);
}

.footer-meta {
    font-size: var(--step--1);
    color: var(--on-oak-muted);
}

.footer-meta:last-child {
    text-align: right;
}

/* ── 13. KEYFRAMES ─────────────────────────────────────────── */
/* Weight only: thinner glyphs are narrower, so the title never wraps
   differently mid-animation and nothing below it moves */
@keyframes titleWeight {
    from {
        font-weight: 120;
    }

    to {
        font-weight: 850;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes drawAcross {
    from {
        scale: 0 1;
    }

    to {
        scale: 1 1;
    }
}

@keyframes drawDown {
    from {
        scale: 1 0;
    }

    to {
        scale: 1 1;
    }
}

@keyframes stepOn {
    from {
        background: var(--oak);
        color: var(--on-oak-muted);
        border-color: var(--on-oak-line);
    }

    to {
        background: var(--oak);
        color: var(--grass-hi);
        border-color: var(--grass);
    }
}

::view-transition-old(submit-button),
::view-transition-new(submit-button) {
    animation-duration: 0.35s;
}

/* ── 14. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .sec-intro {
        position: static;
    }

    .about-top,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .team {
        grid-template-columns: 1fr;
        max-width: 68ch;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 28px;
        background: rgba(29, 42, 34, 0.97);
        border-bottom: 1px solid var(--on-oak-line);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, transform 0.4s var(--ease-out), visibility 0.3s;
    }

    .menu-open .nav-links {
        transform: none;
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        display: block;
        font-family: var(--font-display);
        font-size: 2rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--on-oak);
        padding: 12px 0;
        border-bottom: 1px solid var(--on-oak-line);
    }

    .nav-links a:not(.nav-cta)::after {
        display: none;
    }

    .nav-links .nav-cta {
        margin-top: 20px;
        text-align: center;
        font-family: var(--font-body);
        font-size: 1.05rem;
        text-transform: none;
        padding: 16px;
        background: var(--grass);
        color: var(--oak);
    }

    .hero::before {
        background:
            linear-gradient(0deg, rgba(29, 42, 34, 0.94) 0%, rgba(29, 42, 34, 0.7) 45%, rgba(29, 42, 34, 0) 75%),
            linear-gradient(180deg, rgba(29, 42, 34, 0.75) 0%, rgba(29, 42, 34, 0) 20%);
    }

    .probe {
        top: calc(var(--nav-h) + 16px);
        bottom: auto;
    }

    .probe-elev {
        font-size: 2rem;
    }

    .service {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .step {
        display: grid;
        grid-template-columns: 60px 1fr;
        column-gap: 24px;
    }

    .step-no {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .steps-line {
        left: 29px;
        right: auto;
        top: 0;
        bottom: 0;
        width: 2px;
        height: auto;
        transform-origin: center top;
    }

    @supports (animation-timeline: view()) {
        @media (prefers-reduced-motion: no-preference) {
            .steps-line {
                animation-name: drawDown;
                animation-range: entry 20% cover 70%;
            }
        }
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-meta:last-child {
        text-align: left;
    }
}

@media (max-width: 480px) {
    /* Always two lines on phones, so the weight animation can't re-wrap it */
    .hero-title span {
        display: block;
    }

    .hero-actions .btn-primary {
        flex: 1 1 100%;
    }
}

/* ── 15. REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── 16. TEXT PAGES (privacy, 404) ─────────────────────────── */
.subpage .navbar {
    background: var(--oak);
    border-bottom-color: var(--on-oak-line);
}

.page {
    min-height: 70vh;
    padding: calc(var(--nav-h) + clamp(48px, 8vw, 96px)) 0 var(--section-pad);
}


.prose h1 + p {
    margin-top: 24px;
}

.prose-meta {
    margin: 16px 0 40px;
    color: var(--on-granite-muted);
}

.prose h2 {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
    margin: 48px 0 14px;
}

.prose h3 {
    font-size: var(--step-1);
    font-weight: 700;
    margin: 28px 0 8px;
}

.prose > *,
.prose li {
    max-width: 68ch;
}

.prose p + p {
    margin-top: 14px;
}

.prose ul {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    padding-left: 22px;
    list-style: disc;
}

.prose code {
    font-size: 0.92em;
    background: rgba(29, 42, 34, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

.prose .btn {
    margin-top: 16px;
    text-decoration: none;
}
