/* Self-hosted Montserrat (make fonts); falls back to system fonts until fetched. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #480d54;
  --bg-glow: #5f1d6d;
  --surface: #57195f;
  --fg: #ffefdb;
  --muted: rgb(255 239 219 / .6);
  --primary: #ffd900;
  --primary-hover: #ffe44d;
  --on-primary: #480d54;
  --line: rgb(255 239 219 / .3);
  --error: #ffb3b3;
  --gap: 1rem;
}

body {
  font: 16px/1.5 "Montserrat", system-ui, sans-serif;
  color: var(--fg);
  background: radial-gradient(ellipse 80% 60% at 50% 45%, var(--bg-glow), var(--bg) 70%) fixed, var(--bg);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--primary); }
[hidden] { display: none !important; }

/* The form reads as a sentence: "Hello, ________  Continue".
   Inputs are underlined blanks set in the sentence's own type. */
.sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem 1rem;
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.sentence label { white-space: nowrap; }
.sentence .field { position: relative; flex: 1 1 10rem; min-width: 0; }
p.sentence { justify-content: center; text-align: center; }

.sentence input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: .15rem 0 .3rem;
  transition: border-color .15s;
}
.sentence input::placeholder { color: var(--fg); opacity: .35; }
.sentence input:hover { border-bottom-color: rgb(255 239 219 / .5); }
.sentence input:focus { outline: none; border-bottom-color: var(--primary); }

button {
  align-self: center;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--on-primary);
  background: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: .6rem 1.4rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 .4rem 1rem rgb(0 0 0 / .25); }
button:active:not(:disabled) { transform: none; box-shadow: none; }
button:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
/* disabled: outlined, so it doesn't turn a muddy yellow on purple */
button:disabled { cursor: not-allowed; color: rgb(255 217 0 / .45); background: transparent; border-color: rgb(255 217 0 / .3); }

/* errors and suggestions float under the input, so they never shift the form */
.error { color: var(--error); }
.sentence .field .error {
  position: absolute; top: calc(100% + .5rem); left: 0; margin: 0;
  font-size: .875rem; font-weight: 500; letter-spacing: 0; white-space: nowrap;
}

#suggestions {
  position: absolute; top: calc(100% + .5rem); left: -.75rem; right: -.75rem; z-index: 1;
  list-style: none; margin: 0; padding: .35rem;
  font-size: .9375rem; font-weight: 500; letter-spacing: 0; line-height: 1.4;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 1rem 2.5rem rgb(0 0 0 / .4), 0 0 0 1px rgb(255 239 219 / .08);
}
#suggestions:empty { display: none; }
#suggestions li { padding: .55rem .75rem; border-radius: 8px; cursor: pointer; }
#suggestions li[aria-selected="true"], #suggestions li:hover { background: rgb(255 239 219 / .1); }

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem .6rem;
  padding: 1.25rem var(--gap);
  font-size: .75rem;
  color: var(--muted);
}
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .sep { opacity: .5; }

/* error pages: just the status code */
.big {
  margin: 0;
  text-align: center;
  font-size: clamp(5rem, 22vw, 10rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--primary);
}

/* licenses page: plain body-size text, compact headings */
.legal { font-size: .875rem; color: var(--fg); }
.legal h1 { font-size: 1.125rem; margin: 0 0 .75rem; }
.legal h2 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.legal p { margin: 0 0 .5rem; color: rgb(255 239 219 / .85); }
.legal a { text-decoration: underline; }

/* phones: stack the sentence, full-width field and button */
@media (max-width: 34rem) {
  .sentence { font-size: 1.75rem; gap: .5rem; }
  .sentence .field { flex-basis: 100%; }
  .sentence input { font-size: 1.25rem; }
  .sentence button { flex-basis: 100%; margin-top: 2.25rem; padding: .8rem; }
  p.sentence { font-size: 1.5rem; }
}
