:root {
  --text: #000000;
  --text-secondary: #333333;
  --bg: #FFFAED;
  --surface: #FFFFFF;
  --border: #E0D9C8;
  --accent: #000000;
  --max-width: 664px;
  --wide-width: 1128px;
  --font: 'Source Serif 4', 'Georgia', serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  padding: 2rem 3rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: none;
  margin-bottom: 4rem;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

header h1 {
  font-family: var(--font);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1.2;
}

header h1 a {
  color: var(--text);
  text-decoration: none;
}

header nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  padding-top: 0.45rem;
}

header nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.1em 0.25em;
  margin: -0.1em -0.25em;
}

header nav a:hover {
  text-decoration: none;
  background-color: #F2E9D2;
}

header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
}

.lang-switch {
  font-size: 0.85rem;
  opacity: 0.6;
}

.lang-switch:hover {
  opacity: 1;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-item {
  padding: 3rem 0;
  border-bottom: none;
}

.post-item:first-child {
  padding-top: 0;
}


.post-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-item a:hover .post-title {
  opacity: 0.6;
}

.post-date {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-top: 0.75rem;
}

.post-title {
  font-size: 2.4rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  margin-left: -60px;
  margin-bottom: 0.6rem;
  transition: opacity 0.2s;
  letter-spacing: -0.01em;
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.post-cover {
  width: 100%;
  height: auto;
  border-radius: 0;
  margin-bottom: 1.25rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Single post */
.post-header {
  margin-bottom: 1.5rem;
}

.post-header .post-date {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.post-header h1 {
  font-size: 3rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-left: -70px;
}

.post-content {
  font-family: var(--font);
  font-size: 1.25rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-weight: 400;
  font-style: italic;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.post-content h2 {
  font-size: 1.7rem;
}

.post-content h3 {
  font-size: 1.55rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid #F2E9D2;
  margin: 2rem 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  margin: 1rem 0 0.25rem;
}

.post-content .gallery {
  margin: 1.5rem 0;
}

.post-content .gallery img {
  margin: 0.25rem 0;
}

.post-content .gallery figcaption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.15rem;
  font-style: italic;
}

/* Image captions (Substack) */
.post-content .image-caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.15rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* Hide Substack buttons under images */
.post-content button {
  display: none;
}

/* Hide Substack subscribe widgets */
.post-content .subscription-widget {
  display: none;
}

/* Hide image expand/restack overlays */
.post-content .image-link-expand {
  display: none;
}

.post-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-secondary);
  padding: 0.05em 0.15em;
  margin: -0.05em -0.15em;
}

.post-content a:hover {
  text-decoration: none;
  background-color: #F2E9D2;
}

.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content pre {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  border-radius: 0;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content code {
  background: var(--surface);
  padding: 0.2em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

/* Footnotes */
.post-content .footnote-anchor {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  color: var(--text-secondary);
}

.post-content .footnote {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}

.post-content .footnote .footnote-number {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.post-content .footnote-content {
  display: inline;
}

.post-content .footnote-content p {
  display: inline;
  margin-bottom: 0;
}

/* Embeds */
.post-content iframe {
  max-width: 100%;
  border: none;
  margin: 1rem 0;
}

.post-content iframe.spotify-wrap,
.post-content iframe[src*="spotify"] {
  width: 100%;
  border-radius: 12px;
  min-height: 152px;
}

.post-content iframe[src*="youtube"],
.post-content iframe[src*="youtu.be"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.back-link:hover {
  color: var(--text);
  background-color: #F2E9D2;
}

/* Original link */
.original-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.original-link a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-secondary);
  text-underline-offset: 3px;
  padding: 0.05em 0.15em;
  margin: -0.05em -0.15em;
}

.original-link a:hover {
  text-decoration: none;
  background-color: #F2E9D2;
}

/* Loading / error states */
.loading {
  padding: 4rem 0;
  color: var(--text-secondary);
}

.error {
  padding: 4rem 0;
  color: #c0392b;
}

/* Footer */
footer {
  padding: 3rem 0 4rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-align: center;
}

footer a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-secondary);
  text-underline-offset: 3px;
  padding: 0.05em 0.15em;
  margin: -0.05em -0.15em;
}

footer a:hover {
  text-decoration: none;
  background-color: #F2E9D2;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 0 1.25rem;
  }

  header {
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
  }

  header nav {
    padding-top: 0;
  }

  .post-item {
    padding: 2rem 0;
  }

  .post-title {
    font-size: 1.8rem;
    margin-left: 0;
  }

  .post-header h1 {
    font-size: 2.2rem;
    margin-left: 0;
  }

  .post-content {
    font-size: 1.05rem;
  }

  .post-content img,
  .post-content .gallery img {
    width: calc(100% + 2.5rem);
    max-width: none;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
  }
}
