:root {
  --strava: #fc4c02;
  --ink: #16181d;
  --ink-soft: #5d646f;
  --paper: #fbfaf8;
  --card: #ffffff;
  --line: #e6e3dd;
  --danger: #b3261e;
  --radius: 12px;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef2;
    --ink-soft: #9aa2ae;
    --paper: #14161a;
    --card: #1c1f25;
    --line: #2c3038;
    --danger: #ff8a80;
  }
}

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

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--measure); margin: 0 auto; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }
a { color: inherit; text-underline-offset: 3px; }

/* Masthead ---------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.wordmark {
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.5rem;
  border-radius: 2px;
  background: var(--strava);
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; }

.linkish {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

/* Flash ------------------------------------------------------------------- */

.flash {
  max-width: var(--measure);
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.925rem;
}
.flash--alert { border-color: var(--danger); color: var(--danger); }

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

.hero { padding: 3rem 0; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--ink-soft); }
.hero p { color: var(--ink-soft); max-width: 34rem; }

.fineprint { font-size: 0.85rem; color: var(--ink-soft); margin-top: 1.25rem; }
.fineprint code {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--card);
  border: 1px solid var(--line);
}

/* Buttons ----------------------------------------------------------------- */

.button, input[type="submit"] {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.925rem;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, input[type="submit"]:hover { opacity: 0.88; }

.button--strava { background: var(--strava); color: #fff; font-size: 1rem; padding: 0.85rem 1.6rem; }

.button--quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
}
.button--quiet:hover { color: var(--ink); border-color: var(--ink-soft); opacity: 1; }

/* Card / form ------------------------------------------------------------- */

.card {
  padding: 1.75rem;
  margin-bottom: 3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

textarea {
  display: block;
  width: 100%;
  margin: 1rem 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  font: inherit;
  resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--strava); outline-offset: 1px; }

.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.925rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.switch input { margin-top: 0.35rem; accent-color: var(--strava); }

.card input[type="submit"] { margin-top: 0.75rem; }

/* Activities -------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h1, .section-head h2 { margin: 0; }

.activities { list-style: none; margin: 0; padding: 0; }

.activity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.activity:last-child { border-bottom: 1px solid var(--line); }
.activity h3 a { text-decoration: none; }
.activity h3 a:hover { text-decoration: underline; }
.activity p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.activity__was em { font-style: normal; }
.activity__error { color: var(--danger) !important; }
.activity form { flex: none; }

.empty, .more { font-size: 0.9rem; color: var(--ink-soft); }
.more { margin-top: 1rem; }
