/**
 * The page's styles.
 *
 * **The globe is the page, and the layout gets out of its way.**
 *
 * The Earth fills the screen from edge to edge. The header sits on top of it in a
 * band that is barely there, and the ticker sits under the header for the same
 * reason. Everything else is either a control that gets out of the way or a panel
 * that slides over the globe when it is wanted and is not there when it is not.
 *
 * **Nothing is behind a hover.** Every person here is on a phone, and on a phone a
 * hover is a thing that does not happen. The agent cards open on tap and on focus.
 */

/* ------------------------------------------------------------------ the shell */

body {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
}

#globe {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#globe canvas { display: block; }

/* The vignette. It sits between the globe and the page, and it is what stops the
   text from having to fight the Earth for attention. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 7, 13, 0.85) 0%, rgba(5, 7, 13, 0) 22%),
    linear-gradient(to top, rgba(5, 7, 13, 0.9) 0%, rgba(5, 7, 13, 0) 38%);
}

/* ---------------------------------------------------------------- the header */

.top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
}

/* **The brand is the first thing and the buttons are the second, and on a narrow
   phone the buttons win.** The name is the thing that can be shortened, so it is
   the thing that is. */
@media (max-width: 460px) {
  .brand .name { display: none; }
  .top { padding-left: 12px; padding-right: 12px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  flex: none;
}

.brand .name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ------------------------------------------------------------------ buttons */

button, .ghost, .pill {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 140ms cubic-bezier(0.2, 1.2, 0.4, 1), background 140ms ease,
    box-shadow 140ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--pink-bright);
  outline-offset: 2px;
}

/* **The pill is a button or a link.** The elf's own page has a link that says
   "Elf yourself" and it has to look like the button on the other pages, or the
   two pages look like two different sites. */
.pill,
a.pill {
  border: 0;
  padding: 10px 18px;
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 18px rgba(214, 51, 127, 0.35);
}

.pill:hover, a.pill:hover { transform: translateY(-1px); background: #e0408f; }
.pill:active { transform: translateY(0) scale(0.98); }

.pill.wide { width: 100%; padding: 14px 18px; font-size: 15px; }

.ghost {
  border: 1px solid rgba(217, 236, 255, 0.28);
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--frost);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(217, 236, 255, 0.5); }
.ghost:active { transform: scale(0.98); }

.ghost.small { padding: 7px 12px; font-size: 12px; }

/* The simulate button says what it does, but on a phone there is not room for the
   whole sentence, so it says the short version. The long version is the title
   attribute, which is there when somebody wants it. */
@media (max-width: 460px) {
  #simulate { padding: 9px 12px; font-size: 12px; }
  .pill { padding: 10px 15px; font-size: 13.5px; }
}

/* ---------------------------------------------------------------- the desktop */

@media (min-width: 760px) {
  /* The panels sit in a column on the left, over the globe, and they are only
     as wide as they need to be. */
  .ticker,
  .caption,
  .honest,
  .controls {
    max-width: 30rem;
  }

  .ticker {
    margin-top: 6px;
  }

  /* The globe is a little smaller on a wide screen, because there is more of it
     to look at and it does not need to fill the height. */
  .controls {
    margin-top: 12px;
  }
}

/* ------------------------------------------------------------------ ticker */

/**
 * The panels.
 *
 * **They are the width of the text and no wider.** A ticker that runs the whole
 * width of a desktop window is a bar of nothing with a number in the middle of
 * it. So on a wide screen the panels are capped and put on the left, where the
 * eye goes, and the globe has the rest of the screen to itself.
 */
.ticker {
  position: relative;
  z-index: 10;
  margin: 4px 16px 0;
  padding: 11px 16px;
  border-radius: var(--radius);
  background: rgba(10, 16, 28, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(217, 236, 255, 0.14);
  display: flex;
  align-items: baseline;
  gap: 10px;
  overflow: hidden;
}

.ticker[hidden] { display: none; }

.ticker-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(217, 236, 255, 0.62);
  flex: none;
}

.ticker-label.simulated { color: var(--gold); }

.ticker-count {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.ticker-now {
  font-size: 12.5px;
  color: rgba(217, 236, 255, 0.78);
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------- main */

main {
  position: relative;
  z-index: 10;
  padding: 0 16px;
  pointer-events: none;
}

main > * { pointer-events: auto; }

.honest {
  max-width: 44ch;
  margin: 14px 0 0;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: rgba(10, 16, 28, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(217, 236, 255, 0.14);
  font-size: 14px;
  line-height: 1.5;
  color: rgba(217, 236, 255, 0.86);
}

.honest strong { color: #fff; }

/**
 * The caption.
 *
 * It sits under the ticker, in the flow, rather than floating over the globe.
 * A caption that floats is a caption that ends up on top of a paragraph, and
 * two pieces of text on top of each other is worse than either of them alone.
 */
.caption {
  margin-top: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  background: rgba(10, 16, 28, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(217, 236, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.caption[hidden] { display: none; }

.caption-where {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.caption-local {
  font-size: 13px;
  color: rgba(217, 236, 255, 0.8);
}

.controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls[hidden] { display: none; }

.clock {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: rgba(217, 236, 255, 0.7);
  font-variant-numeric: tabular-nums;
}

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

.footer {
  position: relative;
  z-index: 10;
  margin-top: 56vh;
  background: linear-gradient(to bottom, rgba(5, 7, 13, 0) 0%, rgba(5, 7, 13, 0.96) 12%, #05070d 26%);
  background: linear-gradient(to bottom, rgba(5, 7, 13, 0) 0%, rgba(5, 7, 13, 0.96) 12%, #05070d 26%);
  padding-bottom: calc(env(safe-area-inset-bottom) + 40px);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-head {
  padding: 32px 0 28px;
  border-bottom: 1px solid rgba(217, 236, 255, 0.12);
}

.footer-love {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.footer-love a {
  color: var(--pink-bright);
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 95, 175, 0.35);
}

.footer-love a:hover { border-bottom-color: var(--pink-bright); }

.footer-note {
  margin: 0;
  max-width: 58ch;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(217, 236, 255, 0.62);
}

/* ------------------------------------------------------------------- roster */

.roster { padding: 32px 0; }

.roster h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #fff;
}

.roster-lede {
  margin: 0 0 22px;
  max-width: 60ch;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(217, 236, 255, 0.62);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.agent {
  position: relative;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(217, 236, 255, 0.1);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  cursor: default;
}

.agent:hover,
.agent:focus-within {
  background: rgba(214, 51, 127, 0.1);
  border-color: rgba(255, 95, 175, 0.4);
  transform: translateY(-2px);
}

.agent-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.agent-role {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(217, 236, 255, 0.5);
}

.agent-voice {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(217, 236, 255, 0.82);
}

.agent-voice::before { content: "\201C"; }
.agent-voice::after { content: "\201D"; }

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid rgba(217, 236, 255, 0.12);
}

.footer-links a {
  color: rgba(217, 236, 255, 0.75);
  text-decoration: none;
  font-size: 13.5px;
  border-bottom: 1px solid transparent;
}

.footer-links a:hover { color: #fff; border-bottom-color: rgba(217, 236, 255, 0.4); }

.footer-colophon {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(217, 236, 255, 0.38);
  max-width: 70ch;
}

/* -------------------------------------------------------------- the elf sheet */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: sheet-in 220ms cubic-bezier(0.2, 1, 0.3, 1);
}

.sheet[hidden] { display: none; }

@keyframes sheet-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet-inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0d1320;
  border: 1px solid rgba(217, 236, 255, 0.14);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 26px 20px calc(env(safe-area-inset-bottom) + 24px);
  animation: sheet-up 280ms cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-inner { border-radius: 22px; border-bottom: 1px solid rgba(217, 236, 255, 0.14); }
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--frost);
  font-size: 21px;
  line-height: 1;
}

.sheet h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: #fff;
}

.sheet-lede {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(217, 236, 255, 0.68);
  max-width: 46ch;
}

.elf-fields { display: grid; gap: 14px; }

.elf-fields label { display: grid; gap: 6px; }

.elf-fields label > span,
.elf-looks legend {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(217, 236, 255, 0.5);
}

.elf-fields input {
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(217, 236, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  width: 100%;
}

.elf-fields input::placeholder { color: rgba(217, 236, 255, 0.28); }

.elf-looks { border: 0; padding: 0; margin: 0; }

.looks {
  display: flex;
  gap: 9px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.look {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.look[aria-pressed="true"] { border-color: var(--pink-bright); transform: scale(1.04); }
.look img, .look svg { width: 100%; height: 100%; display: block; }

.elf-result { margin-top: 20px; }

.elf-result[hidden] { display: none; }

.elf-card {
  border-radius: 16px;
  overflow: hidden;
  background: #05070d;
  border: 1px solid rgba(217, 236, 255, 0.14);
}

.elf-card svg { display: block; width: 100%; height: auto; }

.elf-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------------ the letter */

.letter { text-align: left; }

.letter-mark { margin-bottom: 10px; }

.letter-body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(217, 236, 255, 0.88);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.letter-foot {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(217, 236, 255, 0.45);
  font-style: italic;
}

/* -------------------------------------------------------------- the naughty list */

.naughty {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.naughty li {
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(217, 236, 255, 0.1);
  margin-bottom: 7px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(217, 236, 255, 0.88);
}

.list-note {
  margin: 0;
  padding: 15px 17px;
  border-radius: 12px;
  background: rgba(214, 51, 127, 0.1);
  border: 1px solid rgba(255, 95, 175, 0.28);
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(217, 236, 255, 0.82);
  white-space: pre-wrap;
}

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

.footer-button {
  border: 0;
  background: none;
  padding: 0;
  color: rgba(217, 236, 255, 0.75);
  font-size: 13.5px;
  border-bottom: 1px solid transparent;
  text-align: left;
}

.footer-button:hover { color: #fff; border-bottom-color: rgba(217, 236, 255, 0.4); }

/* --------------------------------------------------------------- snow & the rest */

.snow {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .snow { display: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* The screen reader's version of the globe. */
.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;
}
