:root {
  --platinum: #ede2e0;
  --thistle: #dec2db;
  --liberty: #5b62b3;
  --blue: #2e80e4;
  --sky: #6da0e1;
  --on-platinum: #124c91;
  --on-thistle: #242a6b;
  --surface: #fff8f7;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--platinum);
  scroll-behavior: auto;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--platinum);
  color: var(--on-platinum);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
  user-select: none;
}

button:focus,
a:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 64%, transparent);
  outline-offset: 4px;
}

input:focus,
input:focus-visible {
  outline: none;
}

@media (hover: none) and (pointer: coarse) {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible {
    outline: none;
  }
}

@media (pointer: fine) {
  * {
    scrollbar-color: var(--blue) color-mix(in srgb, var(--thistle) 48%, var(--platinum));
    scrollbar-width: thin;
  }

  *::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  *::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
  }

  *::-webkit-scrollbar-thumb {
    min-height: 58px;
    border: 3px solid color-mix(in srgb, var(--thistle) 58%, var(--platinum));
    border-radius: 999px;
    background: var(--blue);
    background-clip: content-box;
  }

  *::-webkit-scrollbar-thumb:hover {
    background: var(--liberty);
  }

  .country-grid::-webkit-scrollbar {
    width: 10px;
  }

  *::-webkit-scrollbar-button,
  .country-grid::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  .country-grid::-webkit-scrollbar-track {
    margin-block: 12px;
    background: color-mix(in srgb, var(--platinum) 42%, transparent);
    border-radius: 999px;
  }

  .country-grid::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--blue);
    background-clip: content-box;
  }
}

@media (hover: none) and (pointer: coarse) {
  html,
  body,
  .country-grid {
    scrollbar-width: none;
  }

  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

main {
  width: min(100%, 908px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 44px) max(44px, env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  min-height: max(620px, 100svh);
  display: grid;
  place-items: center;
}

.hero-center {
  display: grid;
  justify-items: center;
  gap: clamp(38px, 4.8svh, 56px);
  transform: translateY(clamp(-28px, -3.4svh, -14px));
}

.orbit {
  position: relative;
  width: min(560px, calc(100vw - 88px));
  height: clamp(226px, 33vw, 292px);
}

.wordmark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  color: var(--blue);
  font-size: clamp(82px, 9.7vw, 116px);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: 0;
}

.flag {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(34px, 5vw, 43px);
  height: clamp(34px, 5vw, 43px);
  border-radius: 999px;
  object-fit: cover;
  transform: translate(-50%, -50%) translateX(var(--rx)) translateY(var(--ry)) scale(var(--scale));
  will-change: transform;
}

.f-gb { --rx: 0px; --ry: -110px; --scale: 1.12; }
.f-de { --rx: 190px; --ry: -68px; --scale: 0.98; }
.f-fr { --rx: 224px; --ry: 50px; --scale: 0.9; }
.f-es { --rx: 96px; --ry: 104px; --scale: 1.02; }
.f-it { --rx: -96px; --ry: 104px; --scale: 1.02; }
.f-se { --rx: -224px; --ry: 50px; --scale: 0.9; }
.f-ua { --rx: -190px; --ry: -68px; --scale: 0.98; }

.living-sentence {
  display: grid;
  gap: 0;
  margin: 0;
  width: min(100%, 760px);
  color: var(--liberty);
  text-align: center;
  font-size: clamp(44px, 5.9vw, 64px);
  line-height: 0.99;
  font-weight: 900;
  letter-spacing: 0;
}

.living-sentence span {
  display: block;
  white-space: nowrap;
}

.living-sentence b {
  font-weight: 900;
  transition: color 180ms ease, opacity 180ms ease;
}

.living-sentence b.swap-blue {
  color: var(--blue);
}

.living-sentence b.swap-sky {
  color: var(--sky);
}

.living-sentence b.swap-liberty {
  color: var(--liberty);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(42px, 5.4svh, 64px);
  transform: translateX(-50%);
  color: var(--blue);
  text-decoration: none;
  width: 54px;
  height: 54px;
  display: block;
  font-size: 0;
  animation: cue 1300ms ease-in-out infinite alternate;
}

@media (min-width: 720px) {
  .hero-center {
    gap: clamp(38px, 4.8svh, 56px);
  }

  .living-sentence {
    font-size: clamp(44px, 5.9vw, 64px);
    line-height: 0.99;
  }
}

@media (min-width: 720px) and (min-height: 960px) {
  .hero-center {
    transform: translateY(10px);
  }
}

.scroll-cue::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: 30px;
  height: 30px;
  border-right: 8px solid currentColor;
  border-bottom: 8px solid currentColor;
  border-radius: 5px;
  transform: translate(-50%, -50%) rotate(45deg);
}

@keyframes cue {
  from { translate: 0 0; }
  to { translate: 0 12px; }
}

.outcome {
  display: grid;
  min-height: 100svh;
  justify-items: center;
  align-content: center;
  gap: clamp(34px, 5.2vw, 58px);
  padding: clamp(68px, 8vw, 104px) 0;
  content-visibility: auto;
  contain-intrinsic-size: 820px;
}

.outcome h2 {
  margin: 0;
  color: var(--liberty);
  text-align: center;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: 0;
}

.outcome h2 span,
.outcome h2 strong {
  display: block;
}

.outcome h2 strong {
  color: var(--blue);
  font-weight: 900;
}

.phone-shot {
  width: min(430px, 100%);
  height: auto;
  display: block;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}

.waitlist {
  display: grid;
  justify-items: center;
  padding: 10px 0 clamp(44px, 6vw, 72px);
}

.signup {
  width: min(680px, 100%);
  padding: 10px;
  border-radius: 38px;
  background: var(--thistle);
  display: grid;
  gap: 8px;
}

.identity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.field {
  height: 58px;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  background: var(--platinum);
  border-radius: 26px;
  overflow: hidden;
}

.field-icon {
  color: var(--blue);
  display: grid;
  place-items: center;
}

.field-icon svg,
.country-preview svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input {
  min-width: 0;
  height: auto;
  align-self: center;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--on-platinum);
  font: inherit;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  caret-color: var(--blue);
}

input::placeholder {
  color: color-mix(in srgb, var(--on-platinum) 68%, transparent);
}

.country-button {
  width: 118px;
  height: 58px;
  border: 0;
  border-radius: 26px;
  background: var(--platinum);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    width 220ms cubic-bezier(.2, 0, .2, 1),
    transform 180ms ease;
}

.country-button:active {
  transform: scale(0.97);
}

.country-button.multi {
  width: 166px;
}

.country-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue);
}

.country-preview img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  animation: preview-pop 220ms cubic-bezier(.2, 0, .2, 1);
}

@keyframes preview-pop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.join-button {
  height: 60px;
  border: 0;
  border-radius: 28px;
  background: var(--blue);
  color: #1b102a;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.join-button:disabled {
  opacity: 0.68;
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--blue);
  text-align: center;
  font-weight: 800;
}

.message.error {
  color: #b83b60;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(27 16 42 / 18%);
  z-index: 10;
  opacity: 0;
  transition: opacity 220ms ease;
}

.sheet-backdrop.open {
  opacity: 1;
}

.country-sheet {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 11;
  width: min(480px, calc(100vw - 28px));
  max-height: min(68svh, 640px);
  opacity: 0;
  transform: translate(-50%, 26px) scale(0.97);
  padding: 20px;
  border-radius: 34px;
  background: var(--thistle);
  display: grid;
  gap: 14px;
  box-shadow: 0 18px 70px rgb(36 42 107 / 20%);
  transition:
    opacity 230ms ease,
    transform 300ms cubic-bezier(.2, 0, .2, 1);
}

.country-sheet.open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.country-sheet[hidden],
.sheet-backdrop[hidden] {
  display: none;
}

.multi-toggle {
  height: 52px;
  border: 0;
  border-radius: 24px;
  background: var(--platinum);
  color: var(--on-platinum);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    transform 180ms ease;
}

.multi-toggle:active {
  transform: scale(0.985);
}

.multi-toggle.active {
  background: var(--blue);
  color: #1b102a;
}

.toggle-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--thistle);
  box-shadow: inset 0 0 0 3px rgb(36 42 107 / 12%);
  transition:
    background-color 220ms ease,
    transform 240ms cubic-bezier(.2, 0, .2, 1),
    box-shadow 220ms ease;
}

.multi-toggle.active .toggle-dot {
  background: #1b102a;
  box-shadow: none;
  transform: translateX(-8px) scale(0.86);
}

.country-grid-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  overflow-y: auto;
  max-height: calc(min(68svh, 640px) - 106px);
  padding: 2px 20px 4px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.country-grid::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.country-scrollbar {
  position: absolute;
  top: 2px;
  right: 1px;
  bottom: 4px;
  width: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--platinum) 52%, var(--thistle));
  overflow: hidden;
}

.country-scrollbar[hidden] {
  display: none;
}

.country-scrollbar span {
  position: absolute;
  left: 1px;
  top: 0;
  width: 8px;
  min-height: 46px;
  border-radius: 999px;
  background: var(--blue);
  transform: translateY(0);
}

.country-choice {
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  background: var(--platinum);
  display: grid;
  place-items: center;
  padding: 6px;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(.2, 0, .2, 1);
}

.country-choice:active {
  transform: scale(0.92);
}

.country-choice.selected {
  background: var(--blue);
  box-shadow: 0 8px 18px rgb(46 128 228 / 24%);
}

.country-choice img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

@media (max-width: 719px) {
  main {
    width: min(100%, 446px);
    padding-inline: 18px;
  }

  .hero {
    min-height: max(620px, 100svh);
  }

  .hero-center {
    gap: clamp(28px, 4.2vh, 38px);
    transform: translateY(-4px);
  }

  .orbit {
    width: min(370px, calc(100vw - 36px));
    height: calc(min(370px, calc(100vw - 36px)) * 0.61);
  }

  .wordmark {
    font-size: clamp(78px, 21.2vw, 104px);
  }

  .living-sentence {
    width: min(100%, 370px);
    font-size: clamp(38px, 10.4vw, 46px);
    line-height: 1.04;
  }

  .flag {
    width: clamp(28px, 8vw, 33px);
    height: clamp(28px, 8vw, 33px);
  }

  .f-gb { --rx: 0px; --ry: -80px; }
  .f-de { --rx: 129px; --ry: -49px; }
  .f-fr { --rx: 151px; --ry: 36px; }
  .f-es { --rx: 65px; --ry: 76px; }
  .f-it { --rx: -65px; --ry: 76px; }
  .f-se { --rx: -151px; --ry: 36px; }
  .f-ua { --rx: -129px; --ry: -49px; }

  .country-button {
    width: 102px;
  }

  .country-button.multi {
    width: 146px;
  }

  .country-sheet {
    max-height: 58svh;
    padding: 16px;
  }

  .country-scrollbar {
    display: none;
  }

  .country-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: calc(58svh - 98px);
    padding-right: 2px;
  }

  .phone-shot {
    width: 100%;
    max-width: 392px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue {
    animation: none;
  }

  .flag {
    animation: none;
  }
}
