:root {
  color-scheme: light;
  --paper: #e7e7df;
  --card: #f6f6f0;
  --ink: #161a14;
  --muted: #565c4f;
  --brass: #7a5716;
  --line: #cbccc0;
  --sage: #4c6647;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.65s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.85;
}

body::before {
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(76, 102, 71, 0.18), transparent 58%),
    radial-gradient(720px 380px at 100% 0%, rgba(122, 87, 22, 0.12), transparent 52%);
}

body::after {
  z-index: -1;
  background:
    radial-gradient(520px 280px at 85% 72%, rgba(76, 102, 71, 0.10), transparent 60%),
    radial-gradient(480px 260px at 10% 88%, rgba(122, 87, 22, 0.08), transparent 55%);
}

.motion-on body::before {
  animation: aurora-a 22s var(--ease-out) infinite alternate;
}

.motion-on body::after {
  animation: aurora-b 28s var(--ease-out) infinite alternate;
}

@keyframes aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.04); }
}

@keyframes aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.02); }
  to { transform: translate3d(-3%, -2%, 0) scale(1); }
}

a {
  color: var(--brass);
  font-weight: 650;
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}

nav a {
  position: relative;
  color: var(--muted);
  font-weight: 600;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
  border-radius: 2px;
}

nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

nav a:hover::after {
  transform: scaleX(1);
}

.wrap {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 0 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
  transition: transform 0.4s var(--ease-out);
}

.brand:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(122, 87, 22, 0.28);
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.motion-on .brand:hover img {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: 0 8px 24px rgba(122, 87, 22, 0.22);
}

nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.94rem;
}

main {
  padding: 28px 0 72px;
}

.kicker {
  color: var(--sage);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 14px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 600;
}

h2 {
  margin-top: 32px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.lede, .updated, p, li {
  color: var(--muted);
}

.updated { margin: 0 0 22px; font-size: 0.92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  transition:
    transform 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
}

.motion-on .card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 87, 22, 0.35);
  box-shadow:
    0 18px 40px rgba(22, 26, 20, 0.08),
    0 0 0 1px rgba(122, 87, 22, 0.12);
}

.card p { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0 8px;
}

/* Hero route (home) */
.measure-route {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 26px 0 8px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px dashed rgba(122, 87, 22, 0.35);
  background: rgba(246, 246, 240, 0.72);
  backdrop-filter: blur(6px);
}

.measure-route .stop {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.measure-route .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(76, 102, 71, 0.18);
}

.motion-on .measure-route .dot {
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.measure-route .stop:nth-child(1) .dot { animation-delay: 0s; }
.measure-route .stop:nth-child(3) .dot { animation-delay: 0.5s; }
.measure-route .stop:nth-child(5) .dot { animation-delay: 1s; }
.measure-route .stop:nth-child(7) .dot { animation-delay: 1.5s; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(76, 102, 71, 0.18); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(76, 102, 71, 0.08); }
}

.measure-route .segment {
  flex: 1 1 auto;
  height: 2px;
  margin: 0 6px 18px;
  background: linear-gradient(90deg, var(--line), var(--brass), var(--line));
  background-size: 200% 100%;
  border-radius: 2px;
  opacity: 0.7;
}

.motion-on .measure-route .segment {
  animation: flow-line 2.8s linear infinite;
}

@keyframes flow-line {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Entrance */
.motion-on [data-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  animation: rise-in var(--dur) var(--ease-out) forwards;
  animation-delay: calc(0.07s * var(--i, 0));
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
}

.reveal-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reduce-motion .reveal-scroll {
  opacity: 1;
  transform: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .measure-route {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
  }
  .measure-route .segment {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-on body::before,
  .motion-on body::after,
  .motion-on .measure-route .dot,
  .motion-on .measure-route .segment,
  .motion-on [data-stagger] > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
