/* Landing page styles. Colors, type and radius are copies of the brand tokens
   (documentation/brand/edgauge-tokens.json); keep them in step when a token
   changes. Light is the default; dark follows the system setting. */

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}

:root {
    color-scheme: light;
    --eg-background: #edf1f3;
    --eg-surface: #ffffff;
    --eg-text-primary: #0d1316;
    --eg-text-secondary: #39474d;
    --eg-text-muted: #5e6e74;
    --eg-border: #c9d3d7;
    --eg-border-strong: #a9b7bc;
    --eg-accent: #0b6e86;
    --eg-accent-hover: #095a6e;
    --eg-accent-active: #07485a;
    --eg-accent-subtle: #e4eff2;
    --eg-on-accent: #ffffff;
    --eg-focus-ring: #0b6e86;
    --eg-status-good: #0c6e5b;
    --eg-status-bad: #a3312a;
    --eg-shadow-1: 0 1px 2px rgb(13 19 22 / 0.08);

    --radius-2: 4px;
    --duration-fast: 150ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --gutter: clamp(16px, 4vmin, 56px);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --eg-background: #0b1114;
        --eg-surface: #121a1e;
        --eg-text-primary: #f3f5f7;
        --eg-text-secondary: #c9d3d7;
        --eg-text-muted: #8fa3a9;
        --eg-border: #2a3a40;
        --eg-border-strong: #55686f;
        --eg-accent: #3ea9c4;
        --eg-accent-hover: #5fbdd6;
        --eg-accent-active: #7fc4d6;
        --eg-accent-subtle: #16262c;
        --eg-on-accent: #0d1316;
        --eg-focus-ring: #3ea9c4;
        --eg-status-good: #3fb396;
        --eg-status-bad: #e8776d;
        --eg-shadow-1: none;
    }
}

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

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

body {
    margin: 0;
    background: var(--eg-background);
    color: var(--eg-text-primary);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
}

:focus-visible {
    outline: 2px solid var(--eg-focus-ring);
    outline-offset: 2px;
}

a {
    color: var(--eg-accent);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--eg-accent-hover);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- frame: exactly one screen tall; content scrolls only if it can't fit
   (a landscape phone, 200% zoom) rather than being cut off ---- */

.page {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: clamp(12px, 3vmin, 40px);
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1440px;
    margin: 0 auto;
    padding: calc(var(--gutter) * 0.75) var(--gutter);
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    padding-bottom: max(
        calc(var(--gutter) * 0.75),
        env(safe-area-inset-bottom)
    );
}

.masthead img {
    display: block;
    width: auto;
    height: clamp(30px, 5vmin, 56px);
}

main {
    display: grid;
    align-items: center;
    gap: clamp(20px, 5vmin, 96px);
}

@media (min-width: 900px) {
    main {
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    }
}

/* ---- intro ---- */

.intro h1 {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(26px, 2.4vw + 2.6vh, 76px);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.intro .lede {
    margin: clamp(12px, 2.4vh, 28px) 0 0;
    max-width: 44ch;
    color: var(--eg-text-secondary);
    font-size: clamp(15px, 0.5vw + 0.9vh, 22px);
    line-height: 1.5;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px clamp(16px, 2.4vw, 40px);
    margin: clamp(16px, 3.6vh, 44px) 0 0;
    padding: 0;
    list-style: none;
    color: var(--eg-text-muted);
    font-size: clamp(13px, 0.3vw + 0.6vh, 17px);
    line-height: 1.4;
}

.facts li {
    border-left: 2px solid var(--eg-accent);
    padding-left: 10px;
}

.facts strong {
    display: block;
    color: var(--eg-text-primary);
    font-size: 1.35em;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ---- form card ---- */

.card {
    background: var(--eg-surface);
    border: 1px solid var(--eg-border);
    border-radius: var(--radius-2);
    box-shadow: var(--eg-shadow-1);
    padding: clamp(16px, 3vmin, 36px);
    width: 100%;
    max-width: 520px;
    justify-self: end;
}

@media (max-width: 899px) {
    .card {
        justify-self: stretch;
        max-width: none;
    }
}

.card h1,
.card h2 {
    margin: 0;
    font-size: clamp(18px, 0.4vw + 1.2vh, 26px);
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card .hint,
.card .message {
    margin: 4px 0 0;
    color: var(--eg-text-secondary);
}

form {
    display: grid;
    gap: clamp(10px, 1.6vh, 18px);
    margin-top: clamp(12px, 2.2vh, 24px);
}

.row {
    display: grid;
    gap: inherit;
}

@media (min-width: 480px) {
    .row {
        grid-template-columns: 1fr 1fr;
    }
}

/* name and role are short, so they share a row even on a phone */
@media (min-width: 320px) {
    .row-tight {
        grid-template-columns: 3fr 2fr;
    }
}

.field {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

label {
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

label .optional {
    color: var(--eg-text-muted);
    font-weight: 400;
}

input,
textarea {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--eg-border-strong);
    border-radius: var(--radius-2);
    background: var(--eg-surface);
    color: var(--eg-text-primary);
    font: inherit;
    /* 16px keeps iOS Safari from zooming the page on focus */
    font-size: 16px;
    line-height: 24px;
    transition: border-color var(--duration-fast) var(--ease-out);
}

::placeholder {
    color: var(--eg-text-muted);
    opacity: 1;
}

textarea {
    min-height: 72px;
    resize: vertical;
}

input:hover,
textarea:hover {
    border-color: var(--eg-text-muted);
}

input:focus-visible,
textarea:focus-visible {
    outline-offset: 0;
    border-color: var(--eg-focus-ring);
}

input[aria-invalid='true'],
textarea[aria-invalid='true'] {
    border-color: var(--eg-status-bad);
}

.error {
    margin: 0;
    color: var(--eg-status-bad);
    font-size: 13px;
    line-height: 18px;
}

.error:empty {
    display: none;
}

.note-toggle {
    justify-self: start;
    min-height: 24px;
    padding: 3px 0;
    border: 0;
    background: none;
    color: var(--eg-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.note-toggle:hover {
    color: var(--eg-accent-hover);
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.turnstile:empty {
    display: none;
}

.actions {
    display: grid;
    gap: 8px;
}

button[type='submit'] {
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-2);
    background: var(--eg-accent);
    color: var(--eg-on-accent);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-out);
}

button[type='submit']:hover {
    background: var(--eg-accent-hover);
}

button[type='submit']:active {
    background: var(--eg-accent-active);
}

button[type='submit'][aria-disabled='true'] {
    cursor: progress;
    opacity: 0.8;
}

.fine-print {
    margin: 0;
    color: var(--eg-text-muted);
    font-size: 13px;
    line-height: 18px;
}

.form-status {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--eg-status-bad);
}

.form-status:empty {
    display: none;
}

.thanks h2 {
    color: var(--eg-text-primary);
}

.thanks .check {
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    color: var(--eg-status-good);
}

.thanks p {
    margin: 8px 0 0;
    color: var(--eg-text-secondary);
}

[hidden] {
    display: none !important;
}

/* ---- footer ---- */

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 24px;
    color: var(--eg-text-muted);
    font-size: 13px;
    line-height: 18px;
}

footer a {
    color: var(--eg-text-secondary);
    text-underline-offset: 3px;
}

footer a:hover {
    color: var(--eg-accent);
}

/* ---- short screens: drop the extras first, then tighten ---- */

@media (max-height: 860px) and (max-width: 899px) {
    .facts {
        display: none;
    }
}

@media (max-height: 780px) and (max-width: 899px) {
    .intro .lede {
        display: none;
    }
}

@media (max-height: 680px) and (max-width: 899px) {
    .card .hint {
        display: none;
    }
}

@media (max-height: 600px) and (max-width: 899px) {
    .page {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .intro h1 {
        font-size: 22px;
        max-width: none;
    }

    .card {
        padding: 14px;
    }

    form {
        gap: 8px;
        margin-top: 10px;
    }

    input {
        min-height: 40px;
        padding-top: 7px;
        padding-bottom: 7px;
    }
}

@media (max-height: 620px) and (min-width: 900px) {
    .facts {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
