/*
 * thrive-global's public pages (#220). Thrive's colours are the same values
 * thrive-users defines (cream, ink, red), restated here because a service's
 * assets do not reach into another's. No web fonts, no images but the mark,
 * nothing fetched from another origin; the stars are gradients.
 *
 * Contrast: ink on cream 16:1, muted on cream 5.9:1, cream on red 4.8:1;
 * cream on the night sky above 14:1, its muted tone above 9:1; the card
 * border (cream at 50%) about 4:1 against the sky, above the 3:1 for UI.
 */
:root {
  --red: #d42a2a;
  --red-dark: #b41f1f;
  --cream: #fbf8f3;
  --sand: #f3eee6;
  --ink: #1c1917;
  --muted: #625a53;
  --line: #e7e0d6;
  --night: #0b1026;
  --night-2: #17143d;
  --night-3: #2a1745;
  --star: rgba(251, 248, 243, 0.85);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

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

.bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* ------------------------------------------------------------- home -- */

.home {
  background: var(--cream);
  color: var(--ink);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 1.25rem 5rem;
  text-align: center;
}

.hero-mark { width: 5rem; height: 5rem; }

.hero h1 {
  margin: 2.5rem 0 0;
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 36rem;
  margin: 1.5rem auto 0;
  font-size: 1.125rem;
  color: var(--muted);
}

.cta { margin: 2.5rem 0 0; }

.note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--red-dark); }
.button-small { padding: 0.5rem 1.25rem; font-size: 0.875rem; }

.foot {
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.foot p { margin: 0; }

/* ----------------------------------------------- the region picker -- */

.space {
  position: relative;
  color: var(--cream);
  background: var(--night);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 115%, rgba(212, 42, 42, 0.28), transparent 70%),
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(88, 76, 196, 0.25), transparent 70%),
    linear-gradient(170deg, var(--night) 0%, var(--night-2) 45%, var(--night-3) 100%);
  background-attachment: fixed;
}

.space :focus-visible { outline-color: var(--cream); }

/* Two layers of stars, tiled at different sizes so the pattern does not show. */
.sky,
.sky::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.sky {
  background-image:
    radial-gradient(1px 1px at 20px 30px, var(--star), transparent),
    radial-gradient(1px 1px at 140px 80px, var(--star), transparent),
    radial-gradient(1.5px 1.5px at 90px 170px, var(--star), transparent),
    radial-gradient(1px 1px at 210px 220px, var(--star), transparent),
    radial-gradient(1px 1px at 260px 40px, var(--star), transparent);
  background-size: 300px 260px;
  opacity: 0.55;
}
.sky::before {
  content: "";
  background-image:
    radial-gradient(1.5px 1.5px at 60px 120px, var(--star), transparent),
    radial-gradient(1px 1px at 330px 60px, var(--star), transparent),
    radial-gradient(2px 2px at 420px 300px, var(--star), transparent),
    radial-gradient(1px 1px at 180px 380px, var(--star), transparent);
  background-size: 470px 430px;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.9; }
}

.picker {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
  text-align: center;
}

.picker h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.picker .lead { color: rgba(251, 248, 243, 0.82); }

.regions { width: 100%; margin-top: 2.5rem; }

.regions ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 26rem) {
  .regions ul { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (min-width: 48rem) {
  .regions ul { grid-template-columns: repeat(4, 1fr); }
}

.region {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 8.5rem;
  padding: 1.25rem 1rem;
  border: 1px solid rgba(251, 248, 243, 0.5);
  border-radius: 1.25rem;
  background: rgba(251, 248, 243, 0.06);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.region:hover {
  border-color: rgba(240, 122, 110, 0.9);
  background: rgba(251, 248, 243, 0.11);
  transform: translateY(-2px);
}
.region:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
  background: rgba(251, 248, 243, 0.11);
}

.code {
  min-width: 2.75rem;
  text-align: center;
  padding: 0.125rem 0.625rem;
  border: 1px solid rgba(251, 248, 243, 0.4);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.name { font-size: 1.25rem; font-weight: 500; }

/* Below two columns, a card is a row: the code, then the name. */
@media (max-width: 25.99rem) {
  .region { flex-direction: row; justify-content: flex-start; min-height: 4rem; gap: 1rem; }
}

/* ------------------------------------------------------------ motion -- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .region:hover { transform: none; }
}
