/* Colorful Trips: a trip drawn as a transit line. Station-sign type (Overpass) for names and
   headings, Source Sans 3 for reading. One moment of motion: the line draws itself on load. */
:root {
  --paper: #ECEFE9;
  --board: #FBFCFA;
  --ink: #1A2131;
  --ink-soft: #535D6F;
  --rule: #CAD0C6;
  --link: #2A4A8A;
  --warn: #8F5B07;
  --line-1: #3A4C9C;
  --line-2: #1B6F78;
  --line-3: #4B6C26;
  --line-4: #C0391F;
  --shadow: rgba(26, 33, 49, .14);

  --font-sign: "Overpass", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --step--1: .8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-5: clamp(2.4rem, 7vw, 4.4rem);
  --gutter: max(16px, clamp(1rem, 4vw, 3rem));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121826;
    --board: #1A2233;
    --ink: #E4E8EF;
    --ink-soft: #A3ACBB;
    --rule: #2E384B;
    --link: #A3BCFF;
    --warn: #E9B356;
    --line-1: #9DAAF2;
    --line-2: #5EC2CA;
    --line-3: #9CC56B;
    --line-4: #F06A4F;
    --shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121826;
  --board: #1A2233;
  --ink: #E4E8EF;
  --ink-soft: #A3ACBB;
  --rule: #2E384B;
  --link: #A3BCFF;
  --warn: #E9B356;
  --line-1: #9DAAF2;
  --line-2: #5EC2CA;
  --line-3: #9CC56B;
  --line-4: #F06A4F;
  --shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.5;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }
h1, h2 { text-wrap: balance; margin: 0; font-family: var(--font-sign); }
p, ul, dl { margin: 0; }
code { font-family: var(--font-code); font-size: .92em; overflow-wrap: anywhere; }

.topbar, .wrap, .footer {
  width: 100%;
  max-width: 66rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.topbar { padding-block: 1.25rem 0; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: -.01em;
}
.wordmark-line {
  width: 2.4rem;
  height: .45rem;
  border-radius: 999px;
  background: linear-gradient(90deg,
    var(--line-1) 0 25%, var(--line-2) 25% 50%, var(--line-3) 50% 75%, var(--line-4) 75% 100%);
}
.wrap {
  display: grid;
  align-content: start;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  padding-block: clamp(2.5rem, 7vw, 5rem) 4rem;
}
.footer {
  display: flex;
  gap: 1.5rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
}
.footer a { color: var(--ink-soft); }

/* Hero */
.hero { display: grid; gap: 1.1rem; }
.hero h1 {
  font-weight: 900;
  font-size: var(--step-5);
  line-height: 1.02;
  letter-spacing: -.02em;
  max-width: 16ch;
}
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 40rem; }
.lede strong { color: var(--ink); }

/* The line: four stops, one color each. Horizontal on wide screens, a vertical line on phones. */
.line {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stop {
  --c: var(--line-1);
  position: relative;
  display: grid;
  align-content: start;
  gap: .45rem;
  padding: 1.6rem 1.25rem 0 0;
}
.stop-2 { --c: var(--line-2); }
.stop-3 { --c: var(--line-3); }
.stop-4 { --c: var(--line-4); }
.stop::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: .7rem;
  background: var(--c);
  transform-origin: left center;
  animation: draw .45s cubic-bezier(.3, .7, .2, 1) both;
}
.stop-2::before { animation-delay: .12s; }
.stop-3::before { animation-delay: .24s; }
.stop-4::before { animation-delay: .36s; border-radius: 0 999px 999px 0; }
.stop::after {
  content: "";
  position: absolute;
  left: 0;
  top: .35rem;
  width: 1.15rem;
  height: 1.15rem;
  translate: -30% -50%;
  border-radius: 50%;
  background: var(--board);
  border: 3px solid var(--ink);
}
.stop-name {
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: var(--step-2);
  line-height: 1.1;
  color: var(--c);
}
.stop-text { color: var(--ink-soft); max-width: 22rem; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 720px) {
  .line { grid-template-columns: minmax(0, 1fr); gap: 0; padding-left: .6rem; }
  .stop { padding: 0 0 1.75rem 1.6rem; }
  .stop::before {
    inset: 0 auto 0 0;
    width: .55rem;
    height: auto;
    transform-origin: center top;
    animation-name: draw-down;
  }
  .stop-4::before { border-radius: 0 0 999px 999px; }
  .stop::after { top: .1rem; left: .275rem; translate: -50% 0; }
  @keyframes draw-down { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}

/* Panels */
.connect, .consent {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--board);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 12px 32px -24px var(--shadow);
}
.connect h2 { font-weight: 800; font-size: var(--step-2); }
.consent h1 { font-weight: 900; font-size: var(--step-2); line-height: 1.15; }
.endpoint code {
  display: block;
  padding: .85rem 1rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--board);
  font-size: var(--step-1);
  user-select: all;
}
@media (max-width: 560px) { .endpoint code { font-size: .95rem; padding-inline: .75rem; } }
.quiet { color: var(--ink-soft); font-size: var(--step--1); }
.warning { color: var(--warn); font-weight: 600; }

.howto { display: grid; gap: .9rem; }
.howto div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .25rem 1rem; }
.howto dt { font-family: var(--font-sign); font-weight: 800; }
.howto dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) { .howto div { grid-template-columns: minmax(0, 1fr); } }

.button {
  display: inline-block;
  padding: .7rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--board);
  font: 700 var(--step-0) / 1.2 var(--font-text);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--link); border-color: var(--link); }
.button-quiet { background: transparent; color: var(--ink); }
.button-quiet:hover { background: transparent; color: var(--link); }
.consent-form { display: flex; flex-wrap: wrap; gap: .75rem; padding-top: .5rem; }

/* Long-form pages */
.prose { display: grid; gap: 1rem; max-width: 42rem; }
.prose h1 { font-weight: 900; font-size: var(--step-5); line-height: 1.05; }
.prose h2 { font-weight: 800; font-size: var(--step-1); padding-top: .75rem; }
.prose ul { padding-left: 1.25rem; display: grid; gap: .4rem; }

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