/* Aphorism — waitlist
   Palette and typography mirror the iOS app (Theme.swift). */

:root {
    --background: #FDF8F4;
    --secondary-background: #EFEDE9;
    --accent: #1C1C1C;
    --primary-text: #1C1C1C;
    --body-text: #4A4A4A;
    --secondary-text: #5A5A5A;
    --tertiary-text: #8A8A8A;
    --divider: rgba(0, 0, 0, 0.06);

    --serif: "Newsreader", "New York", Georgia, "Times New Roman", serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: var(--background);
    color: var(--primary-text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100dvh;
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 620px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 56px) clamp(24px, 6vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── Masthead ───────────────────────────── */
.masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
}

.wordmark {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(29px, 7.6vw, 36px);
    letter-spacing: 0.01em;
    color: var(--primary-text);
}

.kicker {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tertiary-text);
}

/* ── Hero / rotating quote ──────────────── */
.hero {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(30px, 5.5vh, 52px) 0 clamp(34px, 7vh, 58px);
}

.quote {
    /* Fade-in (returning to full opacity) runs a touch longer than the
       fade-out so the new quote arrives as gently as the old one leaves. */
    transition: opacity 1.05s ease;
    /* Wide enough that even the longest quote wraps to at most 3 lines at any
       width: capped at 34ch on large screens, but allowed up to 92vw on narrow
       ones so it never spills onto a 4th line. */
    width: min(34ch, 92vw);
    /* Reserve a block tall enough for 3 lines + author at every size, so the
       buttons below never shift and single-line quotes keep airy whitespace. */
    min-height: clamp(150px, 34vw, 196px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quote.is-fading {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.quote__text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(26px, 6.5vw, 38px);
    line-height: 1.28;
    color: var(--primary-text);
}

.quote__text::before { content: "\201C"; }
.quote__text::after  { content: "\201D"; }

.quote__author {
    margin-top: 18px;
    font-family: var(--serif);
    font-size: clamp(15px, 3.6vw, 17px);
    font-weight: 500;
    color: var(--secondary-text);
}

/* ── Sign-up form ───────────────────────── */
.signup {
    width: 100%;
    max-width: 380px;
}

/* Supporting copy beneath the email bar */
.signup__desc {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signup__desc p {
    font-size: clamp(14px, 4vw, 15px);
    line-height: 1.55;
    color: var(--secondary-text);
}

.signup__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tertiary-text);
    margin-bottom: 16px;
}

/* Label + form row and success message share one footprint (no layout shift). */
.signup__swap {
    position: relative;
    min-height: 152px;
}

.signup__fields {
    transition: opacity 0.55s ease;
}

.signup__controls {
    position: relative;
    min-height: 112px;
}

.signup__row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signup__confirm {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.signup__confirm.is-visible {
    opacity: 1;
}

.signup__confirm-headline {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(28px, 7.2vw, 30px);
    line-height: 1.28;
    letter-spacing: 0.01em;
    color: var(--primary-text);
}

.signup__confirm-detail {
    margin: 0;
    width: 100%;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(28, 28, 28, 0.4);
    font-family: var(--sans);
    font-size: clamp(14px, 4vw, 15px);
    line-height: 1.55;
    color: var(--secondary-text);
}

.signup__confirm-email {
    color: var(--primary-text);
}

.signup__swap.is-success .signup__fields {
    opacity: 0;
    pointer-events: none;
}

.signup__input {
    width: 100%;
    font-family: var(--sans);
    font-size: 17px;
    color: var(--primary-text);
    text-align: center;
    background-color: var(--background);
    border: none;
    border-bottom: 1px solid rgba(28, 28, 28, 0.4);
    padding: 14px 4px;
    outline: none;
    transition: border-color 0.2s ease;
}

.signup__input:focus {
    border-bottom-color: var(--accent);
}

.signup__input::placeholder {
    color: var(--tertiary-text);
    font-style: normal;
}

/* Hide the placeholder as soon as the field is focused, so it clears the
   moment you start typing. */
.signup__input:focus::placeholder {
    color: transparent;
}

.signup__button {
    width: 100%;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    color: var(--background);
    background: var(--accent);
    border: none;
    border-radius: 0; /* sharp corners, like the app */
    padding: 16px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-appearance: none;
}

.signup__button:hover { opacity: 0.85; }
.signup__button:active { opacity: 0.7; }
.signup__button:disabled { opacity: 0.4; cursor: default; }

.signup__note {
    min-height: 18px;
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--secondary-text);
}

.signup__note.is-error { color: #9A3B2E; }

/* Phone only — desktop sizes unchanged (clamp caps at 480px+). */
@media (max-width: 479px) {
    .wordmark {
        font-size: clamp(33px, 8.8vw, 36px);
    }

    .quote__text {
        font-size: clamp(28px, 7.5vw, 38px);
    }

    .quote__author {
        font-size: clamp(16px, 4.2vw, 17px);
    }
}

@media (min-width: 480px) {
    .signup__swap {
        min-height: 128px;
    }

    .signup__controls {
        min-height: 88px;
    }

    .signup__row {
        flex-direction: row;
        align-items: stretch;
    }
    .signup__button {
        width: auto;
        white-space: nowrap;
        padding-left: 28px;
        padding-right: 28px;
    }
}
