/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #fdfcf9;
  --bg-accent: #f5f2ed;
  --text: #1b1b1b;
  --muted: #6b6b6b;
  --muted-strong: #4f4f4f;
  --link-underline: rgba(27, 27, 27, 0.22);
  --link-hover: #1b1b1b;
  --underline-thickness: 1.5px;
  --underline-offset: 3px;
  --underline-transition: text-decoration-color 0.15s ease, color 0.15s ease;
  --nav-bg: rgba(27, 27, 27, 0.08);
  --nav-hover: rgba(27, 27, 27, 0.12);
  --cta-bg: rgba(27, 27, 27, 0.08);
  --cta-hover: rgba(27, 27, 27, 0.16);
  --border-light: rgba(27, 27, 27, 0.08);
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-accent), transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 72ch;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 2rem);
  width: 100%;
}

.site-top {
  padding: clamp(1.25rem, 3vw, 2rem) 0 0.25rem;
}

.site-main {
  flex: 1;
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 clamp(2.5rem, 6vw, 4rem);
}

/* Typography */
h1, h2, h3 {
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
}

h1 {
  font-size: clamp(2.05rem, 4.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2.25rem 0 1rem 0;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
}

p {
  margin: 0 0 1.25rem 0;
}

/* Links - subtle, consistent */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: var(--underline-transition);
}

a:hover {
  text-decoration-color: var(--link-hover);
  color: var(--text);
}

/* Top nav - intentional and tappable */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 15px;
  color: var(--muted-strong);
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: var(--muted-strong);
  text-decoration-color: transparent;
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: var(--underline-transition);
}

.site-nav-link:hover {
  text-decoration-color: var(--link-hover);
  color: var(--text);
}

.site-nav-link.is-active {
  color: var(--text);
  font-weight: 500;
  text-decoration-color: var(--link-underline);
}

/* Hero / Site header */
.site-header {
  margin-bottom: 2.75rem;
}

.site-header h1 {
  font-size: clamp(2.4rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.site-tagline {
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  line-height: 1.55;
  max-width: 54ch;
  margin: 0 0 1.25rem 0;
  color: var(--text);
}

.site-meta {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 0.4rem 0;
}

.site-meta:last-of-type {
  margin-top: 0.35rem;
}

.site-meta a {
  color: inherit;
  text-decoration-color: transparent;
}

.site-meta a:hover {
  color: var(--text);
  text-decoration-color: var(--link-hover);
}

.cta-link,
.post-title-link {
  color: inherit;
  text-decoration-color: transparent;
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: var(--underline-transition);
}

.site-meta .cta-link {
  color: inherit;
}

.cta-link:hover,
.post-title-link:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* Writing section */
.writing-section {
  margin-top: 3.5rem;
}

.writing-section h2 {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 1rem 0;
}

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

.post-list li {
  margin-bottom: 0.65rem;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.post-date {
  color: #8b8b8b;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  width: 84px;
  flex-shrink: 0;
  line-height: 1.4;
}

.post-title-link {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.post-title-link:hover {
  color: var(--text);
}

/* Mobile: stack date and title */
@media (max-width: 600px) {
  .post-item {
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.3rem;
  }

  .post-list li {
    margin-bottom: 1rem;
  }

  .post-date {
    width: auto;
    font-size: 0.8rem;
  }

  .site-nav {
    gap: 1rem;
  }
}

.more-link {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration-color: transparent;
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: var(--underline-transition);
}

.more-link:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Post page */
.post-header {
  margin-bottom: 2rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.post-content {
  margin-top: 2rem;
}

/* Prose styles for post content */
.post-content blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid #ddd;
  color: #555;
  font-style: italic;
}

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

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

.post-content code {
  font-family: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 14px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

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

/* Site footer */
.site-footer {
  padding: 1.5rem 0 2.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}
