:root {
  color-scheme: light;
  --ink: #1f222b;
  --muted: #5e6678;
  --muted-strong: #485062;
  --line: rgba(31, 34, 43, 0.12);
  --line-strong: rgba(31, 34, 43, 0.2);
  --paper: rgba(255, 250, 243, 0.84);
  --paper-strong: rgba(255, 255, 255, 0.92);
  --accent: #0d766e;
  --accent-strong: #0f5f59;
  --warm: #c76e33;
  --note: #2553a4;
  --link: #b45a2b;
  --log: #3c7f52;
  --bg-top: #fbf4e2;
  --bg-mid: #e7efe8;
  --bg-bottom: #d7ecfa;
  --shadow-lg: 0 24px 70px rgba(45, 54, 67, 0.12);
  --shadow-md: 0 12px 34px rgba(45, 54, 67, 0.09);
  --radius-xl: 1.75rem;
  --radius-lg: 1.15rem;
  --radius-pill: 999px;
  --code-bg: #18202b;
  --code-ink: #eef4ff;
  --selection: rgba(13, 118, 110, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(255, 232, 204, 0.5), transparent 26rem),
    linear-gradient(160deg, var(--bg-top), var(--bg-mid) 45%, var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 32px
    );
  opacity: 0.46;
}

::selection {
  background: var(--selection);
}

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

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.16em;
}

p,
ul,
ol,
figure,
blockquote,
pre {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.site-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(74rem, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 0;
}

.site-chrome__brand,
.site-chrome__nav {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(31, 34, 43, 0.08);
  box-shadow: var(--shadow-md);
}

.site-chrome__brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.site-chrome__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem;
  border-radius: var(--radius-pill);
}

.site-chrome__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--muted-strong);
  text-decoration: none;
  font: 600 0.95rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
}

.site-chrome__nav a:hover,
.site-chrome__nav a:focus-visible {
  background: rgba(13, 118, 110, 0.12);
  color: var(--ink);
}

.shell {
  width: min(74rem, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding: 1.35rem 0 4.5rem;
}

.shell--post {
  width: min(48rem, calc(100vw - 1.5rem));
}

.hero,
.hero--tag,
.post-header,
.site-hub,
.panel,
.featured-post,
.filter-panel,
.post-hero,
.link-callout {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}

.hero,
.hero--tag {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.hero::after,
.hero--tag::after,
.post-header::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 118, 110, 0.18), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font: 700 0.8rem/1.2 ui-monospace, "SFMono-Regular", "SF Mono", Menlo, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.7rem, 6vw, 4.7rem);
  line-height: 0.96;
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.02;
}

h3 {
  font-size: 1.45rem;
  line-height: 1.08;
}

.lede,
.post-header__summary,
.featured-post__summary,
.site-hub__copy p,
.entry-card__body p,
.empty-state,
.filter-panel__summary,
.related-card p,
.post-body p,
.post-body li,
.post-body blockquote,
.post-body figcaption,
.link-callout p {
  color: var(--muted);
}

.lede {
  max-width: 42rem;
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions,
.featured-post__actions,
.site-hub__links,
.filter-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-link,
.filter-chip,
.site-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid rgba(13, 118, 110, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  text-decoration: none;
  font: 700 0.95rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.hero-link:hover,
.hero-link:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.site-back-link:hover,
.site-back-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(13, 118, 110, 0.34);
  box-shadow: var(--shadow-md);
}

.hero-link-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: white;
}

.featured-post {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  margin-top: 1.2rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.featured-post__copy {
  display: grid;
  align-content: start;
  gap: 0.95rem;
}

.featured-post__meta,
.entry-card__meta,
.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  color: var(--muted);
  font: 600 0.92rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
}

.featured-post__media {
  position: relative;
  overflow: hidden;
  min-height: 18rem;
  border-radius: calc(var(--radius-xl) - 0.4rem);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 40%),
    linear-gradient(145deg, rgba(13, 118, 110, 0.18), rgba(199, 110, 51, 0.18));
  border: 1px solid rgba(31, 34, 43, 0.08);
}

.featured-post__image,
.entry-card__image,
.post-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-post__fallback {
  display: grid;
  align-content: end;
  gap: 0.65rem;
  min-height: 100%;
  padding: 1.2rem;
  color: var(--ink);
}

.featured-post__fallback span {
  color: var(--muted);
  font: 700 0.8rem/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-panel {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
}

.filter-panel__row {
  justify-content: space-between;
  align-items: end;
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-chip {
  cursor: pointer;
}

.filter-chip[data-active="true"] {
  background: rgba(13, 118, 110, 0.16);
  border-color: rgba(13, 118, 110, 0.36);
}

.filter-select {
  display: grid;
  gap: 0.45rem;
  color: var(--muted-strong);
  font: 600 0.88rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
}

.filter-select select {
  min-width: 14rem;
  min-height: 2.8rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(31, 34, 43, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.filter-panel__summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-top: 0.95rem;
  font-size: 0.96rem;
}

.muted {
  color: var(--muted);
}

.entry-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  margin-top: 1.2rem;
}

.entry-card {
  min-width: 0;
  display: grid;
  gap: 0.95rem;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-strong);
  box-shadow: var(--shadow-md);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.entry-card:hover,
.entry-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(13, 118, 110, 0.28);
  box-shadow: 0 20px 48px rgba(45, 54, 67, 0.14);
}

.entry-card__image-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.entry-card__image-wrap {
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 0.25rem);
  aspect-ratio: 16 / 10;
  background: rgba(13, 118, 110, 0.08);
}

.entry-card__body {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.entry-card__title-link {
  color: inherit;
  text-decoration: none;
}

.entry-card__title-link:hover,
.entry-card__title-link:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.entry-card__domain {
  color: var(--warm);
  font: 700 0.8rem/1.1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-card__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  justify-self: start;
  border-radius: var(--radius-pill);
  background: rgba(13, 118, 110, 0.1);
  color: var(--accent-strong);
  text-decoration: none;
  font: 700 0.95rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
}

.entry-card--post {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 253, 252, 0.92));
}

.entry-card--note {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 244, 255, 0.92));
}

.entry-card--link {
  background:
    linear-gradient(180deg, rgba(255, 249, 245, 0.96), rgba(255, 240, 228, 0.95));
  border-color: rgba(180, 90, 43, 0.18);
}

.entry-card--log {
  background:
    linear-gradient(180deg, rgba(250, 255, 249, 0.96), rgba(237, 247, 239, 0.94));
  border-color: rgba(60, 127, 82, 0.18);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: var(--radius-pill);
  font: 700 0.79rem/1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-pill--note {
  background: rgba(37, 83, 164, 0.12);
  color: var(--note);
}

.type-pill--post {
  background: rgba(13, 118, 110, 0.12);
  color: var(--accent-strong);
}

.type-pill--link {
  background: rgba(180, 90, 43, 0.12);
  color: var(--link);
}

.type-pill--log {
  background: rgba(60, 127, 82, 0.12);
  color: var(--log);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(31, 34, 43, 0.11);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted-strong);
  text-decoration: none;
  font: 600 0.86rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
}

.tag-pill:hover,
.tag-pill:focus-visible {
  border-color: rgba(13, 118, 110, 0.24);
  color: var(--ink);
}

.site-back-link {
  justify-self: start;
  margin-bottom: 0.6rem;
}

.post-header {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.95rem;
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.post-header h1 {
  max-width: 13ch;
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.post-hero {
  overflow: hidden;
  margin-top: 0.75rem;
  padding: 0;
}

.post-body,
.link-callout {
  margin-top: 0.85rem;
  padding: clamp(1.2rem, 4vw, 1.7rem);
}

.post-body {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
  font-size: 1.08rem;
  line-height: 1.8;
}

.post-body > * + * {
  margin-top: 1.2rem;
}

.post-body h2,
.post-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.25rem;
}

.post-body blockquote {
  padding-left: 1rem;
  border-left: 3px solid rgba(13, 118, 110, 0.32);
  font-style: italic;
}

.post-body code {
  padding: 0.1rem 0.28rem;
  border-radius: 0.35rem;
  background: rgba(24, 32, 43, 0.08);
  color: #5e1b36;
  font-family: "Berkeley Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
}

.post-body pre,
.code-block {
  margin: 0;
}

.code-block {
  overflow: hidden;
  border: 1px solid rgba(24, 32, 43, 0.14);
  border-radius: 1rem;
  background: var(--code-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-block__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.copy-button {
  min-height: 2rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(238, 244, 255, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(238, 244, 255, 0.08);
  color: var(--code-ink);
  font: 700 0.83rem/1 "Avenir Next", "Segoe UI", sans-serif;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: rgba(238, 244, 255, 0.14);
}

.copy-button:disabled {
  opacity: 0.68;
  cursor: default;
}

.code-block pre {
  overflow-x: auto;
  padding: 1rem;
}

.code-block code,
.hljs {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--code-ink);
  font-family: "Berkeley Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 0.93rem;
  line-height: 1.7;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
  color: #ff9cc8;
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
  color: #a9f4cb;
}

.hljs-number,
.hljs-meta,
.hljs-built_in,
.hljs-type,
.hljs-template-variable {
  color: #ffcf80;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion {
  color: rgba(238, 244, 255, 0.46);
}

.hljs-variable,
.hljs-params,
.hljs-subst {
  color: #dbe9ff;
}

.link-callout {
  display: grid;
  gap: 0.55rem;
  border-style: dashed;
}

.link-callout a {
  font-size: 1.05rem;
  font-weight: 700;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.post-nav__link,
.related-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.post-nav__link span,
.related-card span {
  color: var(--muted);
  font: 700 0.78rem/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-nav__spacer {
  min-height: 1px;
}

.panel,
.site-hub {
  margin-top: 1rem;
  padding: 1.2rem;
}

.panel__head,
.site-hub__copy {
  display: grid;
  gap: 0.55rem;
}

.related-posts__grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-top: 1rem;
}

.site-hub {
  display: grid;
  gap: 1rem;
}

.site-hub__links {
  align-items: start;
}

.empty-state {
  margin: 1rem 0 0;
  padding: 1rem 0.2rem;
  text-align: center;
}

@media (min-width: 860px) {
  .entry-card--post {
    grid-column: span 2;
  }

  .entry-card--log {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .site-chrome {
    width: min(100vw - 1rem, 74rem);
    padding-top: 0.8rem;
  }

  .shell,
  .shell--post {
    width: min(100vw - 1rem, 74rem);
  }

  .featured-post {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-chrome {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
  }

  .site-chrome__brand,
  .site-chrome__nav {
    justify-content: center;
  }

  .site-chrome__brand {
    min-height: 2.4rem;
    padding: 0 0.85rem;
    font-size: 1rem;
  }

  .site-chrome__nav {
    flex: 1;
  }

  .site-chrome__nav a {
    min-height: 2.35rem;
    padding: 0 0.82rem;
    font-size: 0.9rem;
  }

  .hero,
  .hero--tag,
  .post-header {
    padding: 1.25rem;
  }

  .featured-post {
    padding: 1rem;
  }

  .featured-post__media {
    display: none;
  }

  h1 {
    font-size: clamp(2.05rem, 11vw, 3.3rem);
    max-width: 11ch;
  }

  .post-header h1 {
    max-width: 10ch;
    font-size: clamp(1.95rem, 10.5vw, 3rem);
  }

  .lede {
    font-size: 1rem;
  }

  .hero-actions,
  .featured-post__actions,
  .site-hub__links,
  .filter-panel__row,
  .filter-chip-group {
    display: grid;
  }

  .hero-link,
  .filter-chip,
  .site-back-link {
    width: 100%;
  }

  .filter-select select {
    min-width: 0;
    width: 100%;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }
}
