/* Achtung Schroeder — placeholder */

:root {
    --bg: #000;
    --fg: #fff;
    --text: rgba(255, 255, 255, .72);
    --muted: rgba(255, 255, 255, .34);
    --line: rgba(255, 255, 255, .2);
    --error: #ff6f61;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--fg);
    color: var(--bg);
}

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

/* ---------------------------------------------------------------- gate --- */

.gate {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2.5rem, 7vh, 4rem);
    padding: 4rem 1.5rem 2rem;
}

.gate__logo {
    width: min(20rem, 66vw);
    height: auto;
    /* The logo is the only bright surface on the page, so it carries the eye
       on its own and needs no further treatment. */
}

.gate__form {
    margin: 0;
    width: min(20rem, 78vw);
}

.field {
    position: relative;
    display: flex;
    align-items: center;
}

.field__input {
    width: 100%;
    /* Symmetric side padding, otherwise the submit button on the right pulls
       the centred text off centre. */
    padding: .85rem 2.75rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: .95rem;
    letter-spacing: .1em;
    text-align: center;
    outline: 0;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.field__input::placeholder {
    color: var(--muted);
    letter-spacing: .16em;
    text-transform: uppercase;
    font-size: .8rem;
    opacity: 1;
}

.field:hover .field__input { border-bottom-color: rgba(255, 255, 255, .38); }

/* Focus has to read as focus without an outline ring, so the rule doubles in
   weight and turns fully white. */
.field__input:focus {
    border-bottom-color: var(--fg);
    box-shadow: 0 1px 0 0 var(--fg);
}

.field__submit {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fg);
    opacity: .4;
    cursor: pointer;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.field__submit:hover { opacity: 1; }

.field__submit:focus-visible {
    opacity: 1;
    outline: 1px solid var(--fg);
    outline-offset: 2px;
    border-radius: 3px;
}

.field__input:not(:placeholder-shown) ~ .field__submit { opacity: .8; }

.field__arrow {
    width: 1.25rem;
    height: 1.25rem;
}

.field__spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-top-color: var(--fg);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.gate__message {
    /* Reserved height keeps the form from jumping when a message appears. */
    min-height: 1.4rem;
    margin: 1.1rem 0 0;
    color: var(--error);
    font-size: .78rem;
    letter-spacing: .06em;
    text-align: center;
    opacity: 0;
    transition: opacity .25s var(--ease);
}

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

/* --- states ------------------------------------------------------------- */

.gate__form[data-state="checking"] .field__input {
    color: var(--muted);
    pointer-events: none;
}

.gate__form[data-state="checking"] .field__arrow { display: none; }

.gate__form[data-state="checking"] .field__spinner { display: block; }

.gate__form[data-state="checking"] .field__submit {
    opacity: .8;
    cursor: default;
}

.gate__form[data-state="error"] .field { animation: shake .4s var(--ease); }

.gate__form[data-state="error"] .field__input { border-bottom-color: var(--error); }

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

.footer {
    padding: 2rem 1.5rem 2.25rem;
    text-align: center;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.footer a {
    color: inherit;
    text-decoration: none;
    transition: color .25s var(--ease);
}

.footer a:hover,
.footer a:focus-visible { color: rgba(255, 255, 255, .8); }

.footer__sep { margin: 0 .6rem; }

/* --------------------------------------------------------------- legal --- */

.legal {
    flex: 1;
    width: min(44rem, 100%);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 1rem;
}

.legal__brand {
    display: inline-block;
    margin-bottom: 3rem;
}

.legal__brand img {
    width: 9.5rem;
    height: auto;
    display: block;
}

.legal h1 {
    margin: 0 0 2.5rem;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -.01em;
}

.legal h2 {
    margin: 2.75rem 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.legal h3 {
    margin: 1.75rem 0 .5rem;
    font-size: .9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .88);
}

.legal p,
.legal li {
    color: var(--text);
    font-size: .92rem;
    line-height: 1.75;
}

.legal p { margin: 0 0 .85rem; }

.legal ul {
    margin: 0 0 .85rem;
    padding-left: 1.15rem;
}

.legal li { margin-bottom: .35rem; }

.legal strong { color: var(--fg); }

.legal a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: .2em;
    text-decoration-color: var(--line);
    transition: text-decoration-color .25s var(--ease);
}

.legal a:hover { text-decoration-color: var(--fg); }

.legal__updated {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: var(--muted);
    font-size: .8rem;
}

/* ------------------------------------------------------------ movement --- */

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes shake {
    20%  { transform: translateX(-7px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(2px); }
    100% { transform: none; }
}

.page-gate .gate__logo { animation: rise .9s .05s var(--ease) both; }
.page-gate .gate__form { animation: rise .9s .2s var(--ease) both; }
.page-gate .footer     { animation: fade 1.2s .5s var(--ease) both; }

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

    .field__spinner {
        animation: none !important;
        border-top-color: rgba(255, 255, 255, .25);
    }
}
