/* ============================================================
   LANDING PAGE (index.html), restyled in C5.
   A gas-station fold-out map, a motel postcard and a roll of slides: real photos from
   static/images/landing/ (slots, see fragments/landing-photo.html) on warm paper.
   Mobile first (320–430 px), then desktop. Motion: a slow pan on the hero photo and a
   route that draws itself; both stop under prefers-reduced-motion.

   Contents: 1 nav · 2 hero · 3 sections · 4 how it works · 5 split sections · 6 Convoy contact
   sheet · 7 final call · 8 footer · 9 signup modal · 10 night forest · 11 reduced motion
   ============================================================ */

#scout, #leave-now, #convoy, #trips, #memories { scroll-margin-top: 76px; }

/* ============================================================
   1. Nav (solid paper once you scroll; no glass)
   ============================================================ */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: background var(--duration-base) var(--ease-swift),
        box-shadow var(--duration-base) var(--ease-swift),
        border-color var(--duration-base) var(--ease-swift),
        height var(--duration-base) var(--ease-swift);
}

.landing-nav.scrolled {
    height: 62px;
    background: rgba(254, 252, 247, 0.96);
    border-bottom-color: var(--cream-200);
    box-shadow: 0 1px 0 rgba(38, 32, 15, 0.03), 0 8px 28px rgba(38, 32, 15, 0.07);
}

.nav-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-weight: 680;
    letter-spacing: -0.018em;
    color: var(--brown-900);
    text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo-mark {
    color: var(--green-700);
    transition: transform var(--duration-base) var(--ease-spring);
}
.nav-logo:hover .nav-logo-mark { transform: rotate(-8deg) translateY(-1px); }

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    position: relative;
    color: var(--brown-700);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 0;
    transition: color var(--duration-fast) ease;
}

/* Hover underline is a little dotted road */
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg,
        var(--green-700) 0 4px, transparent 4px 9px);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-base) var(--ease-out);
}

.nav-links a:hover { color: var(--green-800); text-decoration: none; }
.nav-links a:hover::after { transform: scaleX(1); }

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

.nav-btn { padding: 9px 20px; font-size: 0.9rem; }

/* Hamburger */
.nav-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--cream-300);
    border-radius: 12px;
    background: var(--cream-50);
    padding: 11px 10px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}
.nav-menu-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--brown-700);
    border-radius: 2px;
    transition: transform var(--duration-base) var(--ease-spring-soft), opacity 0.2s;
}
.nav-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links-login,
.nav-links-signup { display: none; }

/* --- Mobile nav --- */
@media (max-width: 980px) {
    .nav-menu-btn { display: flex; }
    .nav-actions { display: none; }
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px;
        margin: 0 16px;
        background: rgba(254, 252, 247, 0.96);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--cream-300);
        transform-origin: top center;
    }
    .nav-links.is-open {
        display: flex;
        animation: scale-in var(--duration-base) var(--ease-spring-soft);
    }
    .nav-links a {
        color: var(--brown-700);
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 1rem;
    }
    .nav-links a::after { display: none; }
    .nav-links a:hover {
        background: var(--cream-100);
        color: var(--green-700);
    }
    .nav-links-login,
    .nav-links-signup {
        display: block;
        margin-top: 6px;
    }
    .nav-links-signup {
        width: 100%;
        margin-top: 4px;
    }
}

@media (max-width: 900px) { .landing-nav { padding: 0 16px; } }

/* ============================================================
   2. Hero: the photo, the copy on paper, the postcard
   ============================================================ */
.lp-hero { position: relative; padding: 72px 0 0; }
.lp-hero-photo {
    position: relative;
    height: min(58vh, 460px);
    min-height: 260px;
    overflow: hidden;
    background: var(--green-900);
}
.lp-hero-photo img {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    object-fit: cover;
}
.lp-pan { animation: lp-pan 60s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes lp-pan {
    from { transform: translate3d(-2%, 0, 0) scale(1.02); }
    to   { transform: translate3d(2%, -1.5%, 0) scale(1.06); }
}
.lp-hero-photo--empty { background: none; }
.lp-hero-stamp { position: absolute; right: 8%; top: 22%; --stamp-angle: -2deg; }
.lp-hero-sketch { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-hero-sketch .lp-draw { stroke: var(--green-700); stroke-width: 4; stroke-linecap: round; }
.lp-sketch-pin { fill: var(--cream-50); stroke: var(--green-900); stroke-width: 3.6; }

/* The route draws itself once (pathLength=1), then stays. */
.lp-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lp-draw 2.6s var(--ease-out) 0.4s forwards; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }

.lp-hero-inner {
    position: relative;
    max-width: 1180px;
    margin: -56px auto 0;
    padding: 0 16px;
    display: grid;
    gap: 28px;
}
.lp-hero-copy {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
    padding: 24px 20px 22px;
}
.lp-eyebrow { font-weight: 700; font-size: 0.86rem; color: var(--green-700); margin-bottom: 10px; }
.lp-headline {
    font-family: var(--font-display);
    font-weight: 640;
    font-size: clamp(2rem, 1.4rem + 3.4vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-wrap: balance;
}
.lp-headline em { font-style: italic; font-weight: 520; color: var(--green-800); }
.lp-sub { margin-top: 14px; font-size: 1.06rem; line-height: 1.6; color: var(--ink-soft); max-width: 36em; }
.lp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.lp-btn { min-height: 48px; padding: 12px 26px; font-size: 1rem; white-space: nowrap; }
/* The one ink mark on the landing: a hand-drawn underline under "the good stops". */
.lp-ink { position: relative; display: inline-block; white-space: nowrap; }
.lp-ink .tp-ink-mark { position: absolute; left: 0; bottom: -0.08em; width: 100%; height: 0.24em; }
.lp-fine { margin-top: 12px; font-size: 0.86rem; color: var(--color-text-muted); }

/* The example drive as a motel postcard: map paper on top, a ticket stub along the bottom. */
.lp-postcard {
    margin: 0;
    background: var(--tp-mount);
    border-radius: 6px;
    box-shadow: var(--shadow-lift);
    padding: 10px 10px 14px;
    transform: rotate(-1.2deg);
    color: #2c2110;
}
.lp-postcard-map { position: relative; border-radius: 3px; overflow: hidden; aspect-ratio: 44 / 25; }
.lp-postcard-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-draw--card { stroke: #3e7a54; stroke-width: 4.5; stroke-linecap: round; }
.lp-card-stop { fill: #fefcf7; stroke: #1a3425; stroke-width: 2.6; }
.lp-card-start { fill: #3e7a54; stroke: #fefcf7; stroke-width: 3; }
.lp-card-end { fill: #1a3425; }
.lp-postcard-stamp { position: absolute; right: 12px; bottom: 12px; --stamp-angle: -3deg; color: #1a3425; }
.lp-postcard-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 4px 0; }
.lp-postcard-title { font-family: var(--font-display); font-style: italic; font-size: 1.08rem; color: #2c2110; }

@media (min-width: 940px) {
    .lp-hero-photo { height: min(70vh, 620px); }
    .lp-hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; margin-top: -140px; padding: 0 32px; gap: 40px; }
    .lp-hero-copy { padding: 36px 36px 32px; }
    .lp-postcard { margin-top: 70px; }
}

/* ============================================================
   3. Sections
   ============================================================ */
.lp-section { padding: 64px 0; }
.lp-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.lp-head { max-width: 40em; margin-bottom: 28px; }
.lp-head h2, .lp-split-text h2, .lp-cta h2 {
    font-family: var(--font-display);
    font-weight: 620;
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-wrap: balance;
}
.lp-head-sub { margin-top: 12px; font-size: 1.04rem; line-height: 1.6; color: var(--ink-soft); }
@media (min-width: 900px) { .lp-section { padding: 96px 0; } .lp-inner { padding: 0 32px; } }

/* Photo slots: a real photo, or the map paper with a place stamp when the slot is empty. */
.lp-slot { position: relative; margin: 0; overflow: hidden; background: var(--cream-200); }
.lp-slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-slot--empty { background: none; display: grid; place-items: center; }
.lp-slot-stamp { --stamp-angle: -2deg; }

/* ============================================================
   5. Split sections: a photo and a few honest sentences
   ============================================================ */
.lp-split-inner { display: grid; gap: 24px; align-items: center; }
.lp-split-photo { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); box-shadow: var(--shadow-flat); }
.lp-split-text p { margin-top: 12px; font-size: 1.04rem; line-height: 1.65; color: var(--ink-soft); max-width: 34em; }
.lp-split-text .lp-eyebrow { margin: 0 0 8px; }
.lp-split-text .lp-fine { font-size: 0.88rem; }
@media (min-width: 900px) {
    .lp-split-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
    .lp-split--flip .lp-split-photo { order: 2; }
}
.lp-leave { background: var(--cream-200); }

/* Scout in a glovebox notebook: ruled lines, two voices. */
.lp-notebook {
    margin-top: 18px;
    padding: 14px 16px 12px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(180deg, transparent 0 27px, rgba(62, 122, 84, 0.16) 27px 28px),
        var(--tp-mount);
    box-shadow: var(--shadow-flat);
    color: #2c2110;
    display: grid;
    gap: 8px;
}
.lp-notebook p { margin: 0; line-height: 28px; font-size: 1rem; color: #2c2110; }
.lp-note-you { font-family: var(--font-display); font-style: italic; }
.lp-note-scout span { display: inline-block; margin-right: 8px; font-weight: 800; font-size: 0.8rem; color: #3e7a54; }
.lp-departure { margin-top: 18px; display: grid; gap: 10px; }
.lp-departure-line { font-family: var(--font-display); font-style: italic; font-size: 1.06rem; color: var(--ink); margin: 0 !important; }

/* ============================================================
   6. Convoy: a contact sheet of slide mounts (fixed tilts, not random)
   ============================================================ */
.lp-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.lp-sheet-slide {
    aspect-ratio: 4 / 5;
    border: 8px solid var(--tp-mount);
    border-bottom-width: 22px;
    border-radius: 3px;
    box-shadow: var(--shadow-lift);
}
.lp-sheet-slide:nth-child(3n+1) { transform: rotate(-1deg); }
.lp-sheet-slide:nth-child(3n+2) { transform: rotate(0.8deg); }
.lp-sheet-slide:nth-child(3n) { transform: rotate(-0.5deg); }
@media (min-width: 700px) { .lp-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
@media (min-width: 1100px) { .lp-sheet { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ============================================================
   7. Final call: map paper, not a night sky
   ============================================================ */
.lp-cta { padding: 72px 16px 80px; text-align: left; }
.lp-cta-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; justify-items: start; }
@media (min-width: 900px) { .lp-cta { padding: 110px 32px 120px; } }

/* ============================================================
   8. Footer
   ============================================================ */
.site-footer {
    background: var(--brown-900);
    padding: 56px 40px 32px;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 30px;
    border-bottom: 1px dashed rgba(254, 252, 247, 0.14);
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 680;
    color: var(--cream-100);
    margin-bottom: 6px;
}
.footer-logo svg { color: var(--green-300); }

.footer-tagline {
    color: var(--brown-300);
    font-size: 0.875rem;
    font-style: italic;
}

.footer-nav {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-nav a,
.footer-signup-link {
    color: var(--brown-300);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 0;
    transition: color var(--duration-fast) ease;
}
.footer-nav a:hover,
.footer-signup-link:hover { color: var(--cream-100); text-decoration: none; }

.footer-copy {
    text-align: center;
    color: var(--brown-500);
    font-size: 0.8rem;
    max-width: 1180px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .site-footer { padding: 44px 16px 28px; }
    .footer-nav { gap: 6px 20px; }
    .footer-nav a, .footer-signup-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ============================================================
   9. Signup modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(14, 32, 21, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) var(--ease-swift);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--color-surface);
    border: 1px solid var(--cream-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 46px 42px;
    width: 100%;
    max-width: 430px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.92);
    transition: transform var(--duration-slow) var(--ease-spring-soft);
}

.modal-overlay.open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--brown-500);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: color var(--duration-fast) ease,
        background var(--duration-fast) ease,
        transform var(--duration-base) var(--ease-spring);
    line-height: 0;
}
.modal-close:hover {
    color: var(--brown-900);
    background: var(--cream-200);
    transform: rotate(90deg);
}

.modal-card .auth-logo { text-align: center; margin-bottom: 30px; }
.modal-card .auth-logo h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 680;
    color: var(--green-700);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
/* A→B dotted route divider under the wordmark */
.modal-card .auth-logo::after {
    content: '';
    display: block;
    width: 88px;
    height: 8px;
    margin: 16px auto 0;
    background-image:
        radial-gradient(circle 4px at 4px 4px, var(--green-600) 99%, transparent),
        radial-gradient(circle 4px at 84px 4px, var(--sun-500) 99%, transparent),
        repeating-linear-gradient(90deg,
            transparent 0 12px,
            var(--green-300) 12px 16px,
            transparent 16px 20px);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: 8px 8px, 8px 8px, 60px 2px;
    background-position: 0 0, 100% 0, center 3px;
}

.modal-card .auth-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 660;
    color: var(--brown-900);
    margin-bottom: 22px;
    text-align: center;
}
.modal-card .auth-switch {
    text-align: center;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-top: 22px;
}
.modal-card .auth-switch a { color: var(--green-700); }
.modal-card .auth-legal {
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 14px;
    line-height: 1.45;
}
.modal-card .auth-legal a { color: var(--green-700); }
@media (max-width: 640px) { .modal-card { padding: 38px 22px; } }

/* ============================================================
   10. Night forest
   ============================================================ */
[data-theme="dark"] .landing-nav.scrolled { background: rgba(14, 32, 21, 0.97); border-bottom-color: var(--color-border); }
[data-theme="dark"] .nav-logo { color: var(--cream-100); }
[data-theme="dark"] .nav-logo, [data-theme="dark"] .lp-headline, [data-theme="dark"] .lp-head h2 { color: var(--ink); }
[data-theme="dark"] .nav-links a { color: var(--ink-soft); }
[data-theme="dark"] .nav-links { background: var(--color-surface); }
@media (max-width: 980px) { [data-theme="dark"] .nav-links { background: var(--color-surface); border-color: var(--color-border); } }
[data-theme="dark"] .nav-menu-btn { background: var(--color-surface); border-color: var(--color-border); }
[data-theme="dark"] .nav-menu-btn span { background: var(--ink); }
[data-theme="dark"] .lp-eyebrow { color: var(--green-300); }
[data-theme="dark"] .lp-headline em { color: var(--green-300); }
[data-theme="dark"] .lp-leave { background: #13281b; }
[data-theme="dark"] .site-footer { background: #0a170f; }
[data-theme="dark"] .footer-logo { color: #f3e9d2; }
[data-theme="dark"] .footer-tagline, [data-theme="dark"] .footer-nav a, [data-theme="dark"] .footer-signup-link { color: #bda887; }
[data-theme="dark"] .footer-copy { color: #8c7c63; }
[data-theme="dark"] .modal-card { border-color: var(--color-border); }
[data-theme="dark"] .lp-hero-sketch .lp-draw { stroke: var(--green-300); }

/* ============================================================
   11. Reduced motion: no pan, the route already drawn
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .lp-pan { animation: none; transform: none; }
    .lp-draw { animation: none; stroke-dashoffset: 0; }
}


/* C5 night forest: hardcoded day surfaces and inks follow the theme (generated from a scan, then reviewed). */
[data-theme="dark"] .landing-nav.scrolled { background: var(--color-surface); }
[data-theme="dark"] .nav-links { background: var(--color-surface); }

/* C5 night forest: light inks that sit on always-dark surfaces keep their day value (the cream and pale-green tokens flip at night). */
[data-theme="dark"] .footer-logo { color: #f8f3e8; }
[data-theme="dark"] .footer-nav a:hover,
[data-theme="dark"] .footer-signup-link:hover { color: #f8f3e8; }
