:root {
  --bg: #f7f5ef;
  --ink: #202124;
  --muted: #62615d;
  --line: #d8d4c8;
  --accent: #1d6f78;
  --accent-2: #8a4f2a;
  --surface: #fffdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.site-header,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.site-title {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.page-head,
.post-header {
  max-width: 760px;
  margin-bottom: 32px;
}

.eyebrow,
.post-date {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.15;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  max-width: 11ch;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.summary,
.page-head p {
  color: var(--muted);
  font-size: 1.08rem;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.post-card {
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-card h2 a {
  color: var(--ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.meta-row a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.post {
  max-width: 820px;
}

.post--feature,
.post--timeline {
  max-width: 980px;
}

.content {
  font-size: 1.04rem;
}

.post--feature .post-header {
  max-width: 900px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.post--feature h1 {
  max-width: 12ch;
}

.post--feature .content {
  font-size: 1.12rem;
}

.post--feature .content > p:first-child {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.3rem;
}

.post--feature .photo img {
  aspect-ratio: 21 / 9;
  box-shadow: 0 24px 60px rgba(32, 33, 36, 0.18);
}

.post--feature blockquote {
  margin: 36px 0;
  padding: 22px 0 22px 24px;
  border-left: 5px solid var(--accent);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.35;
}

.post--feature .gallery {
  grid-template-columns: 1.4fr 1fr;
  align-items: stretch;
}

.post--feature .gallery-photo img {
  height: 100%;
  aspect-ratio: auto;
}

.post--timeline .content {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1fr);
  gap: 10px 28px;
}

.post--timeline .content > p {
  grid-column: 1 / -1;
  max-width: 700px;
  color: var(--muted);
  font-size: 1.12rem;
}

.post--timeline .content > h2 {
  position: sticky;
  top: 12px;
  align-self: start;
  margin-top: 22px;
  padding-top: 6px;
  color: var(--accent-2);
  font-size: 1rem;
  text-transform: uppercase;
}

.post--timeline .content > ul {
  position: relative;
  margin: 22px 0 0;
  padding: 0 0 0 26px;
  border-left: 2px solid var(--line);
  list-style: none;
}

.post--timeline .content > ul li {
  position: relative;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post--timeline .content > ul li::before {
  position: absolute;
  top: 20px;
  left: -34px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.source-panel {
  margin-top: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.source-panel summary {
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.source-panel pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #202124;
  color: #f7f5ef;
  font-size: 0.9rem;
  line-height: 1.5;
}

.source-panel code {
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.photo,
.gallery-photo {
  margin: 28px 0;
}

.photo img,
.gallery-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #e6e0d1;
  object-fit: cover;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin: 28px 0;
}

.gallery .gallery-photo {
  margin: 0;
}

.term-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}

.term-list a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 13, 14, 0.86);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  width: min(960px, 100%);
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
}

.lightbox figcaption {
  color: white;
}

.notice {
  padding: 12px;
  border: 1px solid #b45f42;
  border-radius: 8px;
  color: #7a321d;
}

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

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

  main {
    padding-top: 28px;
  }

  .post--feature .gallery,
  .post--timeline .content {
    display: block;
  }

  .post--timeline .content > h2 {
    position: static;
  }
}
