:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --paper-strong: #fffaf1;
  --ink: #24211d;
  --muted: #696258;
  --line: #d8d0c4;
  --rail-red: #a63e32;
  --signal-green: #285c4d;
  --lake-blue: #2a6178;
  --station-gold: #b9822b;
  --stone: #e6e2da;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(36, 33, 29, 0.16);
  --radius: 8px;
  --sans: "Source Sans 3", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(244, 241, 234, 0.84);
  border-bottom: 1px solid rgba(36, 33, 29, 0.1);
  backdrop-filter: blur(16px);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 28px rgba(36, 33, 29, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.6vw, 30px);
  font-size: 0.94rem;
  font-weight: 600;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: min(780px, 82vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  background-image: url("images/alpine-panorama.jpg?v=4");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(20, 19, 17, 0.74), rgba(20, 19, 17, 0.28) 54%, rgba(20, 19, 17, 0.1)),
    linear-gradient(0deg, rgba(20, 19, 17, 0.42), rgba(20, 19, 17, 0.02) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin: 0 clamp(18px, 6vw, 82px) clamp(78px, 12vh, 130px);
  color: var(--white);
}

.section-kicker,
.mini-label,
.entry-meta {
  margin: 0 0 12px;
  color: var(--rail-red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 720px;
  font-family: var(--serif);
  font-size: clamp(4.1rem, 11vw, 10.4rem);
  line-height: 0.9;
  font-weight: 650;
  letter-spacing: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
}

.primary-link {
  background: var(--paper-strong);
  color: var(--ink);
}

.secondary-link {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-rail-card {
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  bottom: 34px;
  z-index: 2;
  width: min(330px, calc(100% - 36px));
  padding: 18px;
  color: var(--paper-strong);
  border-left: 3px solid #f4c26f;
  background: rgba(36, 33, 29, 0.54);
  backdrop-filter: blur(14px);
}

a.hero-rail-card {
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.hero-rail-card:hover {
  border-left-color: var(--white);
  transform: translateY(-2px);
}

.hero-rail-card span,
.hero-rail-card small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
}

.hero-rail-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.1rem;
}

section {
  padding: clamp(56px, 8vw, 110px) clamp(18px, 5vw, 72px);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 34px;
}

.section-heading h2,
.intro-copy h2 {
  margin: 0;
  max-width: 780px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
  background: var(--paper);
}

.intro-copy,
.intro-grid,
.journal-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.intro-copy {
  margin-right: 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.intro-grid article {
  min-height: 230px;
  padding: 26px;
  background: var(--paper-strong);
}

.intro-grid h3,
.journal-card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-grid p,
.journal-card p {
  margin: 0;
  color: var(--muted);
}

.journal-section {
  background: var(--paper);
}

.journal-heading {
  align-items: center;
}

.journal-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.filter.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.journal-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.journal-card[hidden] {
  display: none;
}

.journal-card > a {
  display: block;
}

.journal-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: var(--stone);
  transition: transform 0.4s ease;
}

.journal-card:hover img {
  transform: scale(1.03);
}

.journal-card.feature-card {
  grid-column: span 2;
}

.journal-card.feature-card img {
  height: 360px;
}

.journal-body {
  padding: 22px;
}

.journal-body a {
  display: inline-flex;
  margin-top: 18px;
  color: var(--rail-red);
  font-weight: 800;
  text-decoration: none;
}

.journal-body a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link {
  color: var(--rail-red);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.journal-card a:focus-visible,
.archive-item:focus-visible {
  outline: 3px solid var(--rail-red);
  outline-offset: 2px;
}

.journal-seeall {
  max-width: 1180px;
  margin: 26px auto 0;
  text-align: right;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 42px clamp(18px, 5vw, 72px);
  color: var(--paper-strong);
  background: #171615;
}

.site-footer p {
  max-width: 520px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.66);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-content: start;
  justify-content: flex-end;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
}

.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.not-found-card {
  max-width: 680px;
  padding: 48px 20px;
}

.not-found-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.not-found-copy {
  color: var(--muted);
  font-size: 1.2rem;
}

.not-found-link {
  background: var(--ink);
  color: var(--white);
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-section {
    grid-template-columns: 1fr;
  }

  .intro-grid,
  .journal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journal-card.feature-card {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: min(620px, calc(100svh - 170px));
  }

  .hero-content {
    margin-bottom: 44px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 17vw, 5.1rem);
  }

  .hero-rail-card {
    display: none;
  }

  .section-heading,
  .journal-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-grid,
  .journal-grid {
    grid-template-columns: 1fr;
  }

}

/* ===================================================================
   Subpages: journal entries, archive, about
   =================================================================== */

.subpage {
  background: var(--paper);
}

.crumbs {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px clamp(18px, 5vw, 24px) 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.crumbs a {
  color: var(--rail-red);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Entry header --- */
.post-hero {
  position: relative;
  min-height: min(560px, 60vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.post-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-hero .hero-overlay {
  background:
    linear-gradient(0deg, rgba(20, 19, 17, 0.78), rgba(20, 19, 17, 0.12) 58%),
    linear-gradient(90deg, rgba(20, 19, 17, 0.5), rgba(20, 19, 17, 0));
}

.post-hero-inner {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100% - 36px));
  margin: 0 auto clamp(34px, 6vh, 64px);
  padding: 0 clamp(18px, 4vw, 24px);
  color: var(--white);
}

.post-hero-inner .entry-meta {
  color: #f4c26f;
}

.post-hero h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.98;
  font-weight: 650;
  letter-spacing: 0;
}

.post-hero .post-dek {
  max-width: 48ch;
  margin: 18px 0 0;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

/* Text-only header for entries without a photo */
.post-head-text {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 86px) clamp(18px, 5vw, 24px) clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.post-head-text h1 {
  margin: 12px 0 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5.4vw, 4.1rem);
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0;
}

.post-head-text .post-dek {
  max-width: 52ch;
  margin: 20px 0 0;
  font-size: clamp(1.12rem, 1.8vw, 1.4rem);
  line-height: 1.5;
  color: var(--muted);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 26px clamp(18px, 5vw, 24px) 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.byline .who {
  font-weight: 700;
  color: var(--ink);
}

.byline .dot {
  color: var(--line);
}

/* --- Entry prose --- */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 52px) clamp(18px, 5vw, 24px) clamp(40px, 6vw, 70px);
  font-size: 1.14rem;
  line-height: 1.72;
}

.prose p {
  margin: 0 0 1.35em;
}

.prose p:first-of-type {
  font-size: 1.2rem;
}

.prose p:first-of-type::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 3.4em;
  line-height: 0.72;
  padding: 0.06em 0.1em 0 0;
  color: var(--rail-red);
}

.prose h2 {
  margin: 1.8em 0 0.5em;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: 0;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--rail-red);
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.4;
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
}

.prose strong {
  font-weight: 700;
}

.prose ul {
  margin: 0 0 1.35em;
  padding-left: 1.2em;
}

.prose li {
  margin: 0 0 0.5em;
}

.prose .signoff {
  margin-top: 1.8em;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}

/* --- Entry footer: related + prev/next --- */
.entry-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 24px) clamp(48px, 7vw, 90px);
}

.entry-rule {
  height: 1px;
  margin: 0 0 30px;
  background: var(--line);
}

.entry-foot-label {
  margin: 0 0 16px;
  color: var(--rail-red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.related-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  text-decoration: none;
  color: var(--ink);
}

.related-card:hover {
  box-shadow: 0 10px 26px rgba(36, 33, 29, 0.1);
}

.related-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.related-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.15;
}

.entry-prevnext {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
}

.entry-prevnext a {
  max-width: 46%;
  color: var(--rail-red);
  font-weight: 700;
  text-decoration: none;
}

.entry-prevnext a small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.entry-prevnext a:last-child {
  text-align: right;
  margin-left: auto;
}

/* --- Archive page --- */
.archive-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 72px) 8px;
}

.archive-hero h1 {
  margin: 10px 0 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.98;
  font-weight: 650;
}

.archive-hero p {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
}

.archive-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(18px, 5vw, 72px) clamp(56px, 8vw, 110px);
}

.archive-list {
  border-top: 1px solid var(--line);
}

.archive-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px 28px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.archive-item[hidden] {
  display: none;
}

.archive-item:hover {
  background: linear-gradient(90deg, rgba(166, 62, 50, 0.05), transparent 40%);
}

.archive-item .a-date {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.archive-item .a-main h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.12;
  font-weight: 600;
}

.archive-item .a-main p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 60ch;
}

.archive-item .a-tag {
  align-self: center;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* --- About page --- */
.about-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 92px) clamp(18px, 5vw, 24px) clamp(48px, 7vw, 96px);
}

.about-wrap h1 {
  margin: 10px 0 0;
  max-width: 20ch;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1;
  font-weight: 650;
}

.about-lede {
  margin: 22px 0 0;
  font-size: 1.32rem;
  line-height: 1.55;
  color: var(--ink);
}

.about-photo {
  margin: 30px 0;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.about-body {
  margin-top: 8px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.about-body p {
  margin: 1.2em 0;
}

.about-body h2 {
  margin: 1.6em 0 0.4em;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 650;
}

.about-cta {
  margin: 30px 0 0;
}

@media (max-width: 680px) {
  .prose p:first-of-type::first-letter {
    font-size: 3em;
  }

  .related-links {
    grid-template-columns: 1fr;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .archive-item .a-tag {
    justify-self: start;
  }

  .entry-prevnext a {
    max-width: 100%;
  }
}

/* ===================================================================
   Admin page (display-only)
   =================================================================== */

.ops-body {
  background: #14130f;
}

.ops-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.ops-card {
  width: min(560px, 100%);
  padding: 36px clamp(22px, 5vw, 40px);
  border: 1px solid #2c2a26;
  border-radius: var(--radius);
  background: #1c1a17;
  color: #d8d2c7;
}

.ops-kicker {
  margin: 0 0 16px;
  color: #b9822b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ops-card h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 650;
  color: #fffaf1;
}

.ops-lede {
  margin: 0 0 24px;
  color: rgba(216, 210, 199, 0.78);
  line-height: 1.6;
}

.ops-meta {
  margin: 0 0 22px;
  border-top: 1px solid #2c2a26;
}

.ops-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #2c2a26;
}

.ops-meta dt {
  color: #8a8378;
  font-size: 0.82rem;
}

.ops-meta dd {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #d8d2c7;
}

.ops-status {
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid #2c2a26;
  border-radius: 6px;
  background: #15140f;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.55;
  color: #c7c0b4;
}

.ops-status:empty {
  display: none;
}

.ops-status[data-state="checking"] {
  border-color: #b9822b;
  color: #f4c26f;
}

.ops-status[data-state="denied"] {
  border-color: #a63e32;
  background: #1f1411;
  color: #e8a59b;
}

.ops-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: #b9822b;
  color: #14130f;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ops-btn:hover {
  background: #cf9a3e;
}

.ops-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ops-btn:focus-visible {
  outline: 3px solid #f4c26f;
  outline-offset: 2px;
}

.ops-fine {
  margin: 16px 0 0;
  color: #7d766b;
  font-size: 0.8rem;
  line-height: 1.55;
}
