/* Clean newsletter style theme with an orange accent (independent project, no Substack assets). */
:root {
  color-scheme: light;
  --orange: #ff6719;
  --orange-dark: #e5520a;
  --orange-soft: #fff1e8;
  --bg: #ffffff;
  --card: #ffffff;
  --card-2: #f7f7f7;
  --ink: #2b2b2b;
  --muted: #737373;
  --line: #e8e8e8;
  --line-soft: #f0f0f0;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Spectral", "Lora", Georgia, Cambria, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; flex: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 10px; }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.01em; }
h2 { font-size: 18px; }
p { margin: 0 0 14px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1100px; margin: 0 auto; height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 20px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 7px; background: var(--orange); color: #fff; display: inline-grid; place-items: center; flex: none; }
.logo svg { width: 19px; height: 19px; }
.logo.lg { width: 40px; height: 40px; border-radius: 9px; } .logo.lg svg { width: 24px; height: 24px; }
.search { flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid transparent; border-radius: 8px; padding: 0 12px; height: 38px; color: var(--muted); }
.search:focus-within { border-color: var(--line); background: var(--card); }
.search input { border: 0; background: transparent; outline: none; width: 100%; font: inherit; font-size: 15px; color: var(--ink); padding: 0; }
.top-actions { display: flex; gap: 8px; }

/* Buttons and pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--card-2); }
.btn.wide { width: 100%; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; background: var(--card-2); border: 0; cursor: pointer; }
.pill:hover { color: var(--ink); text-decoration: none; background: var(--line); }

/* Layout */
.shell { max-width: 1100px; margin: 0 auto; padding: 28px 20px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.feed { display: grid; gap: 0; min-width: 0; }
.side { display: grid; gap: 20px; position: sticky; top: 84px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; gap: 32px; }
  .side { position: static; }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 0 10px; }
}
.card { background: var(--card); }

/* Hero */
.hero { padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lede { color: var(--muted); font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

.sortbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sort-count { font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Listing rows, like a post list */
.post { border-bottom: 1px solid var(--line); }
.post-body { padding: 18px 0; min-width: 0; }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.meta .user { color: var(--ink); font-weight: 600; }
.dot-sep { opacity: .7; }
.flair { display: inline-block; background: var(--orange-soft); color: var(--orange-dark); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; margin: 0 0 10px; }
.post-title { font-family: var(--serif); font-size: 21px; font-weight: 700; margin: 2px 0 8px; }
.post-title a { color: var(--ink); }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail { border-bottom: 0; }
.detail .post-title { font-size: clamp(30px, 4vw, 40px); }
.detail .post-actions { gap: 8px; margin: 6px 0 10px; }
.summary { font-family: var(--serif); font-size: 19px; }
.empty-card { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 12px; }
.empty-card svg { width: 36px; height: 36px; color: var(--orange); }
.empty-card h3 { color: var(--ink); margin-top: 8px; font-family: var(--serif); }
.client-empty { padding: 16px 0; color: var(--muted); }

/* Evidence */
.thread { padding: 20px 0; border-top: 1px solid var(--line); }
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev { padding: 12px 0 12px 16px; border-left: 3px solid var(--line); margin-bottom: 10px; }
.ev:hover { border-left-color: var(--orange); }
.ev-kind { font-weight: 600; color: var(--ink); }
blockquote { margin: 4px 0 10px; padding: 0; font-family: var(--serif); font-size: 17px; white-space: pre-wrap; }

/* Sidebar */
.side-card { font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.side-head h2 { margin: 0; font-size: 15px; }
.side-body { padding: 14px 16px 16px; }
.about-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.about-title h2 { margin: 0; font-family: var(--serif); font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 6px 0 8px; padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stats dd { margin: 0; font-weight: 700; font-size: 18px; }
.stats dt { color: var(--muted); font-size: 12px; }
.rules { margin: 0; padding: 4px 16px 10px 34px; }
.rules li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rules li:last-child { border-bottom: 0; }
.rules summary { cursor: pointer; font-weight: 600; list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.rules details[open] summary::after { content: "\2212"; }
.rules p { color: var(--muted); margin: 6px 0 0; }
.creator-head { display: flex; gap: 10px; align-items: center; }
.creator-head h2 { font-size: 16px; font-family: var(--serif); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.kicker { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; display: flex; gap: 6px; align-items: center; }
.kicker svg { width: 15px; height: 15px; color: var(--orange); }
.socials { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.socials a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--card-2); color: var(--ink); }
.socials a:hover { text-decoration: none; background: var(--line); }
.s-label { font-weight: 600; }
.s-handle { color: var(--muted); }
.supporters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.supporters figure { margin: 0; }
.supporters img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.supporters figcaption { font-size: 11px; color: var(--muted); }

/* Footer */
.foot { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }
.foot a { color: var(--muted); text-decoration: underline; }

/* Content pages */
.page { padding: 0 0 20px; }
.page h2 { margin-top: 30px; font-size: 20px; font-family: var(--serif); }
.steps { padding-left: 22px; margin: 8px 0 12px; }
.steps li { margin: 6px 0; }
.note { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tab { font: inherit; font-weight: 600; font-size: 14px; background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--orange); }
.prompt pre { white-space: pre-wrap; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 10px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 360px; overflow: auto; }
.callout { margin-top: 26px; padding: 16px 18px; border-radius: var(--radius); background: var(--orange-soft); color: var(--ink); }
.callout ul { margin: 6px 0 0; padding-left: 20px; }
code { background: var(--card-2); padding: 1px 6px; border-radius: 4px; font-size: 14px; }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 8px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form small { color: var(--muted); font-weight: 400; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; }
.search input:focus { outline: none; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { width: auto; margin-top: 6px; }
.form .hp { position: absolute; left: -9999px; }
.drop { display: grid; place-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card-2); text-align: center; color: var(--muted); font-weight: 400; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--orange); color: var(--ink); }
.drop svg { width: 28px; height: 28px; color: var(--orange); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.error { background: #fee2e2; color: #7f1d1d; border-radius: 8px; padding: 10px 12px; }
.form-field { display: grid; gap: 6px; }
