/* ---------------------------------------------------------------
   peterkobak.com — Ohio to Erie ride
   Palette pulled from the trail itself: crushed limestone, towpath
   green blazes, canal water, and the orange of a you-are-here pin.
   --------------------------------------------------------------- */

:root {
  --paper:       #E9E6DC;
  --paper-deep:  #DFDBCC;
  --paper-edge:  #F3F1E9;
  --ink:         #23261F;
  --ink-soft:    #5C6155;
  --ink-faint:   #8A8D80;
  --rule:        #C7C2B1;
  --trail:       #4A6B3A;
  --canal:       #2F566B;
  --marker:      #C4502B;

  --display: 'Zilla Slab', Georgia, serif;
  --body:    'Source Serif 4', Georgia, serif;
  --data:    'IBM Plex Mono', ui-monospace, monospace;

  --measure: 34rem;
  --gutter:  1.5rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  /* Faint topo-contour texture. Two very low-contrast gradients, not an image
     file — keeps the page fast on trailside cell service. */
  background-image:
    repeating-linear-gradient(112deg, rgba(74,107,58,.035) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(28deg,  rgba(47,86,107,.03) 0 1px, transparent 1px 64px);
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--narrow { max-width: var(--measure); }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }

h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.7rem); letter-spacing: -0.005em; }
h3 { font-size: 1.05rem; font-weight: 500; }

p { margin: 0 0 1.15em; }

a { color: var(--canal); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.eyebrow {
  font-family: var(--data);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}

.lede { font-size: 1.16rem; color: var(--ink-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Structure ---------- */

.masthead { padding: 3.5rem 0 0; }

.section { padding: 2.75rem 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }

.section__title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.section__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---------- The mile ribbon: the route as a profile you fill in ---------- */

.ribbon { margin: 2rem 0 0; }

.ribbon__track {
  position: relative;
  height: 66px;
  border-bottom: 2px solid var(--ink);
}

.ribbon__profile { display: block; width: 100%; height: 100%; }

.ribbon__fill { fill: rgba(74,107,58,.28); stroke: var(--trail); stroke-width: 1.5; }
.ribbon__rest { fill: none; stroke: var(--rule); stroke-width: 1.5; }

.ribbon__pin {
  position: absolute;
  bottom: -7px;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: var(--marker);
  box-shadow: 0 0 0 3px var(--paper);
  transition: left .6s ease;
}
.ribbon__pin::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--marker);
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(.7); opacity: .7; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { opacity: 0; }
}

.ribbon__ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.55rem;
}

/* ---------- Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.stat { background: var(--paper-edge); padding: 1rem 1.1rem; }

.stat__label {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
}

.stat__value {
  font-family: var(--data);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.stat__unit { font-size: 0.8rem; color: var(--ink-soft); margin-left: 0.15em; }

/* ---------- Status pill ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--data);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}
.pill--riding   { color: var(--trail); }
.pill--resting  { color: var(--ink-faint); }
.pill--finished { color: var(--canal); }

.pill__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.pill--riding .pill__dot { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Map ---------- */

#map {
  height: 340px;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

/* ---------- The ask ---------- */

.ask {
  background: var(--canal);
  color: #F1EFE7;
  padding: 1.75rem;
}
.ask h2 { color: #fff; margin-bottom: 0.6rem; }
.ask p { color: #D2DDE4; }
.ask a { color: #fff; }

.button {
  display: inline-block;
  font-family: var(--data);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper-edge);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #000; color: #fff; }

.ask .button { background: var(--paper-edge); color: var(--canal); }
.ask .button:hover { background: #fff; color: var(--ink); }

.button--wide { width: 100%; text-align: center; }

/* ---------- Form ---------- */

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-family: var(--data);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.field input[type=text],
.field input[type=email],
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  background: var(--paper-edge);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus,
.button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--canal);
  outline-offset: 2px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  cursor: pointer;
}
.check input { margin-top: 0.45rem; flex: none; }

.check-group {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}

.nested { padding-left: 1.55rem; margin-bottom: 1.25rem; }

.hp { position: absolute; left: -9999px; }

.note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

.flash {
  border-left: 3px solid var(--trail);
  background: var(--paper-edge);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.flash--bad { border-left-color: var(--marker); }
.flash p:last-child { margin-bottom: 0; }

/* ---------- Photos ---------- */

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.photos figure { margin: 0; }
.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}
.photos figcaption {
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding-top: 0.35rem;
}

/* ---------- Messages ---------- */

.msg {
  border-left: 2px solid var(--rule);
  padding: 0.1rem 0 0.1rem 1rem;
  margin-bottom: 1.35rem;
}
.msg p { margin: 0 0 0.2rem; }
.msg__by {
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* ---------- Day ledger ---------- */

.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ledger th {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  text-align: right;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.ledger th:first-child, .ledger td:first-child { text-align: left; }
.ledger td {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.ledger td:first-child { font-family: var(--body); }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .is-today td { color: var(--trail); }

/* ---------- Gate ---------- */

.gate { max-width: 30rem; margin: 6rem auto; padding: 0 var(--gutter); }

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .masthead { padding-top: 2.25rem; }
  .section { padding: 2rem 0; }
  #map { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
