  :root {
    --emerald: #28E291; --coral: #F78154; --periwinkle: #9381FF;
    --shadow: #262730; --shadow-mid: #2F3040;
    --text-primary: #F0EEE8; --text-secondary: #C9C7B8; --text-tertiary: #8B8970;
    --border: rgba(255, 255, 255, 0.08); --border-mid: rgba(255, 255, 255, 0.16);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { min-height: 100%; }
  body {
    position: relative;
    background: var(--shadow);
    background-image: radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1.4px);
    background-size: 26px 26px;
    font-family: 'Sora', Arial, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    padding: 28px 20px;
    overflow-x: hidden;
  }

  .crop { position: absolute; width: 18px; height: 18px; opacity: 0; animation: fade 0.6s ease 0.2s forwards; z-index: 5; pointer-events: none; }
  .crop::before, .crop::after { content: ''; position: absolute; background: var(--text-tertiary); }
  .crop::before { left: 0; right: 0; top: 50%; height: 1.5px; transform: translateY(-50%); }
  .crop::after  { top: 0; bottom: 0; left: 50%; width: 1.5px; transform: translateX(-50%); }
  .crop.bl { bottom: 20px; left: 20px; }
  .crop.br { bottom: 20px; right: 20px; }

  .site-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1000px; margin: 0 auto; padding: 14px 56px; position: relative; z-index: 4; }
  a.brand { display: inline-flex; align-items: center; text-decoration: none; transition: opacity 0.2s ease; }
  a.brand img { display: block; height: 40px; width: 40px; }
  a.brand:hover { opacity: 0.82; }
  .primary-nav { display: flex; gap: 26px; align-items: center; }
  .primary-nav a { font-family: 'Sora'; font-size: 15px; font-weight: 500; color: var(--text-secondary); text-decoration: none; position: relative; transition: color 0.2s; }
  .primary-nav a:hover { color: var(--text-primary); }
  .primary-nav a.current { color: var(--text-primary); font-weight: 600; }
  .primary-nav a.current::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--emerald); border-radius: 2px; }

  /* ── Post header ───────────────────────────────────────── */
  .post-header { max-width: 720px; margin: 0 auto; padding: 32px 56px 18px; position: relative; z-index: 2; }
  .back-link { display: inline-block; margin-bottom: 22px; font-size: 14px; color: var(--text-tertiary); text-decoration: none; transition: color 0.2s; }
  .back-link:hover { color: var(--text-primary); }
  .post-meta {
    display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-tertiary);
    border-top: 1px solid var(--border); padding-top: 14px; margin-top: 20px;
  }
  .post-tag { font-family: 'Caveat', cursive; font-size: 20px; color: var(--coral); transform: rotate(-1deg); display: inline-block; line-height: 1; }
  .post-tag .dot { color: var(--text-tertiary); margin: 0 8px; font-family: 'Sora', sans-serif; font-size: 13px; vertical-align: 2px; }
  .post-tag .num { color: var(--text-tertiary); font-family: 'Sora', sans-serif; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
  .post-title { font-size: clamp(34px, 5vw, 50px); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 14px; }
  .post-subtitle { font-size: 18px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 18px; }
  .post-hero {
    margin: 22px 0 6px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border);
    background: var(--shadow-mid);
  }
  .post-hero img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }

  /* ── Post body — scopes Beehiiv content to fit our design ── */
  .post-content {
    max-width: 720px; margin: 0 auto; padding: 24px 56px 8px;
    font-family: 'Sora', Arial, sans-serif; color: var(--text-primary);
    line-height: 1.7; font-size: 17px; position: relative; z-index: 2;
  }
  /* Beehiiv hardcodes 'DM Sans' as inline style on every paragraph & list
     item, which beats our class-level rule. Force Sora with !important
     across the elements Beehiiv touches. Embed-card text inherits Sora
     from the card's own inline style so we don't need to touch .custom_html. */
  .post-content .paragraph, .post-content p,
  .post-content li, .post-content ul, .post-content ol,
  .post-content figcaption, .post-content td, .post-content th {
    font-family: 'Sora', Arial, sans-serif !important;
  }
  .post-content .paragraph, .post-content p {
    margin: 0 0 1.1em; color: var(--text-secondary); line-height: 1.7;
  }
  .post-content .heading, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 {
    font-family: 'Sora' !important; color: var(--text-primary); line-height: 1.25; letter-spacing: -0.01em; margin: 2em 0 0.6em;
  }
  .post-content h2, .post-content h2.heading { font-size: 28px; font-weight: 700; }
  .post-content h3, .post-content h3.heading { font-size: 22px; font-weight: 700; }
  .post-content h4, .post-content h4.heading { font-size: 18px; font-weight: 600; color: var(--periwinkle); text-transform: uppercase; letter-spacing: 0.06em; }
  .post-content h6, .post-content h6.heading { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

  /* Only restyle Beehiiv's inline-text links — embed cards keep their own styles */
  .post-content .link { color: var(--coral) !important; text-decoration: none; border-bottom: 1px solid rgba(247, 129, 84, 0.35); transition: color 0.2s, border-color 0.2s; }
  .post-content .link:hover { color: var(--text-primary) !important; border-bottom-color: var(--text-primary); }
  .post-content em, .post-content i { color: var(--text-secondary); }

  /* Images */
  .post-content .image { margin: 28px 0; }
  .post-content .image__image, .post-content img { max-width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--border); }
  .post-content .image__source { display: block; margin-top: 8px; font-size: 13px; color: var(--text-tertiary); font-style: italic; }
  .post-content .image__source_text p { margin: 0; color: var(--text-tertiary); font-style: italic; }

  /* Blockquote — only style inner element so nested wrappers don't double up */
  .post-content .blockquote { margin: 28px 0; padding: 0; border: none; background: none; }
  .post-content blockquote, .post-content .blockquote__quote {
    display: block; margin: 0; padding: 6px 0 6px 22px;
    border-left: 3px solid var(--periwinkle);
    color: var(--text-primary); font-family: 'Caveat', cursive;
    font-size: 24px; line-height: 1.4; font-style: normal;
  }

  /* Dividers — handle both <hr class="content_break"> and <div class="content_break"> */
  .post-content hr.content_break { border: none; border-top: 1px solid var(--border); height: 0; margin: 36px 0; }
  .post-content div.content_break { height: 1px; background: var(--border); margin: 36px 0; }

  /* Embed cards (link previews) */
  .post-content .embed { display: block; border: 1px solid var(--border-mid); border-radius: 10px; overflow: hidden; margin: 28px 0; background: var(--shadow-mid); transition: border-color 0.2s; }
  .post-content .embed:hover { border-color: var(--emerald); }
  .post-content .embed__image { display: block; }
  .post-content .embed__image img { border-radius: 0; border: none; }
  .post-content .embed__content { padding: 14px 18px; }
  .post-content .embed__title { font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
  .post-content .embed__description { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
  .post-content .embed__url { font-size: 12px; color: var(--text-tertiary); }
  .post-content .embed__link { display: block; color: inherit !important; border: none; text-decoration: none; }

  /* Hide any Beehiiv footer leakage */
  .post-content .beehiiv__footer { display: none !important; }

  /* ── Footer ──────────────────────────────────────────────── */
  .site-footer {
    max-width: 1000px; margin: 60px auto 0; padding: 44px 56px 28px;
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
    font-size: 14px; line-height: 1.65; color: var(--text-secondary);
    position: relative; z-index: 2;
  }
  .footer-col.brand-col { display: flex; gap: 18px; align-items: flex-start; }
  .footer-logo { flex: 0 0 auto; height: 92px; width: auto; display: block; }
  .footer-col.brand-col p { flex: 1; margin: 0; line-height: 1.65; color: var(--text-secondary); }
  .footer-label { font-family: 'Caveat'; font-size: 22px; color: var(--text-tertiary); margin-bottom: 6px; transform: rotate(-1deg); display: inline-block; }
  .footer-col ul { list-style: none; }
  .footer-col li { margin-bottom: 6px; }
  .footer-col a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
  .footer-col a:hover { color: var(--text-primary); border-bottom-color: var(--text-primary); }
  .footer-meta { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; font-size: 13px; color: var(--text-tertiary); }
  .footer-meta a { color: var(--text-tertiary); border-bottom: 1px solid transparent; text-decoration: none; }
  .footer-meta a:hover { color: var(--text-primary); border-bottom-color: var(--text-primary); }

  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }

  @media (max-width: 820px) {
    body { padding: 20px 14px; }
    .post-header, .post-content { padding-left: 24px; padding-right: 24px; }
    .site-nav { padding: 10px 24px; flex-wrap: wrap; gap: 12px 18px; }
    .primary-nav { gap: 18px; }
    .primary-nav a { font-size: 14px; }
    .site-footer { grid-template-columns: 1fr; gap: 28px; padding: 36px 24px 24px; margin-top: 48px; }
    .post-content { font-size: 16px; }
  }

  .social-icons { display: flex; gap: 12px; align-items: center; margin-top: 2px; }
  .social-icons a {
    color: var(--text-tertiary) !important;
    border: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
  }
  .social-icons a:hover { color: var(--text-primary) !important; transform: translateY(-2px); }
  .social-icons svg { display: block; }

  /* hoisted from per-post Beehiiv content (it repeated this inline 20-40x/page) */
  p span[style*="font-size"] { line-height: 1.6; }
