
* { margin: 0; padding: 0; box-sizing: border-box; }

@keyframes stage-in {
    from { opacity: 0.35; }
    to { opacity: 1; }
}
@keyframes rise {
    from { transform: translateY(10px); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero,
    .headline,
    .subline,
    .signup,
    .stat { animation: none !important; }
}

body {
    background-color: var(--brand-grey);
    color: var(--brand-beige);
    font-family: 'Cascadia Code', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.background-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--brand-grey);
    pointer-events: none;
}

.grid-system {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#497B3528 1px, transparent 1px),
        linear-gradient(90deg, #497B3528 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.18;
}

/* Map source — baked to canvas once, not painted live */
.field-map-source { display: none; }

#scene-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    pointer-events: none;
}

/* Top band — TACSTA center sits at ~2/5 viewport height */
.hero-zone {
    height: 40dvh;
    height: 40vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1.25rem;
}

.hero {
    position: relative;
    --brand-size: clamp(2.4rem, min(13.5vw, 22vh), 14rem);
    font-size: var(--brand-size);
    width: min(92vw, 1100px);
    height: 1.2em;
    margin: 0;
    display: grid;
    place-items: center;
    /* Center of TACSTA on the 40vh (2/5) line */
    transform: translateY(50%);
    animation: stage-in 1s ease-out both;
}

.copy {
    flex: 0 0 auto;
    --brand-size: clamp(2.4rem, min(13.5vw, 22vh), 14rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* Clear the half-hero that hangs below the 2/5 line */
    padding: calc(var(--brand-size) * 0.65) 1.25rem 0.35rem;
}

.headline {
    font-family: 'Geo', sans-serif;
    font-size: clamp(1.6rem, 5.5vw, 2.75rem);
    font-weight: bold;
    font-synthesis: weight;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
    animation: rise 1s 0.2s ease-out both;
}

a { text-decoration: none;color:var(--brand-green) }

.headline .hl { color: var(--brand-green); }

.subline {
    color: var(--brand-beige);
    font-size: 0.92rem;
    max-width: 34rem;
    line-height: 1.65;
    letter-spacing: 0.02em;
    animation: rise 1s 0.4s ease-out both;
}

.subline .tag { color: #D4DBAF88; }

/* Centered between copy and footer */
.signup-slot {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    padding: 0.5rem 1.25rem;
}

footer {
    flex: 0 0 auto;
    position: relative;
    border-top: 1px solid #497B3533;
    padding: 0.7rem 0.65rem max(0.75rem, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
    pointer-events: none;
}

.site-legal {
    pointer-events: auto;
    text-align: center;
    margin-top: 0.55rem;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-legal a {
    color: #D4DBAF77;
    text-decoration: none;
}

.site-legal a:hover {
    color: var(--brand-green);
}

.site-legal span {
    color: #497B3555;
    margin: 0 0.45rem;
}

.signup {
    pointer-events: auto;
    max-width: 32rem;
    width: 100%;
    margin: 0 auto;
    padding: 0.65rem 0.25rem 0.5rem;
    text-align: center;
    animation: rise 1s 0.55s ease-out both;
}

.signup h2 {
    font-family: 'Cascadia Code', monospace;
    font-size: clamp(0.82rem, 2.8vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--brand-beige);
    margin-bottom: 0.2rem;
}

.signup p {
    color: #D4DBAF88;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
}

.signup-form {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.signup-form input[type="email"] {
    flex: 1 1 11rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #497B3555;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--brand-beige);
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.signup-form input[type="email"]::placeholder {
    color: #D4DBAF66;
}

.signup-form input[type="email"]:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 1px #497B3544;
}

.signup-form button {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--brand-green);
    border-radius: 2px;
    background: #497B3528;
    color: var(--brand-green);
    font: inherit;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}

.signup-form button:hover:not(:disabled) {
    background: #497B3544;
}

.signup-form button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    min-height: 1em;
}

.form-status.ok { color: var(--brand-green); }
.form-status.err { color: #c9a0a0; }

.signup-legal {
    margin-top: 0.45rem;
    font-size: 0.62rem;
    line-height: 1.4;
    color: #D4DBAF55;
}

.signup-legal a {
    color: #D4DBAF88;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.signup-legal a:hover {
    color: var(--brand-green);
}

.signup-success {
    margin-top: 0.35rem;
    padding: 0.85rem 0.5rem 0.4rem;
}

.signup-success-title {
    color: var(--brand-green) !important;
    font-size: 0.95rem !important;
    font-weight: bold;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem !important;
}

.signup-success-copy {
    color: var(--brand-beige) !important;
    font-size: 0.78rem !important;
    line-height: 1.5;
}

.signup-success-copy a {
    color: #D4DBAF88;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.signup-success-copy a:hover {
    color: var(--brand-green);
}


.signup.is-done h2 {
    color: var(--brand-beige);
}

.signup.is-done .signup-form,
.signup.is-done .signup-tag,
.signup.is-done .signup-legal,
.signup.is-done .form-status {
    display: none !important;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 0.95rem;
    max-width: 54rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .stats { grid-template-columns: repeat(4, 1fr); gap: 0.7rem 1.15rem; }
}

.stat {
    text-align: center;
    padding: 0.3rem 0.2rem;
}

.stat-label {
    font-size: 0.58rem;
    color: #D4DBAF77;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.28rem;
    line-height: 1.2;
}

.stat-val {
    color: var(--brand-green);
    font-weight: bold;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.stat-val-cycle {
    /* same size as sibling .stat-val */
    line-height: 1.25;
    letter-spacing: 0.04em;
}

.cycle-phrase {
    display: inline-block;
    min-width: 9.5ch;
    transition: opacity 0.38s ease, transform 0.38s ease;
}

#tracking-cycle-label {
    display: inline-block;
    transition: opacity 0.38s ease, transform 0.38s ease;
}

.cycle-out {
    opacity: 0;
    transform: translateY(5px);
}

@media (prefers-reduced-motion: reduce) {
    .cycle-phrase,
    #tracking-cycle-label { transition: none; }
}

@media (max-width: 767px) {
    .hero-zone {
        padding: 0 1rem;
    }

    .hero,
    .copy {
        --brand-size: clamp(1.6rem, 9.5vw, 2.75rem);
    }

    .copy {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .headline {
        font-size: clamp(1.05rem, 4.2vw, 1.55rem);
        letter-spacing: 0.08em;
        margin-bottom: 0.4rem;
    }

    .subline {
        font-size: 0.74rem;
        line-height: 1.4;
        max-width: 19rem;
    }

    .signup-slot {
        padding: 0.35rem 0.85rem;
    }

    .signup {
        max-width: 100%;
        padding: 0.45rem 0.15rem 0.3rem;
    }

    .signup h2 {
        font-size: 0.74rem;
        letter-spacing: 0.02em;
    }

    .signup p {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    footer {
        padding: 0.5rem 0.4rem max(0.6rem, env(safe-area-inset-bottom, 0px));
    }

    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem 0.5rem;
        max-width: none;
        width: 100%;
    }

    .stat {
        padding: 0.15rem 0.1rem;
    }

    .stat-label {
        font-size: 0.5rem;
        letter-spacing: 0.08em;
        margin-bottom: 0.15rem;
        line-height: 1.15;
    }

    .stat-val {
        font-size: 0.64rem;
        letter-spacing: 0.025em;
        line-height: 1.2;
    }

    .stat-val-cycle {
        font-size: 0.58rem;
        line-height: 1.15;
    }

    .cycle-phrase {
        min-width: 0;
        display: inline;
    }
}

@media (min-width: 768px) {
    .hero-zone,
    .copy,
    .signup-slot {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    footer {
        padding: 0.65rem 0.75rem 1rem;
    }
}

@media (max-height: 640px) {
    .hero-zone {
        height: 36vh;
        height: 36dvh;
    }
}