/*
 * Colours are the CTGT brand tokens the probe challenge uses
 * (sae-probe-challenge/frontend/src/styles/tokens.css), so the two read as
 * one product. Type is Switzer alone, self-hosted: a font CDN would see every
 * visitor, and the footer says the page collects nothing.
 */

@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Switzer;
  src: url('fonts/Switzer-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font: Switzer, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --paper: #f6f6f6;
  --ink: #17201b;
  --ink-2: #454d49;
  --ink-3: #5c625f;
  --line: #d1d2d1;
  --line-strong: #b9bcba;

  /* Focus ring and link hover. */
  --accent: #0ca678;
  --action: #0f766e;
  --accent-soft: #d5f2e6;

  /* The sage and sand wash behind the page, the same as the app's rules and sign-in screens
     (app/web/shared/app.css). */
  --glow-sage: rgba(150, 192, 174, 0.55);
  --glow-sand: rgba(228, 206, 160, 0.55);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --gutter: clamp(16px, 5vw, 48px);
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(65% 60% at 22% 85%, var(--glow-sage), transparent 72%),
    radial-gradient(60% 58% at 76% 72%, var(--glow-sand), transparent 72%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
p,
ul,
ol {
  margin: 0;
}

img {
  display: block;
}

::selection {
  background: var(--accent-soft);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition:
    color 150ms var(--ease),
    text-decoration-color 150ms var(--ease);
}

a:hover {
  color: var(--action);
  text-decoration-color: currentColor;
}

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

strong {
  font-weight: 500;
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
  padding-top: clamp(64px, 14vh, 152px);
}

/* Light and tight. The size carries it, as the probe challenge's `.display` does. */
.wordmark {
  font-size: clamp(50px, 14.5vw, 172px);
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 0.88;
  /* Pull the L's side bearing flush with the text below it. */
  margin-left: -0.05em;
}

.subtitle {
  margin-top: clamp(20px, 2.6vw, 32px);
  max-width: 24em;
  color: var(--ink-2);
  font-size: clamp(19px, 2.3vw, 27px);
  letter-spacing: -0.012em;
  line-height: 1.25;
  text-wrap: balance;
}

.venue {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 15px;
}

/* The page's one action, under the title. Same square fill as the app's
   submit button, in this page's color. */
.join {
  display: inline-flex;
  align-items: center;
  margin-top: 22px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--action);
  background: var(--action);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease);
}

a.join:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* Before registration opens the button is a label, not a link, so it drops the fill. */
.join-closed {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-2);
}

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

.strip {
  height: clamp(88px, 11vw, 140px);
  margin-top: clamp(56px, 8vw, 96px);
}

.strip svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.strip-bars {
  fill: var(--ink);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: rise 1200ms var(--ease) 150ms both;
}

.strip-base {
  stroke: var(--line-strong);
}

@keyframes rise {
  from {
    transform: scaleY(0);
  }
}

/* ---- Sections ----------------------------------------------------------- */

main {
  margin-top: clamp(56px, 8vw, 96px);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 38rem);
  column-gap: clamp(24px, 6vw, 96px);
  padding-block: clamp(32px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.row h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.6;
}

.body > * + * {
  margin-top: 16px;
}

.lede {
  font-size: clamp(19px, 1.9vw, 21px);
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.body p:not(.lede),
.points li,
.timeline li {
  color: var(--ink-2);
}

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

.points li {
  position: relative;
  padding-left: 22px;
}

.points li + li {
  margin-top: 12px;
}

.points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--ink-3);
}

/* A real sequence, so it gets a spine: one node per step. */
.timeline {
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding-left: 22px;
  padding-bottom: 12px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--ink);
}

/* Runs from just under this node to just above the next one, which sits
   0.66em into the following item. */
.timeline li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: calc(0.66em + 9px);
  bottom: calc(3px - 0.66em);
  width: 1px;
  background: var(--line);
}

.timeline strong {
  font-variant-numeric: tabular-nums;
}

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

.people li {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
}

.people li + li {
  margin-top: 6px;
}

.people .aff {
  color: var(--ink-3);
}

/* ---- Footer ------------------------------------------------------------- */

/* Notes on the left, the CTGT lockup on the right, both on the last baseline. */
.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 32px;
  row-gap: 24px;
  padding-top: 28px;
  padding-bottom: 56px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.55;
}

/* The rule spans the content, not the gutter, so it lines up with the rows above. */
.footer::before {
  content: '';
  grid-column: 1 / -1;
  height: 1px;
  margin-bottom: 4px;
  background: var(--line);
}

.footer p + p {
  margin-top: 4px;
}

/* ctgt-logo.png is 429x120 with the mark inside 63px of padding left, 64px
   right and 19px top and bottom. The margins cancel that padding at whatever
   height the image is drawn, so the mark's edges sit on the content edge and
   its foot on the last line of the notes. */
.footer-mark {
  --logo-h: 32px;
  margin-right: calc(var(--logo-h) * -64 / 120);
  margin-bottom: calc(var(--logo-h) * -19 / 120);
}

.footer-mark img {
  width: auto;
  height: var(--logo-h);
}

/* ---- Narrow ------------------------------------------------------------- */

@media (max-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }

  .footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-mark {
    justify-self: start;
    margin-right: 0;
    margin-left: calc(var(--logo-h) * -63 / 120);
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip-bars {
    animation: none;
  }

  a {
    transition: none;
  }
}
