@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --chalk:    #f5f2eb;
  --chalk-dk: #e8e3d8;
  --ink:      #1a1a18;
  --ink-soft: #4a4940;
  --downs:    #4a6741;
  --downs-lt: #6d9463;
  --sky:      #5c7fa3;
  --gold:     #c8952a;
  --red:      #b83232;
  --border:   #ccc8bc;
  --serif:    'Source Serif 4', Georgia, serif;
  --display:  'Fjalla One', sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--chalk);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
}

/* ── NAV ── */
header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--downs);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
  min-height: 58px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img { height: 36px; width: auto; }

.nav-logo span {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--chalk);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

nav { display: flex; gap: 0; flex-wrap: wrap; margin-left: auto; }

nav a {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaa9a0;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-bottom: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}

nav a:hover, nav a.active {
  color: var(--chalk);
  border-bottom-color: var(--downs-lt);
}

/* ── HERO ── */
.hero {
  background: var(--ink);
  color: var(--chalk);
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 41px
  );
}

.hero-kicker {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--chalk);
    margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: #ccc8be;
  max-width: 520px;
  margin: 0 auto 2rem;
  font-style: italic;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.hero-stat strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  color: var(--gold);
}

.hero-stat span {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--chalk);
}

/* ── RECORD BANNER ── */
.record-banner {
  background: var(--downs);
  color: var(--chalk);
  text-align: center;
  padding: 0.8rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.record-banner strong { color: var(--gold); }

/* ── LAYOUT ── */
.site-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

/* ── PAGE HEADER ── */
.page-header {
  background: var(--ink);
  color: var(--chalk);
  padding: 3rem 1.5rem 2.5rem;
}

.page-header .page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.4rem;
}

.page-header .sub {
  color: #aaa9a0;
  font-style: italic;
}

/* ── POSTS GRID ── */
.posts-grid {
  display: grid;
  gap: 2rem;
}

.post-card {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

.post-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.post-card-body {
  padding: 1.1rem 1.2rem 1.1rem 0;
  display: flex;
  flex-direction: column;
}

.post-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.post-card h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--downs); }

.post-card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 0.8rem;
}

.read-more {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--downs);
  text-decoration: none;
  border-bottom: 1px solid var(--downs-lt);
  padding-bottom: 1px;
  align-self: flex-start;
}

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sidebar-widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.widget-title {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
}

.widget-body { padding: 1rem; }

.record-box {
  text-align: center;
  padding: 1.2rem 1rem;
}

.record-box .record-name {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
}

.record-box .record-time {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0.3rem 0;
}

.record-box .record-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}

.widget-links { list-style: none; }

.widget-links li { border-bottom: 1px solid var(--chalk-dk); }
.widget-links li:last-child { border-bottom: none; }

.widget-links a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--downs);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.widget-links a:hover { background: var(--chalk); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid var(--border);
}

thead th {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 0.9rem;
  text-align: left;
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--chalk-dk); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #faf9f5; }

td {
  padding: 0.55rem 0.9rem;
  color: var(--ink-soft);
  vertical-align: middle;
}

td:first-child { font-weight: 600; color: var(--ink); }

.time-cell {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--downs);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  white-space: nowrap;
}

.badge-alpine { background: #e8f0e6; color: var(--downs); }
.badge-supported { background: #e6ecf2; color: var(--sky); }
.badge-self { background: #f5eee0; color: #a07020; }

.gold-row td:first-child { color: var(--gold); }

/* ── PROSE ── */
.prose { max-width: 720px; }

.prose h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 2rem 0 0.6rem;
  color: var(--ink);
}

.prose h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 1.5rem 0 0.4rem;
  color: var(--downs);
}

.prose p { margin-bottom: 1rem; }

.prose ul, .prose ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.prose li { margin-bottom: 0.3rem; }

.prose a { color: var(--downs); }
.prose strong { font-weight: 600; }

.prose em { font-style: italic; color: var(--ink-soft); }

.prose .note {
  background: #f0f4ef;
  border-left: 3px solid var(--downs);
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  border-radius: 0 2px 2px 0;
}

/* ── POST PAGE ── */
.post-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  margin-bottom: 2rem;
  border-radius: 3px;
}

.post-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.time-highlight {
  display: inline-flex;
  align-items: center;
  vertical-align: top;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 1.1rem;
  min-height: 42px;
  padding: 0 1rem;
  line-height: 1;
  border-radius: 2px;
  margin: 0.8rem 0 1.5rem;
}

.post-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.post-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 2px;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  z-index: 1200;
  padding: 2rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-content {
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 2.6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
}

.lightbox-caption {
  color: #f2f2f2;
  font-size: 0.88rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.32);
}

.strava-link {
  display: inline-flex;
  align-items: center;
  vertical-align: top;
  gap: 0.5rem;
  background: #fc4c02;
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 42px;
  padding: 0 1.1rem;
  line-height: 1;
  border-radius: 2px;
  margin: 0.8rem 0 1.5rem;
  transition: opacity 0.15s;
}

.strava-link:hover { opacity: 0.85; }

/* ── SECTION HEADERS ── */
.section-heading {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--ink);
  border-bottom: 2px solid var(--downs);
  padding-bottom: 0.4rem;
  margin-bottom: 1.5rem;
}

/* ── CTA CARDS ── */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}

.cta-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.4rem;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}

.cta-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.cta-card .cta-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--downs);
}

.cta-card .cta-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta-card h3 {
  font-family: var(--display);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.cta-card p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ── CONTACT FORM ── */
.contact-form { max-width: 560px; }

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--downs);
}

.form-group textarea { height: 160px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--downs);
  color: #fff;
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover { background: var(--downs-lt); }

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: #6a6960;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 4rem;
  font-size: 0.85rem;
}

footer a { color: var(--downs-lt); text-decoration: none; }

/* ── TAPS TABLE ── */
.taps-dist {
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card img { height: 200px; width: 100%; }
  .post-card-body { padding: 1rem; }
  nav a { padding: 0.5rem 0.5rem; font-size: 0.7rem; }
}
