/* spearmed.se, set like the title card that opens a film: a black screen, a few lines
   of serif text in the middle, the name and the way in at the bottom. Nothing else.
   Newsreader (SIL Open Font License, fonts/LICENSE.txt) is served from this host so
   the page looks the same on every device. */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader-Italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #060606;
  --text: #E6E1D6;
  --muted: #9D978A;
  --rule: #5D584F;
  --critical: #D07A6A;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.5 "Newsreader", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
p,
ol {
  margin: 0;
  padding: 0;
}

.card {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1rem, 3vw, 2.25rem) clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}

.words {
  align-self: center;
  padding: 3rem 0 6vh;
}

/* The front page. Each line arrives on its own, slowly. */
.epigraph {
  font-size: clamp(1.625rem, 3.1vw, 2.625rem);
  font-weight: 350;
  line-height: 1.32;
  letter-spacing: 0.005em;
}

.epigraph span {
  display: block;
  animation: appear 1.6s ease both;
}

.epigraph span:nth-child(1) {
  animation-delay: 0.4s;
}

.epigraph span:nth-child(2) {
  animation-delay: 1.5s;
}

.epigraph span:nth-child(3) {
  animation-delay: 2.6s;
}

.answer {
  margin-top: 2.25rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-style: italic;
  animation: appear 1.8s ease 4.3s both;
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.name {
  padding: 0.875rem 0;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
}

/* The one kind of action: underlined text, as a link or a button. */
.action {
  display: inline-block;
  padding: 0.875rem 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  cursor: pointer;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.action:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

a:focus-visible,
.action:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

/* Access, download and message pages: everything arrives together. */
.settle > * {
  animation: appear 1.2s ease both;
}

.title {
  font-size: clamp(1.625rem, 3.1vw, 2.375rem);
  font-weight: 350;
  line-height: 1.25;
  letter-spacing: 0.005em;
}

.aside {
  margin-top: 0.5rem;
  color: var(--muted);
  font-style: italic;
}

.words .action {
  margin-top: 1.5rem;
  color: var(--text);
  font-size: 1.1875rem;
}

form {
  display: grid;
  justify-items: center;
}

input {
  width: min(100%, 18rem);
  min-height: 3.25rem;
  margin-top: 1.75rem;
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  color: var(--text);
  caret-color: var(--text);
  font: inherit;
  font-size: 1.375rem;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-bottom-color: var(--text);
}

.error {
  margin-top: 1rem;
  color: var(--critical);
  font-style: italic;
}

/* Under the code field: where someone without a code asks for one. */
.hint {
  margin-top: 2.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-style: italic;
}

.words .hint .action {
  margin-top: 0;
  color: inherit;
  font-size: inherit;
}

.steps {
  display: inline-block;
  margin-top: 2.25rem;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.7;
  text-align: left;
}

div + .aside {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
