:root {
  --ink: #101014;
  --muted: #6b6b76;
  --accent: #1f4dff;
  --line: #e6e6ea;
  --paper: #ffffff;
  --display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem);
  overflow-x: hidden;
}

/* faint corner atmosphere, still reads as white */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(38rem 26rem at 88% -8%, rgba(31, 77, 255, 0.06), transparent 70%),
    radial-gradient(30rem 22rem at 2% 104%, rgba(16, 16, 20, 0.05), transparent 72%);
}

.stage {
  position: relative;
  width: min(40rem, 100%);
}

.eyebrow {
  margin: 0 0 clamp(1rem, 3vw, 1.75rem);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  margin-right: 0.7rem;
  vertical-align: middle;
  background: var(--accent);
}

.greeting {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.75rem, 10vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.swap {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 92%;
  background-size: 100% 0.09em;
  padding-bottom: 0.06em;
  transition: background-size 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.swap.is-fresh { background-size: 100% 0.34em; }

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

.lede {
  margin: clamp(1.25rem, 3.5vw, 1.75rem) 0 0;
  max-width: 30ch;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.1875rem);
  color: var(--muted);
  line-height: 1.7;
}

.composer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 1px 1px rgba(16, 16, 20, 0.03),
    0 12px 28px -18px rgba(16, 16, 20, 0.28);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.composer:focus-within {
  border-color: rgba(31, 77, 255, 0.45);
  box-shadow:
    0 1px 1px rgba(16, 16, 20, 0.03),
    0 18px 38px -20px rgba(31, 77, 255, 0.4);
}

.composer input {
  flex: 1 1 10rem;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.85rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  border-radius: 999px;
}

.composer input::placeholder { color: #a3a3ad; }

.composer input:focus { outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  cursor: pointer;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 200ms ease, transform 200ms ease;
}

.btn svg {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn:hover { background: var(--accent); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }

.status {
  min-height: 1.6rem;
  margin: 0.9rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.status.show { opacity: 1; transform: none; }
.status b { color: var(--ink); font-weight: 500; }

.rule {
  height: 1px;
  margin: clamp(2rem, 6vw, 3rem) 0 1.25rem;
  background: linear-gradient(90deg, var(--line), rgba(230, 230, 234, 0));
}

.foot {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.count {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink);
  margin-right: 0.15rem;
}

.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;
}

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

/* entrance */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

[data-reveal]:nth-of-type(1) { animation-delay: 60ms; }
[data-reveal]:nth-of-type(2) { animation-delay: 140ms; }
[data-reveal]:nth-of-type(3) { animation-delay: 220ms; }

.composer[data-reveal] { animation-delay: 300ms; }
.rule[data-reveal] { animation-delay: 380ms; }
.foot[data-reveal] { animation-delay: 440ms; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (max-width: 26rem) {
  .composer { border-radius: 1.5rem; }
  .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}