:root {
  --color-page: #f3fbf8;
  --color-surface: #ffffff;
  --color-text: #1d2925;
  --color-muted: #5c6c66;
  --color-accent: #008c83;
  --color-accent-alt: #d45a83;
  --color-line: #cfe3dc;
  --color-panel: #e7f5ef;
  --font-body: Inter, Avenir, Helvetica, Arial, sans-serif;
  --font-display: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --space-page: 30px;
  --radius-control: 8px;
  --shadow-panel: 0 12px 30px rgba(0, 140, 131, 0.10);
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.site-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--color-line);
}

.site-mark {
  width: 64px;
  height: 64px;
}

.site-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.site-description,
.post-meta,
.site-footer,
.archive-count {
  color: var(--color-muted);
}

.site-description {
  margin: 8px 0 0;
  max-width: 760px;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
}

.nav-row a,
.theme-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.content-grid {
  display: grid;
  gap: 20px;
  padding: var(--space-page) 0;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 230px;
  gap: 32px;
  align-items: start;
  padding: var(--space-page) 0;
}

.feed-intro {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-line);
}

.feed-summary {
  margin: 6px 0 0;
  color: var(--color-muted);
}

.pulse-feed {
  min-width: 0;
}

.pulse-entry {
  scroll-margin-top: 24px;
  padding: 36px 0 38px;
  border-bottom: 1px solid var(--color-line);
}

.pulse-entry[hidden] {
  display: none;
}

.pulse-entry-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 18px;
  align-items: baseline;
  margin-bottom: 18px;
}

.pulse-entry-header h2 {
  flex: 1 1 420px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: 0;
}

.pulse-map {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding-left: 18px;
  border-left: 1px solid var(--color-line);
}

.pulse-map-title {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pulse-map-list {
  display: grid;
  gap: 6px;
}

.pulse-map-list a {
  display: block;
  min-height: 34px;
  padding: 6px 8px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-control);
  color: var(--color-text);
  text-decoration: none;
}

.pulse-map-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-map-list a:hover,
.pulse-map-list a:focus {
  border-left-color: var(--color-accent);
  background: var(--color-panel);
  outline: none;
}

.feed-sentinel {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 0 8px;
}

.load-more-pulses {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

[data-feed-count] {
  margin: 0;
  color: var(--color-muted);
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.post-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.post-card h2,
.post-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.post-card p {
  margin: 14px 0;
}

.post-page {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-page) 0;
}

.post-hero {
  padding: 22px 0;
  border-bottom: 1px solid var(--color-line);
}

.post-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: 0;
}

.post-body {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
  overflow-wrap: anywhere;
}

.post-body.pulse-entry-body {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 17px;
  line-height: 1.72;
}

.pulse-entry-body > p:first-child {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.pulse-entry-body ul,
.pulse-entry-body ol {
  padding-left: 24px;
}

.pulse-entry .disclaimer {
  margin-top: 22px;
  font-size: 14px;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  line-height: 1.25;
  letter-spacing: 0;
}

.post-body pre,
.post-body code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.disclaimer {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--color-accent-alt);
  background: var(--color-panel);
  border-radius: var(--radius-control);
  color: var(--color-muted);
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.site-footer {
  padding: 22px 0 32px;
  border-top: 1px solid var(--color-line);
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .pulse-map {
    position: static;
    max-height: 180px;
    overflow: auto;
    order: -1;
    padding: 0 0 16px;
    border-left: 0;
    border-bottom: 1px solid var(--color-line);
  }

  .pulse-map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-entry-header h2 {
    font-size: 26px;
  }

  .site-title {
    font-size: 28px;
  }

  .post-hero h1 {
    font-size: 30px;
  }

  .post-body {
    padding: 16px;
  }
}
