:root {
  --bg: #FFFFFF;
  --fg: #111111;
  --muted: #6B6B6B;
  --soft: #555555;
  --rule: #E6E6E6;
  --serif: 'Sorts Mill Goudy', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

body.index {
  --bg: #0E0E0E;
  --fg: #F2F2F2;
  --muted: #A3A3A3;
  --soft: #A3A3A3;
  --rule: #2E2E2E;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body.toggleable { cursor: pointer; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}
a:hover { opacity: 0.6; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.italic { font-style: italic; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 40px 72px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.wordmark {
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 13px;
}
.toggle {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}
.toggle .read-label { color: var(--fg); }
.toggle .index-label { color: #8A8A8A; }
body.index .toggle .read-label { color: #6F6F6F; }
body.index .toggle .index-label { color: var(--fg); }

/* Views */
body.index .view-read { display: none; }
body:not(.index) .view-index { display: none; }

/* Read view */
.blurb {
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-size: clamp(24px, 2.9vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.blurb p { margin: 0; }
.fake-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.details {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 19px;
  line-height: 1.5;
}
.details > div {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Index view */
.index-main {
  display: flex;
  flex-direction: column;
  gap: 56px;
  font-size: 20px;
  line-height: 1.45;
}
.row-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
}
.row-section > .label {
  flex: 1 1 160px;
  margin: 0;
  padding-top: 6px;
}
.row-section > .rows {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.row:last-child { border-bottom: 0; }
.row .meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack p { margin: 0; }
.inline-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }

.stats { display: flex; flex-wrap: wrap; gap: 24px 48px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 48px; line-height: 1.1; font-variant-numeric: tabular-nums; min-width: 3ch; }
.stat-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.ride-list { display: flex; flex-direction: column; }
.ride {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.ride .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.view-on-strava { font-weight: 600; }

.attribution {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.attribution img { height: 16px; width: auto; }

/* Footer */
.site-email { font-size: clamp(20px, 2.2vw, 26px); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Project pages */
.project-hero { display: flex; flex-direction: column; gap: 20px; }
.project-title {
  margin: 0;
  font-size: clamp(80px, 12vw, 160px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.project-sub {
  margin: 0;
  max-width: 820px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
}
.pronounce {
  margin: 0;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.3;
  font-style: italic;
  color: var(--soft);
}
.pronounce + .project-sub { margin-top: 12px; }
.overview {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.overview > div { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; }
.overview .value { font-size: 20px; }
.screens { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.screen {
  flex: 1 1 240px;
  max-width: 340px;
  aspect-ratio: 9 / 19.5;
  border-radius: 40px;
  background: #F4F3F0;
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.screen img { width: 100%; height: 100%; object-fit: cover; }
.screens-block { display: flex; flex-direction: column; gap: 14px; }
.screens.is-switchable .screen { cursor: pointer; position: relative; }
.screen .screen-next { position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s ease; }
.screen .screen-next.is-in { opacity: 1; }
.theme-toggle { align-self: flex-start; margin: 0; padding: 0; background: none; border: 0; cursor: pointer; }
.theme-toggle:hover { color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .screen .screen-next { transition: none; } }
.prose {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.3;
}
.prose p { margin: 0; }
.feature {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.feature:last-child { border-bottom: 1px solid var(--rule); }
.feature > :first-child { flex: 1 1 200px; }
.feature > :last-child { flex: 2 1 320px; color: var(--soft); font-style: italic; }

@media (max-width: 640px) {
  .wrap { padding: 24px 20px 56px; gap: 48px; }
  .wordmark { font-size: 30px; }
  .blurb { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html, body { transition: none; }
}
