/* Shared foundations and reading-page styles.
   Landing-page styles live beside this file in landing.css. */

:root {
  --bg:       #fff;
  --card:     #fff;
  --paper:    #fff;
  --border:   rgba(0,0,0,.14);
  --border-2: rgba(0,0,0,.26);
  --ink:      #111;
  --ink-2:    #111;
  --ink-3:    #111;
  --ink-4:    #111;
  --accent:   #111;
  --sage-deep:#111;
  --r:        14px;
  --maxw:     760px;
  --serif:    'Open Sans', Arial, sans-serif;
  --sans:     'Open Sans', Arial, sans-serif;
  --hand:     'Open Sans', Arial, sans-serif;
}

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

html { background: var(--bg); }
body { background: transparent; }
.landing-page,
.reading-page { overflow-x: hidden; }
html, body {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* fixed background layer — subtle dotted grid, shared across every page */
.bg-layer {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg);
}
.bg-layer::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--border-2) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .34;
}

a { color: inherit; }

/* ── Footer ─────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 22px 16px;
  font-size: 11.5px;
  color: var(--ink-4);
  background: var(--card);
}
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ════════════════════════════════════════════════════════════
   POST READING VIEW  (post.html)
   ════════════════════════════════════════════════════════════ */
/* ── Table of contents (left, sticky) ──────────────────────── */
.toc {
  position: fixed;
  top: 50%; left: clamp(14px, 3.5vw, 46px);
  transform: translateY(-50%);
  width: min(208px, 22vw);
  max-height: 82vh; overflow: auto;
  z-index: 40;
  padding: 18px 20px;
  background: rgba(255,254,249,.94);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.toc-title {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 12px;
}
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.toc-list a {
  display: block;
  font-size: 12px; line-height: 1.35;
  color: var(--ink-3); text-decoration: none;
  border-left: 2px solid transparent;
  padding: 3px 0 3px 11px;
  transition: color .15s, border-color .15s;
}
.toc-list a:hover, .toc-list a.active {
  color: var(--sage-deep);
  border-left-color: var(--sage-deep);
}
.toc-list .lvl-3 a { padding-left: 22px; font-size: 11px; color: var(--ink-4); }
.toc-back {
  display: inline-block;
  margin-top: 14px;
  font-size: 11.5px; font-weight: 600;
  color: var(--ink-3); text-decoration: none;
}
.toc-back:hover { color: var(--sage-deep); }

@media (max-width: 1160px) { .toc { display: none; } }

.post {
  max-width: 760px;
  margin: clamp(34px,5vw,60px) auto clamp(40px,6vw,72px);
  padding: clamp(28px,5vw,58px) clamp(24px,6vw,68px);
}
.post-header { padding: 0 0 24px; text-align: center; }
.post-emoji { font-size: 1.6rem; line-height: 1; }
.post-title {
  font-family: var(--hand);
  font-size: clamp(1.85rem,4vw,2.45rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-top: 14px;
}
.post-meta {
  font-family: var(--sans);font-size: 11px; color: var(--ink-3);
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.post-meta img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.post-header hr,
.post-divider {
  border: none; border-top: 2px solid var(--border-2);
  margin: 28px auto 0; max-width: 70px;
}

/* rendered markdown body */
.post-content { font-family: var(--serif);font-size: 15px; line-height: 1.62; color: var(--ink-2); }
.post-content > *:first-child { margin-top: 0; }
.post-content p { margin: 1.05em 0; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--hand);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.02em;
  scroll-margin-top: 22px;
}
.post-content h2 { font-size: 1.6rem; margin: 1.4em 0 .5em; }
.post-content h3 { font-size: 1.25rem; margin: 1.35em 0 .4em; }

/* each big-title section wrapped in a readable card */
.post-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 34px 0;
  text-shadow: none;
  display: flow-root;
}
.post-section + .post-section {border-top:1px solid var(--border);padding-top:34px}
.post-section > *:first-child { margin-top: 0; }
.post-section > *:last-child { margin-bottom: 0; }
.post-content h4 { font-size: 1.05rem; margin: 1.3em 0 .3em; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.post-content a:hover { text-decoration-thickness: 2px; }
.post-content strong { color: var(--ink); font-weight: 600; }
.post-content ul, .post-content ol { margin: 1em 0; padding-left: 1.5em; }
.post-content li { margin: .4em 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* story images alternate beyond the reading column, like scattered memories */
.post-content figure {
  background: transparent;
  box-shadow: none;
  clear: both;
  margin-bottom: 2.15em;
  margin-top: 2.15em;
  padding: 0;
  text-align: left;
  transform: rotate(var(--story-rotate, -1deg));
  width: max-content;
}
.post-content figure.story-image-left {
  float: left;
  margin-left: clamp(-210px, -14vw, -110px);
  margin-right: 36px;
}
.post-content figure.story-image-right {
  float: right;
  margin-left: 36px;
  margin-right: clamp(-210px, -14vw, -110px);
}
.post-content figure.story-image-1 { --story-rotate: -1.4deg; }
.post-content figure.story-image-2 { --story-rotate: 1.1deg; }
.post-content figure.story-image-3 { --story-rotate: -.6deg; }
.post-content figure.story-image-4 { --story-rotate: 1.7deg; }
.post-content img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: none;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}
.post-content figure.story-image img {
  height: 250px;
  max-width: none;
}
.post-content figcaption {
  color: var(--ink-4);
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.4;
  min-width: 100%;
  overflow-wrap: anywhere;
  padding: 9px 3px 10px;
  text-align: left;
  white-space: normal;
  width: 0;
}
.post-content .story-gallery {
  align-items: flex-start;
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 2.15em 0;
  width: 100%;
}
.post-content .story-gallery figure {
  float: none;
  margin: 0;
}
.post-content p > img { border-radius: 10px; }

/* callouts (Notion callouts became blockquotes) */
.post-content blockquote {
  background: rgba(0,0,0,.045);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 1.6em 0;
  color: var(--ink-2);
  font-size: 15px;
}
.post-content blockquote p { margin: .5em 0; }
.post-content blockquote p:first-child { margin-top: 0; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content blockquote h4 { margin-top: .6em; }

/* tables */
.post-content table { border-collapse: collapse; width: 100%; margin: 1.6em 0; font-size: 14px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.post-content th { background: rgba(0,0,0,.05); font-weight: 600; color: var(--ink); }

.post-content code {
  background: rgba(0,0,0,.08);
  border-radius: 4px; padding: .15em .4em;
  font-size: 88%; font-family: ui-monospace, Menlo, monospace;
}

.post-foot {
  border-top: 1px solid var(--border);
  margin-top: 48px; padding-top: 24px;
  text-align: center;
}
.post-foot a {
  font-family: var(--hand);
  font-size: 15px; font-weight: 500;
  color: var(--accent); text-decoration: none;
}
.post-foot a:hover { color: var(--ink); }

/* loading / error states */
.post-status { text-align: center; padding: 90px 24px; color: var(--ink-3); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 0; }
  .hero-col { flex-direction: row; flex-wrap: wrap; gap: 24px; margin-top: 28px; }
  .hero-col .side { flex: 1 1 240px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .post-content figure,
  .post-content figure.story-image-left,
  .post-content figure.story-image-right {
    float: none;
    margin-left: auto;
    margin-right: auto;
    max-width: 88%;
    width: max-content;
  }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 28px 16px 48px; }
  .hero-col { flex-direction: column; }
  .post {margin:0;padding:30px 20px 42px;border-radius:0;border-left:0;border-right:0}
  .post-title { font-size: 1.8rem; }
  .post-content { font-size: 14.5px; line-height:1.6; }
  .post-section {margin:28px 0}
  .post-section + .post-section {padding-top:28px}
  .post-content figure,
  .post-content figure.story-image-left,
  .post-content figure.story-image-right {
    margin: 1.6em auto;
    padding: 0;
    transform: none;
    max-width: 100%;
    width: max-content;
  }
  .post-content figure.story-image img {
    height: auto;
    max-height: 250px;
    max-width: 100%;
  }
  .post-content .story-gallery { gap: 20px; }
  .feat-title { font-size: 1.45rem; }
}
