/*
 * The app's two colours and one face, on a page. Royal blue is every ground the
 * cards are dealt on, cream is what is printed on it, and the rest of the
 * palette is a tint of one of them - the same values as `src/constants/theme.ts`.
 */

:root {
  --royal: #126aff;
  --royal-deep: #0a46c4;
  --royal-light: #669fff;
  --royal-wash: #ebf2ff;
  --royal-border: #b8d2ff;
  --cream: #f7f7f7;
  --paper: #ffffff;
  --ink: #0b1533;
  --ink-muted: #5a6485;
  --cream-muted: rgba(247, 247, 247, 0.86);
  --cream-faint: rgba(247, 247, 247, 0.18);
  --gold: #f5c451;

  --measure: 62ch;
  --page: 1080px;
  --radius: 20px;

  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cream);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 20px 0;
  position: relative;
  z-index: 2;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--cream);
}

.wordmark .mark {
  width: 1.15em;
  height: 1.15em;
  display: block;
}

.wordmark.small {
  color: var(--ink);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-header nav a {
  color: var(--cream-muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover {
  color: var(--cream);
  border-bottom-color: var(--cream-faint);
}

/* --------------------------------------------------------------- hero ---- */

/*
 * The royal ground runs off the top of the page and behind the header, so the
 * mark and the nav are printed on the same blue the hero is.
 */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 46rem;
  max-height: 88vh;
  background: linear-gradient(170deg, var(--royal) 0%, var(--royal) 55%, var(--royal-deep) 100%);
  z-index: 0;
}

.hero,
.strip,
.band {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) 20px clamp(2.5rem, 6vw, 4rem);
  color: var(--cream);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cream-muted);
  margin-bottom: 1.25rem;
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--cream-muted);
  margin-bottom: 2rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--royal-deep);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--cream);
  transition: transform 120ms ease, background-color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream-faint);
}

.button.ghost:hover {
  border-color: var(--cream);
}

.fineprint {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0;
}

.hero .fineprint,
.royal .fineprint {
  color: var(--cream-muted);
}

/* -------------------------------------------------------------- strip ---- */

.strip {
  max-width: var(--page);
  margin: 0 auto clamp(3rem, 7vw, 5rem);
  padding: 0 20px;
}

.strip ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--royal-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -32px rgba(10, 70, 196, 0.6);
}

.strip li {
  background: var(--paper);
  padding: 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.strip strong {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.strip span {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* -------------------------------------------------------------- bands ---- */

.band {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 20px;
}

.band.cream,
.band.royal {
  max-width: none;
  padding-inline: 0;
}

.band.cream > *,
.band.royal > * {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 20px;
}

.band.cream {
  background: var(--royal-wash);
  padding-block: clamp(3rem, 7vw, 5rem);
}

.band.royal {
  background: var(--royal);
  color: var(--cream);
  padding-block: clamp(3rem, 7vw, 5rem);
}

.band.royal a {
  color: var(--cream);
}

/* -------------------------------------------------------------- steps ---- */

.steps {
  list-style: none;
  counter-reset: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.steps li {
  background: var(--paper);
  border: 1px solid var(--royal-border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--royal);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.steps p,
.grid p {
  color: var(--ink-muted);
  margin: 0;
}

/* --------------------------------------------------------------- grid ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem 2.5rem;
}

.grid article {
  border-top: 3px solid var(--royal);
  padding-top: 1rem;
}

/* -------------------------------------------------------------- shops ---- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split p {
  color: var(--cream-muted);
  max-width: var(--measure);
}

.cardstack {
  display: flex;
  justify-content: center;
}

/* The card as the app draws it: cream, printed, seven of ten spots filled. */
.fakecard {
  width: min(100%, 330px);
  aspect-ratio: 1.586;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.55);
  transform: rotate(-3deg);
}

.fakecard-name {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.fakecard-reward {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: auto;
}

.spots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.spots i {
  aspect-ratio: 1;
  border-radius: 999px;
  border: 2px dashed var(--royal-border);
}

.spots i.on {
  background: var(--royal);
  border: 2px solid var(--royal);
}

/* ---------------------------------------------------------------- faq ---- */

.faq {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 2.5rem;
}

.faq dt {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

.faq dd {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  max-width: var(--measure);
}

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

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 20px 4rem;
  border-top: 1px solid var(--royal-border);
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

/* --------------------------------------------------------- not found ---- */

.notfound {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 7rem) 20px 6rem;
  color: var(--cream);
}

.notfound p {
  color: var(--cream-muted);
  max-width: var(--measure);
}

@media (max-width: 760px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .cardstack {
    order: -1;
  }
}

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