/* ==========================================================================
   setjmp - shared styles
   ========================================================================== */

:root {
    --paper: #f7f3f4;
    --panel: #fffdfd;
    --ink: #1c1519;
    --muted: #6f6269;
    --line: #e4d8dc;
    --line-strong: #d2c0c7;
    --accent: #ad1f55;
    --accent-hover: #8e1745;
    --accent-soft: #f6e3ea;
    --ok: #1c7a4d;
    --err: #b0252c;
    --radius: 6px;
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
        "Liberation Mono", monospace;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: #f2ccda;
    color: var(--ink);
}

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

a {
    color: inherit;
}

/* Layout ----------------------------------------------------------------- */

.page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 860px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 36px) clamp(18px, 5vw, 40px) 28px;
}

/* Header ----------------------------------------------------------------- */

.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--ink);
    text-decoration: none;
}

.wordmark .dot {
    color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: baseline;
    gap: 18px;
    font-size: 13.5px;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-link .arrow {
    color: var(--accent);
    font-size: 12px;
}

.nav-link:hover {
    color: var(--ink);
}

/* Main ------------------------------------------------------------------- */

.main {
    padding: clamp(36px, 7vw, 64px) 0 56px;
}

.intro {
    max-width: 600px;
    margin-bottom: clamp(24px, 4vw, 32px);
}

.kicker {
    margin: 0 0 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3.6vw, 2.2rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.lede {
    max-width: 34rem;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

/* Form ------------------------------------------------------------------- */

.panel {
    max-width: 720px;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.field {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 6px 18px;
}

.field + .field {
    margin-top: 16px;
}

.field-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.control {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.control input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    outline: 0;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.control input::placeholder {
    color: #a4949b;
}

.control input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(173, 31, 85, 0.14);
}

.control input[readonly] {
    background: #fdfafa;
    color: #4c3a42;
    font-family: var(--font-mono);
    font-size: 13.5px;
}

.control.is-ready input[readonly] {
    border-color: rgba(28, 122, 77, 0.45);
    color: var(--ok);
}

/* Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn--secondary {
    border-color: var(--line-strong);
    background: #fff;
    color: var(--ink);
}

.btn--secondary:hover:not(:disabled) {
    border-color: var(--accent);
    background: #fff;
    color: var(--accent);
}

.btn--secondary.is-success {
    border-color: rgba(28, 122, 77, 0.55);
    color: var(--ok);
}

.btn .spinner {
    display: none;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner {
    display: block;
}

/* Status ----------------------------------------------------------------- */

.status {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.5;
}

.status[hidden] {
    display: none;
}

.status-tag {
    flex: none;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.status--success {
    color: var(--ok);
}

.status--error {
    color: var(--err);
}

/* Feature list ----------------------------------------------------------- */

.features {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
}

.features li::after {
    content: "/";
    margin: 0 10px;
    color: #cdbcc3;
}

.features li:last-child::after {
    content: "";
    margin: 0;
}

/* Footer ----------------------------------------------------------------- */

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}

.footer-label {
    margin-right: 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #9b8a91;
}

.footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

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

/* Redirect page ---------------------------------------------------------- */

.main--message {
    max-width: 620px;
    padding-top: clamp(48px, 9vw, 88px);
}

.state[hidden] {
    display: none;
}

.state .kicker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.state p:not(.kicker) {
    max-width: 32rem;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.state .btn {
    margin-top: 22px;
}

.dot-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid #e8dadf;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Utilities -------------------------------------------------------------- */

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 620px) {
    .field {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .field-label {
        padding-left: 1px;
    }

    .btn {
        padding: 0 15px;
    }
}

@media (max-width: 380px) {
    .site-nav {
        gap: 12px;
        font-size: 13px;
    }

    .control {
        gap: 6px;
    }

    .btn {
        padding: 0 12px;
        font-size: 13px;
    }
}

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