/* ChallengeSphere website. One stylesheet for every page; no build step, no scripts. */

:root {
  /* The app's palette (ChallengeSphere/Theme/Palette.swift). */
  --ground: #f6f2ff;
  --card: #ffffff;
  --soft: #ece6fb;
  --line: #e2daf5;
  --ink: #1f1447;
  --muted: #655c80;
  --violet: #5b3fd9;
  --violet-soft: #f1ecff;
  --lose-tint: #ffe6df;

  --yellow: #ffd93b;
  --yellow-edge: #d9b01e;
  --pink: #ff7eb6;
  --green: #3ddc84;
  --blue: #5bb8ff;
  --teal: #3ddbc0;
  --coral: #ff8a6b;

  /* The two halves of the logo. Change them here (and in favicon.svg) to recolour it. */
  --logo-left: var(--yellow);
  --logo-right: var(--teal);

  --radius-card: 24px;
  --radius-tile: 14px;
  --page-width: 44rem;
  --wide-width: 62rem;

  /* Rounded system type, as in the app. No web fonts are loaded. */
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 7vw, 3rem);
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 800;
}

p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.4rem;
}

a {
  color: var(--violet);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

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

strong {
  font-weight: 800;
}

/* ---------- Page frame ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
}

.skip-link:focus {
  top: 1rem;
  color: #ffffff;
}

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.wide {
  max-width: var(--wide-width);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
}

.brand .logo {
  width: 2.25rem;
  height: 2.25rem;
}

.wordmark-accent {
  color: var(--violet);
}

.site-nav ul,
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li,
.site-footer li {
  margin: 0;
}

.site-nav a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration-color: var(--yellow-edge);
  text-decoration-thickness: 4px;
}

main {
  padding-block: 1rem 3rem;
}

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer p {
  margin-top: 0.25rem;
}

/* ---------- Logo ---------- */

.logo {
  display: block;
  flex: none;
}

.logo-edge,
.logo-seam {
  fill: var(--ink);
  stroke: var(--ink);
}

.logo-edge {
  stroke: none;
}

.logo-seam {
  fill: none;
}

.logo-left {
  fill: var(--logo-left);
}

.logo-right {
  fill: var(--logo-right);
}

/* ---------- Cards and notices ---------- */

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}

.stack > * + * {
  margin-top: 1rem;
}

.stack > h2 {
  margin-top: 2.25rem;
}

.stack > h3 {
  margin-top: 1.5rem;
}

.stack > h2 + *,
.stack > h3 + * {
  margin-top: 0.6rem;
}

.lede {
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 600;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* "Draft, not yet reviewed". Loud on purpose: remove it only after the page has been reviewed. */
.draft-notice {
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 0 var(--ink);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.draft-notice .draft-title {
  font-size: 1.25rem;
  line-height: 1.15;
}

.draft-notice .draft-title strong {
  font-weight: 900;
}

.draft-notice > * + * {
  margin-top: 0.5rem;
}

.draft-notice a {
  color: var(--ink);
}

/* A value that still has to be filled in. */
.placeholder {
  background: var(--lose-tint);
  border: 2px dashed var(--ink);
  border-radius: 8px;
  padding: 0.05em 0.4em;
  color: var(--ink);
  font-weight: 800;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  padding: 0.1em 0.7em;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: 0.1em;
}

.callout {
  background: var(--lose-tint);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font-weight: 800;
}

.note {
  background: var(--violet-soft);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

/* ---------- Rules list (terms) ---------- */

.rules {
  list-style: none;
  padding: 0;
}

.rules.card {
  padding: 1.25rem;
}

.rules li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.rules li + li {
  margin-top: 1rem;
}

.rules .tile,
.highlight .tile {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

.rules p {
  color: var(--muted);
}

/* ---------- Steps (support) ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  min-height: 2rem;
}

.steps li + li {
  margin-top: 0.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--yellow);
  font-weight: 900;
}

.contact-list {
  margin: 0;
}

.contact-list dt {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 800;
}

.contact-list dd {
  margin: 0.15rem 0 0;
  font-weight: 800;
}

.contact-list dd + dt {
  margin-top: 0.9rem;
}

/* ---------- Landing page ---------- */

.hero {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding-block: 1.5rem 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 10vw, 4rem);
}

.tagline {
  max-width: 24ch;
  font-size: clamp(1.25rem, 5vw, 1.625rem);
  font-weight: 800;
  line-height: 1.3;
  text-wrap: balance;
}

/* A note, not a button: there is nothing to download yet. */
.coming-soon {
  display: inline-block;
  margin-top: 0.5rem;
  border-radius: 16px;
  background: var(--yellow);
  padding: 0.5rem 1.1rem;
  font-size: 1.0625rem;
  font-weight: 900;
}

.highlights {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlights li {
  margin: 0;
}

.highlight {
  height: 100%;
}

.highlight .tile {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 16px;
  margin-bottom: 0.9rem;
}

.highlight .tile svg {
  width: 1.75rem;
  height: 1.75rem;
}

.highlight h3 {
  font-size: 1.1875rem;
  font-weight: 900;
}

.highlight p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-weight: 600;
}

.highlight .tile.tile-pink {
  background: var(--pink);
}

.highlight .tile.tile-blue {
  background: var(--blue);
}

.highlight .tile.tile-green {
  background: var(--green);
}

.promise {
  margin-top: 1.5rem;
  text-align: center;
}

.promise h2 {
  margin-bottom: 0.5rem;
}

.promise p {
  max-width: 38rem;
  margin-inline: auto;
  color: var(--muted);
  font-weight: 600;
}

.section-title {
  margin: 0 0 1rem;
  text-align: center;
}

@media (min-width: 46rem) {
  .highlights {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    padding: 1.5rem;
  }
}

@media print {
  .site-nav,
  .skip-link {
    display: none;
  }

  body {
    background: #ffffff;
  }
}
