@import url("tokens.css");

:root {
  --site-max: 1440px;
  --col-left: 264px;
  --col-right: 300px;
  --col-content: 760px;
  --header-h: 60px;
  --read-w: 680px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--hpr-bg-app);
  color: var(--hpr-text-primary);
  font: 400 var(--hpr-text-body)/1.55 var(--hpr-font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.serif { font-family: var(--hpr-font-display); font-weight: 400; letter-spacing: -0.3px; }
.mono { font-family: var(--hpr-font-mono); }
.accent-italic { font-style: italic; color: var(--hpr-accent); }
.eyebrow {
  font: 500 var(--hpr-text-eyebrow)/1 var(--hpr-font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hpr-accent);
}
.label {
  font: 600 var(--hpr-text-eyebrow)/1 var(--hpr-font-sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hpr-text-muted);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--hpr-radius-md);
  font: 600 var(--hpr-text-body-sm)/1 var(--hpr-font-sans); cursor: pointer; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--hpr-fast) var(--hpr-ease), box-shadow var(--hpr-fast) var(--hpr-ease), background var(--hpr-fast) var(--hpr-ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--hpr-grad-primary); border-color: var(--hpr-brand-700); box-shadow: var(--hpr-shadow-button); }
.btn-primary:hover { background: var(--hpr-grad-primary-hover); box-shadow: var(--hpr-shadow-button-hover); }
.btn-ink { color: #fff; background: var(--hpr-grad-ink); border-color: #1a1915; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(18,17,16,.25); }
.btn-secondary { color: var(--hpr-text-primary); background: var(--hpr-grad-secondary); border-color: var(--hpr-border); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(80,78,68,.08); }
.btn-ghost { background: transparent; color: var(--hpr-text-secondary); height: 30px; padding: 0 10px; }
.btn-ghost:hover { background: var(--hpr-bg-muted); color: var(--hpr-text-primary); }
.btn-lg { height: 42px; padding: 0 20px; font-size: var(--hpr-text-body-lg); border-radius: var(--hpr-radius-lg); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--hpr-radius-md);
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--hpr-text-secondary);
}
.icon-btn:hover { background: var(--hpr-bg-muted); color: var(--hpr-text-primary); }
.icon-btn.bordered { border-color: var(--hpr-border); background: var(--hpr-bg-surface); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.input {
  height: 34px; min-width: 0; flex: 1; padding: 0 12px; border-radius: var(--hpr-radius-md);
  border: 1px solid var(--hpr-border); background: var(--hpr-bg-surface); box-shadow: var(--hpr-shadow-input);
  font: 400 var(--hpr-text-body-sm)/1 var(--hpr-font-sans); color: var(--hpr-text-primary);
}
.input::placeholder { color: var(--hpr-text-faint); }
.input:focus { outline: none; border-color: var(--hpr-accent); box-shadow: var(--hpr-focus-shadow-soft); }
.subscribe { display: flex; gap: 6px; width: 100%; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--hpr-bg-app) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hpr-border-soft);
}
.site-header .inner {
  max-width: var(--site-max); margin: 0 auto; height: 100%; padding: 0 24px;
  display: grid; grid-template-columns: 1fr minmax(0, 440px) 1fr; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 26px; height: 22px; }
.brand-name { font: 400 22px/1 var(--hpr-font-display); letter-spacing: -0.4px; }
.brand-sub { font: 500 var(--hpr-text-label)/1 var(--hpr-font-sans); color: var(--hpr-text-muted); padding-left: 9px; border-left: 1px solid var(--hpr-border); }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; width: 100%;
  border-radius: var(--hpr-radius-lg); border: 1px solid var(--hpr-border); background: var(--hpr-bg-surface);
  box-shadow: var(--hpr-shadow-input); color: var(--hpr-text-muted); cursor: pointer; font-size: var(--hpr-text-body-sm);
  transition: border-color var(--hpr-fast) var(--hpr-ease);
}
.search-trigger:hover { border-color: var(--hpr-border-strong); }
.search-trigger > span:not(.kbd) { flex: 1; text-align: left; }
.kbd {
  font: 500 10.5px/1 var(--hpr-font-mono); padding: 4px 6px; border-radius: 5px; color: var(--hpr-text-secondary);
  border: 1px solid var(--hpr-border); background: var(--hpr-bg-subtle); box-shadow: inset 0 -1px 0 var(--hpr-border);
}
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.menu-toggle { display: none; }

/* ------------------------------------------------------------------ shell */
.shell {
  max-width: var(--site-max); margin: 0 auto;
  display: grid; grid-template-columns: var(--col-left) minmax(0, 1fr) var(--col-right);
  min-height: calc(100dvh - var(--header-h));
}
.shell.no-right { grid-template-columns: var(--col-left) minmax(0, 1fr); }
.shell.bare { display: block; }
.rail {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100dvh - var(--header-h)); overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column;
}
.rail::-webkit-scrollbar { display: none; }
.rail-left { border-right: 1px solid var(--hpr-border-soft); padding: 18px 16px 12px 24px; }
.rail-right { border-left: 1px solid var(--hpr-border-soft); }
.rail-block { padding: 18px 20px; border-bottom: 1px solid var(--hpr-border-soft); }
.rail-left .rail-block { padding: 16px 0; }
.rail-left .rail-block:first-child { padding-top: 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rail-foot { margin-top: auto; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--hpr-text-caption); color: var(--hpr-text-muted); }
.rail-foot a:hover { color: var(--hpr-text-primary); }
main.content { min-width: 0; padding: 0 32px 64px; }
.wrap { max-width: var(--col-content); margin: 0 auto; }

/* left nav */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; margin-left: -10px;
  border-radius: var(--hpr-radius-md); color: var(--hpr-text-secondary); font-weight: 500;
  transition: background var(--hpr-fast) var(--hpr-ease), color var(--hpr-fast) var(--hpr-ease);
}
.nav a:hover { background: var(--hpr-bg-muted); color: var(--hpr-text-primary); }
.nav a.active { background: var(--hpr-bg-surface); color: var(--hpr-text-primary); box-shadow: 0 0 0 1px var(--hpr-border-soft), 0 1px 2px rgba(80,78,68,.06); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--hpr-accent); }
.nav a.active svg { color: var(--hpr-accent); }
.nav .count { margin-left: auto; font: 500 var(--hpr-text-caption)/1 var(--hpr-font-mono); color: var(--hpr-text-faint); }

.topic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; }
.topic-list a {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin-left: -8px; border-radius: var(--hpr-radius-sm);
  font-size: var(--hpr-text-body-sm); font-weight: 500; color: var(--hpr-text-secondary);
}
.topic-list a:hover { background: var(--hpr-bg-muted); color: var(--hpr-text-primary); }
.tdot { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--dot, var(--hpr-brand-400)); }

.people { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-left: -8px; border-radius: var(--hpr-radius-md); }
.person:hover { background: var(--hpr-bg-muted); }
.person b { display: block; font-weight: 500; font-size: var(--hpr-text-body-sm); line-height: 1.2; }
.person small { color: var(--hpr-text-muted); font-size: var(--hpr-text-caption); }
.avatar {
  width: 30px; height: 30px; border-radius: 999px; flex: none; display: grid; place-items: center;
  font: 600 11px/1 var(--hpr-font-sans); color: var(--hpr-brand-800); background: var(--hpr-grad-accent-soft);
  box-shadow: inset 0 0 0 1px var(--hpr-brand-100);
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar.xl { width: 96px; height: 96px; font: 400 36px/1 var(--hpr-font-display); }
.avatar.ink { background: var(--hpr-grad-ink); color: #fff; box-shadow: none; }

/* right rail widgets */
.pub { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pub-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hpr-grad-accent-soft); box-shadow: inset 0 0 0 1px var(--hpr-brand-100); }
.pub h3 { font: 400 var(--hpr-text-title)/1.1 var(--hpr-font-display); }
.pub p { color: var(--hpr-text-muted); font-size: var(--hpr-text-body-sm); line-height: 1.35; }
.follow { display: flex; gap: 2px; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; display: flex; flex-direction: column; gap: 10px; }
.rank-list li { counter-increment: r; display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: var(--hpr-text-body-sm); font-weight: 500; line-height: 1.35; }
.rank-list li::before { content: counter(r, decimal-leading-zero); font: 500 var(--hpr-text-caption)/1.6 var(--hpr-font-mono); color: var(--hpr-text-faint); }
.rank-list a:hover { color: var(--hpr-accent); }
.product-card {
  border-radius: var(--hpr-radius-card); padding: 16px; position: relative; overflow: hidden;
  background: var(--hpr-grad-accent-soft); border: 1px solid var(--hpr-brand-100);
}
.product-card h4 { font: 400 var(--hpr-text-title)/1.15 var(--hpr-font-display); margin: 8px 0 6px; }
.product-card p { font-size: var(--hpr-text-body-sm); color: var(--hpr-text-secondary); margin-bottom: 12px; }
.engine-row { display: flex; gap: 4px; margin-bottom: 4px; }
.engine { width: 22px; height: 22px; border-radius: 6px; background: var(--hpr-bg-surface); border: 1px solid var(--hpr-brand-100); display: grid; place-items: center; font: 600 9px/1 var(--hpr-font-mono); color: var(--hpr-brand-700); }
.copyright { padding: 14px 20px; margin-top: auto; font-size: var(--hpr-text-caption); color: var(--hpr-text-muted); }

/* ------------------------------------------------------------------ hero */
.hero { padding: 44px 0 30px; text-align: center; }
.hero h1 { font: 400 var(--hpr-text-display-lg)/1.08 var(--hpr-font-display); letter-spacing: -0.6px; margin: 14px auto 12px; max-width: 620px; text-wrap: balance; }
.hero p { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-lg); max-width: 480px; margin: 0 auto 18px; text-wrap: balance; }
.hero .subscribe { max-width: 380px; margin: 0 auto; }
.hero .hero-note, .hero-note { margin-top: 10px; font-size: var(--hpr-text-caption); color: var(--hpr-text-muted); }
.hero.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; text-align: left; align-items: center; }
.hero.split h1, .hero.split p, .hero.split .subscribe { margin-left: 0; }
.hero.panel {
  margin: 20px 0 8px; padding: 44px 40px; border-radius: var(--hpr-radius-panel); color: #f0efeb;
  background: radial-gradient(120% 90% at 50% 0%, #3c309d 0%, #1c174a 55%, #121110 100%);
  box-shadow: var(--hpr-shadow-card); position: relative; overflow: hidden;
}
.hero.panel p { color: #c4c0b1; }
.hero.panel .eyebrow { color: var(--hpr-brand-300); }
.hero.panel .accent-italic { color: var(--hpr-brand-300); }
.hero.panel .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.hero.panel .input::placeholder { color: #a8a292; }
.rings { position: absolute; inset: 0; pointer-events: none; opacity: .5; }

/* ------------------------------------------------------------------ feed */
.feed-bar {
  position: sticky; top: var(--header-h); z-index: 5; background: var(--hpr-bg-app);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--hpr-border); padding-top: 6px;
}
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a {
  background: none; border: 0; cursor: pointer; padding: 12px 10px; position: relative; white-space: nowrap;
  font-weight: 500; color: var(--hpr-text-muted); font-size: var(--hpr-text-body);
}
.tabs .on { color: var(--hpr-text-primary); }
.tabs .on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--hpr-accent); }
.tabs .n { font: 500 10.5px/1 var(--hpr-font-mono); color: var(--hpr-text-faint); margin-left: 4px; }
.seg { display: inline-flex; padding: 2px; border-radius: var(--hpr-radius-md); background: var(--hpr-bg-muted); border: 1px solid var(--hpr-border-soft); }
.seg button { border: 0; background: none; width: 30px; height: 26px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--hpr-text-muted); }
.seg button.on { background: var(--hpr-bg-surface); color: var(--hpr-text-primary); box-shadow: 0 1px 2px rgba(80,78,68,.12); }

.feed { display: flex; flex-direction: column; }
.card {
  display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; padding: 18px 0;
  border-bottom: 1px solid var(--hpr-border-soft); position: relative;
}
.card .thumb { aspect-ratio: 16/10; border-radius: var(--hpr-radius-md); overflow: hidden; }
.card h3 { font: 600 15.5px/1.35 var(--hpr-font-sans); letter-spacing: -0.1px; margin-bottom: 5px; text-wrap: pretty; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card:hover h3 { color: var(--hpr-accent); }
.card p.ex { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-flag { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--hpr-accent); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 9px; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); }
.meta .sep { width: 3px; height: 3px; border-radius: 9px; background: var(--hpr-border-strong); }
.meta time, .meta .rt { font-family: var(--hpr-font-mono); font-size: var(--hpr-text-caption); }
.meta a { position: relative; z-index: 1; }
.meta a:hover { color: var(--hpr-text-primary); }
.tag-chip {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font: 600 var(--hpr-text-label)/1 var(--hpr-font-sans); color: var(--hpr-text-secondary);
  background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft);
}
.tag-chip:hover { border-color: var(--hpr-border); color: var(--hpr-text-primary); }
.tag-chip .tdot { width: 6px; height: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font: 600 10.5px/1 var(--hpr-font-sans); position: relative; z-index: 1; }
.badge.soft { background: var(--hpr-accent-soft); color: var(--hpr-brand-700); }
.badge.muted { background: var(--hpr-bg-muted); color: var(--hpr-text-secondary); }

/* compact + grid views */
.feed.compact .card { grid-template-columns: minmax(0, 1fr); padding: 12px 0; }
.feed.compact .card .thumb, .feed.compact .card p.ex { display: none; }
.feed.compact .card h3 { font-size: 14px; margin: 0; }
.feed.compact .meta { margin-top: 5px; }
.feed.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 18px; }
.feed.grid .card {
  grid-template-columns: 1fr; gap: 12px; padding: 10px 10px 16px; border: 1px solid var(--hpr-border-soft);
  border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); box-shadow: var(--hpr-shadow-card);
  transition: box-shadow var(--hpr-base) var(--hpr-ease), transform var(--hpr-base) var(--hpr-ease);
}
.feed.grid .card:hover { box-shadow: var(--hpr-shadow-card-hover); transform: translateY(-1px); }
.feed.grid .card .body { padding: 0 6px; }
.feed.grid .card .thumb { border-radius: 9px; }

.load-more { display: flex; justify-content: center; padding: 26px 0 0; }

/* cover art: generated abstract covers, no stock photography */
.cover { width: 100%; height: 100%; display: block; position: relative; background: var(--c-bg, var(--hpr-grad-accent-soft)); }
.cover svg { width: 100%; height: 100%; display: block; }

/* featured strip */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.featured-main {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; padding: 12px; border-radius: var(--hpr-radius-panel);
  background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft); box-shadow: var(--hpr-shadow-card); position: relative;
}
.featured-main .thumb { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; }
.featured-main .body { padding: 10px 10px 10px 0; display: flex; flex-direction: column; }
.featured-main h2 { font: 400 30px/1.1 var(--hpr-font-display); margin: 12px 0 10px; text-wrap: balance; }
.featured-main h2 a::after { content: ""; position: absolute; inset: 0; }
.featured-main p { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-lg); }
.featured-main .meta { margin-top: auto; padding-top: 16px; }
.featured-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.mini { position: relative; }
.mini .thumb { aspect-ratio: 16/10; border-radius: var(--hpr-radius-md); overflow: hidden; margin-bottom: 10px; }
.mini h4 { font: 600 var(--hpr-text-body)/1.35 var(--hpr-font-sans); }
.mini h4 a::after { content: ""; position: absolute; inset: 0; }
.mini:hover h4 { color: var(--hpr-accent); }

/* category showcase */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cat-box { border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); padding: 16px 18px; }
.cat-box header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-box header h3 { font: 400 var(--hpr-text-title)/1 var(--hpr-font-display); }
.cat-box header a.more { margin-left: auto; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); }
.cat-box ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.cat-box li { padding: 8px 0; border-top: 1px solid var(--hpr-border-soft); font-weight: 500; font-size: var(--hpr-text-body); }
.cat-box li a:hover { color: var(--hpr-accent); }

/* ------------------------------------------------------------------ archive headers */
.archive-head { display: flex; gap: 24px; align-items: center; padding: 36px 0 24px; border-bottom: 1px solid var(--hpr-border); }
.archive-head .txt { flex: 1; }
.archive-head h1 { font: 400 var(--hpr-text-display-lg)/1.05 var(--hpr-font-display); letter-spacing: -0.5px; margin: 10px 0 8px; }
.archive-head p { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-lg); max-width: 520px; }
.archive-head .art { width: 200px; aspect-ratio: 16/11; border-radius: var(--hpr-radius-card); overflow: hidden; flex: none; box-shadow: var(--hpr-shadow-card); }
.stat-row { display: flex; gap: 22px; margin-top: 16px; }
.stat b { display: block; font: 400 30px/1 var(--hpr-font-display); }
.stat small { font-size: var(--hpr-text-label); color: var(--hpr-text-muted); }
.socials { display: flex; gap: 2px; margin-top: 12px; margin-left: -8px; }

.center-head { text-align: center; padding: 40px 0 26px; }
.center-head h1 { font: 400 var(--hpr-text-display-lg)/1.05 var(--hpr-font-display); letter-spacing: -0.5px; margin: 10px 0 8px; }
.center-head p { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-lg); }

.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; min-height: 150px;
  border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft); box-shadow: var(--hpr-shadow-card);
  transition: box-shadow var(--hpr-base) var(--hpr-ease), transform var(--hpr-base) var(--hpr-ease);
}
.tile:hover { box-shadow: var(--hpr-shadow-card-hover); transform: translateY(-1px); }
.tile .top { display: flex; align-items: center; gap: 8px; }
.tile h3 { font: 400 var(--hpr-text-title)/1.1 var(--hpr-font-display); }
.tile .go { margin-left: auto; color: var(--hpr-text-faint); }
.tile:hover .go { color: var(--hpr-accent); }
.tile p { color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-sm); line-height: 1.45; }
.tile .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; font: 500 var(--hpr-text-caption)/1 var(--hpr-font-mono); color: var(--hpr-text-muted); }
.tile .bar { height: 3px; border-radius: 3px; background: var(--hpr-bg-muted); overflow: hidden; width: 70px; }
.tile .bar i { display: block; height: 100%; background: var(--hpr-grad-meter); }
.tile.person-tile { flex-direction: row; gap: 14px; min-height: 0; align-items: flex-start; }
.tile.person-tile .who { flex: 1; display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------------ post */
.post-head { padding: 34px 0 20px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); }
.crumbs a:hover { color: var(--hpr-text-primary); }
.post-head h1 { font: 400 var(--hpr-text-display-lg)/1.08 var(--hpr-font-display); letter-spacing: -0.6px; margin: 14px 0 12px; text-wrap: balance; }
.post-head .dek { font-size: 16px; line-height: 1.55; color: var(--hpr-text-secondary); max-width: 640px; }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hpr-border-soft); }
.byline .who b { display: block; font-size: var(--hpr-text-body-sm); font-weight: 600; }
.byline .who span { font-size: var(--hpr-text-caption); color: var(--hpr-text-muted); font-family: var(--hpr-font-mono); }
.byline .actions { margin-left: auto; display: flex; gap: 4px; }
.post-feature { margin: 4px 0 8px; border-radius: var(--hpr-radius-panel); overflow: hidden; box-shadow: var(--hpr-shadow-card); }
.post-feature-cap { text-align: center; font-size: var(--hpr-text-caption); color: var(--hpr-text-muted); margin-top: 8px; }

.summary {
  margin: 26px 0 8px; padding: 16px 18px; border-radius: var(--hpr-radius-card);
  background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft);
}
.summary .label { color: var(--hpr-accent); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.summary ul { margin: 0; padding-left: 18px; color: var(--hpr-text-secondary); font-size: var(--hpr-text-body-lg); line-height: 1.6; }

.prose { font-size: 16.5px; line-height: 1.72; color: var(--hpr-cloud-800); }
[data-theme="dark"] .prose { color: #dcd9cf; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font: 400 30px/1.15 var(--hpr-font-display); color: var(--hpr-text-primary); margin-top: 1.9em; scroll-margin-top: 90px; }
.prose h3 { font: 600 18px/1.35 var(--hpr-font-sans); color: var(--hpr-text-primary); margin-top: 1.6em; scroll-margin-top: 90px; }
.prose a { color: var(--hpr-accent); text-decoration: underline; text-decoration-color: var(--hpr-accent-border); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { text-decoration-color: var(--hpr-accent); }
.prose strong { color: var(--hpr-text-primary); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--hpr-text-faint); }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--hpr-accent);
  font: italic 400 24px/1.35 var(--hpr-font-display); color: var(--hpr-text-primary);
}
.prose code { font: 500 .86em var(--hpr-font-mono); padding: 2px 5px; border-radius: 5px; background: var(--hpr-bg-muted); border: 1px solid var(--hpr-border-soft); }
.prose pre { margin: 1.5em 0; padding: 16px 18px; border-radius: var(--hpr-radius-card); background: #1f1e1b; color: #e7e4dc; overflow-x: auto; font: 400 13px/1.65 var(--hpr-font-mono); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose hr { border: 0; height: 1px; background: var(--hpr-border); margin: 2.4em 0; }
.prose figure { margin: 1.8em 0; }
.prose figure .img { border-radius: var(--hpr-radius-card); overflow: hidden; aspect-ratio: 16/9; }
.prose figcaption { text-align: center; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); margin-top: 8px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--hpr-radius-card); background: var(--hpr-accent-soft); border: 1px solid var(--hpr-accent-border); font-size: 15px; line-height: 1.6; color: var(--hpr-text-primary); }
.callout .ic { color: var(--hpr-accent); padding-top: 3px; }
.callout.warn { background: var(--hpr-warning-soft); border-color: var(--hpr-warning-muted); }
.callout.warn .ic { color: var(--hpr-warning-strong); }
.table-wrap { overflow-x: auto; border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font: 600 var(--hpr-text-eyebrow)/1 var(--hpr-font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--hpr-text-muted); padding: 12px 14px; background: var(--hpr-bg-subtle); border-bottom: 1px solid var(--hpr-border-soft); }
.prose td { padding: 11px 14px; border-bottom: 1px solid var(--hpr-border-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose td.num { font-family: var(--hpr-font-mono); text-align: right; }
.bookmark { display: grid; grid-template-columns: 1fr 180px; border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); overflow: hidden; background: var(--hpr-bg-surface); text-decoration: none !important; color: inherit !important; }
.bookmark .b-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.bookmark b { font-size: 15px; color: var(--hpr-text-primary); }
.bookmark span { font-size: var(--hpr-text-body-sm); color: var(--hpr-text-secondary); line-height: 1.45; }
.bookmark small { margin-top: auto; font: 500 var(--hpr-text-caption) var(--hpr-font-mono); color: var(--hpr-text-muted); }
.inline-cta {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--hpr-radius-panel); color: #f0efeb;
  background: radial-gradient(120% 140% at 0% 0%, #3c309d 0%, #1c174a 60%, #121110 100%);
}
.inline-cta h4 { font: 400 24px/1.15 var(--hpr-font-display); color: #fff; }
.inline-cta p { font-size: var(--hpr-text-body); color: #c4c0b1; margin-top: 4px !important; }
.inline-cta .btn { margin-left: auto; }

.post-foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--hpr-border); display: flex; flex-direction: column; gap: 22px; }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-row .label { margin-right: 4px; }
.author-box { display: flex; gap: 16px; padding: 18px; border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft); }
.author-box h4 { font: 400 var(--hpr-text-title)/1.1 var(--hpr-font-display); margin-bottom: 4px; }
.author-box p { font-size: var(--hpr-text-body); color: var(--hpr-text-secondary); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pn { padding: 14px 16px; border-radius: var(--hpr-radius-card); border: 1px solid var(--hpr-border-soft); background: var(--hpr-bg-surface); display: flex; flex-direction: column; gap: 6px; }
.pn:hover { border-color: var(--hpr-border); }
.pn.next { text-align: right; }
.pn b { font-weight: 600; font-size: var(--hpr-text-body); line-height: 1.35; }
.comments { padding: 20px; border-radius: var(--hpr-radius-card); border: 1px dashed var(--hpr-border); text-align: center; color: var(--hpr-text-muted); }
.comments h4 { font: 400 var(--hpr-text-title)/1.1 var(--hpr-font-display); color: var(--hpr-text-primary); margin-bottom: 4px; }

.toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--hpr-border); }
.toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); line-height: 1.35; }
.toc a:hover { color: var(--hpr-text-primary); }
.toc a.on { color: var(--hpr-text-primary); border-left-color: var(--hpr-accent); font-weight: 500; }
.toc a.sub { padding-left: 24px; }
.progress { position: fixed; top: var(--header-h); left: 0; height: 2px; width: 0; background: var(--hpr-grad-meter); z-index: 60; }

.related { margin-top: 40px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* no-sidebar reading layout */
.reading { max-width: var(--read-w); margin: 0 auto; }
.reading.wide-media .post-feature { margin-left: -80px; margin-right: -80px; }

/* ------------------------------------------------------------------ auth */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 30% 10%, #3c309d 0%, #1c174a 55%, #121110 100%); color: #f0efeb; padding: 36px; display: flex; flex-direction: column; }
.auth-art blockquote { margin: auto 0 0; font: italic 400 34px/1.2 var(--hpr-font-display); max-width: 460px; }
.auth-art cite { display: block; margin-top: 14px; font: 500 var(--hpr-text-label) var(--hpr-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hpr-brand-300); font-style: normal; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px; border-radius: var(--hpr-radius-panel); background: var(--hpr-bg-surface); border: 1px solid var(--hpr-border-soft); box-shadow: var(--hpr-shadow-popover); }
.auth-card h1 { font: 400 var(--hpr-text-display)/1.1 var(--hpr-font-display); margin: 12px 0 6px; }
.auth-card > p { color: var(--hpr-text-secondary); margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font: 600 var(--hpr-text-label)/1 var(--hpr-font-sans); color: var(--hpr-text-secondary); }
.field .input { height: 40px; flex: none; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-secondary); margin: 6px 0 16px; }
.check input { accent-color: var(--hpr-accent); margin-top: 2px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); }
.auth-alt a { color: var(--hpr-accent); font-weight: 600; }

/* ------------------------------------------------------------------ 404 + empty */
.empty { text-align: center; padding: 80px 20px; }
.empty .code { font: 400 120px/1 var(--hpr-font-display); letter-spacing: -2px; color: var(--hpr-brand-200); }
.empty h1 { font: 400 var(--hpr-text-display)/1.1 var(--hpr-font-display); margin: 8px 0; }
.empty p { color: var(--hpr-text-secondary); margin-bottom: 18px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  :root { --col-right: 272px; --col-left: 232px; }
  main.content { padding: 0 24px 56px; }
}
@media (max-width: 1024px) {
  .shell, .shell.no-right { grid-template-columns: minmax(0, 1fr); }
  .rail-left {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; height: auto; width: 280px; z-index: 40;
    background: var(--hpr-bg-app); transform: translateX(-100%); transition: transform var(--hpr-slow) var(--hpr-ease);
    box-shadow: var(--hpr-shadow-popover);
  }
  body.menu-open .rail-left { transform: none; }
  body:not(.menu-open) .rail-left { box-shadow: none; visibility: hidden; }
  .rail-right { position: static; height: auto; border-left: 0; border-top: 1px solid var(--hpr-border-soft); }
  .menu-toggle { display: inline-grid; }
  .site-header .inner { grid-template-columns: auto 1fr auto; }
  .brand-sub { display: none; }
  .reading.wide-media .post-feature { margin-left: 0; margin-right: 0; }
}
@media (max-width: 720px) {
  :root { --hpr-text-display-lg: 32px; }
  main.content { padding: 0 16px 48px; }
  .site-header .inner { padding: 0 16px; gap: 10px; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; justify-self: end; }
  .header-actions .btn-primary { display: none; }
  .card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .feed.grid, .tile-grid, .tile-grid.two, .cat-grid, .related-grid, .featured-side { grid-template-columns: minmax(0, 1fr); }
  .featured-main, .hero.split { grid-template-columns: minmax(0, 1fr); }
  .featured-main .body { padding: 4px; }
  .archive-head { flex-direction: column-reverse; align-items: flex-start; }
  .archive-head .art { width: 100%; }
  .prev-next { grid-template-columns: minmax(0, 1fr); }
  .bookmark { grid-template-columns: minmax(0, 1fr); }
  .bookmark .b-art { display: none; }
  .inline-cta { flex-direction: column; align-items: flex-start; }
  .inline-cta .btn { margin-left: 0; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .hero.panel { padding: 32px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
.bookmark .b-art { min-height: 120px; }

/* dark-mode fills for the two gradients tokens.css leaves light */
[data-theme="dark"] {
  --hpr-grad-accent-soft: linear-gradient(160deg, #2b2371 0%, #1c174a 100%);
  --hpr-grad-secondary: linear-gradient(180deg, #34332c 0%, #2b2922 100%);
}
[data-theme="dark"] .btn-secondary { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.3); }
[data-theme="dark"] .product-card, [data-theme="dark"] .pub-mark, [data-theme="dark"] .avatar { border-color: var(--hpr-brand-800); box-shadow: inset 0 0 0 1px var(--hpr-brand-800); }
[data-theme="dark"] .avatar { color: var(--hpr-brand-200); }
[data-theme="dark"] .engine { background: var(--hpr-bg-surface); border-color: var(--hpr-brand-800); color: var(--hpr-brand-300); }
[data-theme="dark"] .badge.soft { color: var(--hpr-brand-200); }
[data-theme="dark"] .cover { filter: brightness(.9) saturate(.9); }

/* ================================================================== Ghost */
.thumb img, .art img, .featured-main .thumb img, .mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-feature img { display: block; width: 100%; height: auto; }
.post-feature-cap a { color: inherit; text-decoration: underline; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar:has(img) { background: none; box-shadow: none; }
.pub-mark img { width: 30px; height: 30px; object-fit: contain; }
.brand img.brand-logo { height: 26px; width: auto; }
.nav-list, .foot-list { list-style: none; margin: 0; padding: 0; }
.rail-foot .foot-list { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.toc:empty, .toc-block:has(.toc:empty) { display: none; }
[data-cover] { display: block; width: 100%; height: 100%; }
.tag-chip[style], .tdot[style] { }
.card .thumb, .mini .thumb, .featured-main .thumb { background: var(--hpr-grad-accent-soft); }
.hidden { display: none !important; }

/* members forms */
form[data-members-form] .form-msg { display: none; margin-top: 8px; font-size: var(--hpr-text-caption); }
form[data-members-form].success .form-msg.ok { display: block; color: var(--hpr-success-strong); }
form[data-members-form].error .form-msg.bad { display: block; color: var(--hpr-danger-strong); }
form[data-members-form].loading button { opacity: .6; pointer-events: none; }
.hero.panel form[data-members-form].success .form-msg.ok { color: var(--hpr-success-muted); }

/* Ghost content (Koenig cards) */
.prose > .kg-card, .prose > figure { margin-top: 1.8em; margin-bottom: 1.8em; }
.prose img { border-radius: var(--hpr-radius-card); height: auto; }
.prose .kg-image-card img { margin: 0 auto; }
.prose figcaption { text-align: center; font-size: var(--hpr-text-body-sm); color: var(--hpr-text-muted); margin-top: 8px; }
.kg-width-wide { position: relative; width: min(100% + 160px, 100vw - 48px); margin-left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.kg-width-full img { border-radius: 0; }
.shell .kg-width-wide { width: 100%; margin-left: 0; transform: none; }
.shell .kg-width-full { width: 100%; margin-left: 0; transform: none; }
.shell .kg-width-full img { border-radius: var(--hpr-radius-card); }
.prose .kg-gallery-image img { border-radius: var(--hpr-radius-md); }

.prose .kg-callout-card { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--hpr-radius-card); font-size: 15px; line-height: 1.6; background: var(--hpr-accent-soft) !important; border: 1px solid var(--hpr-accent-border); color: var(--hpr-text-primary); }
.prose .kg-callout-card-grey, .prose .kg-callout-card-white { background: var(--hpr-bg-surface) !important; border-color: var(--hpr-border-soft); }
.prose .kg-callout-card-yellow { background: var(--hpr-warning-soft) !important; border-color: var(--hpr-warning-muted); }
.prose .kg-callout-card-red { background: var(--hpr-danger-soft) !important; border-color: var(--hpr-danger-muted); }
.prose .kg-callout-card-green { background: var(--hpr-success-soft) !important; border-color: var(--hpr-success-muted); }
.prose .kg-callout-emoji { font-size: 17px; line-height: 1.5; }
.prose .kg-callout-text { font-size: inherit; }

.prose blockquote.kg-blockquote-alt { border-left: 0; padding: 0; text-align: center; font-size: 30px; color: var(--hpr-text-primary); }

.prose .kg-bookmark-card a.kg-bookmark-container { display: flex; border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); overflow: hidden; background: var(--hpr-bg-surface); color: inherit; text-decoration: none; min-height: 132px; }
.prose .kg-bookmark-content { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prose .kg-bookmark-title { font-weight: 600; font-size: 15px; color: var(--hpr-text-primary); }
.prose .kg-bookmark-description { font-size: var(--hpr-text-body-sm); color: var(--hpr-text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0 !important; }
.prose .kg-bookmark-metadata { margin-top: auto; display: flex; align-items: center; gap: 6px; font: 500 var(--hpr-text-caption) var(--hpr-font-mono); color: var(--hpr-text-muted); }
.prose .kg-bookmark-icon { width: 16px; height: 16px; border-radius: 3px; }
.prose .kg-bookmark-thumbnail { position: relative; flex: 0 0 180px; }
.prose .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.prose .kg-button-card a.kg-btn, .prose .kg-cta-button, .prose .kg-header-card-button, .prose .kg-product-card-button {
  display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--hpr-radius-lg) !important;
  color: #fff !important; text-decoration: none; font: 600 14px/1 var(--hpr-font-sans);
  background: var(--hpr-grad-primary) !important; border: 1px solid var(--hpr-brand-700); box-shadow: var(--hpr-shadow-button);
}
.prose .kg-cta-card { border-radius: var(--hpr-radius-panel); overflow: hidden; }
.prose .kg-toggle-card { border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); padding: 14px 18px; }
.prose .kg-toggle-heading-text { font: 600 16px/1.4 var(--hpr-font-sans) !important; color: var(--hpr-text-primary); }
.prose .kg-toggle-content { color: var(--hpr-text-secondary); }
.prose .kg-divider { border: 0; height: 1px; background: var(--hpr-border); }
.prose table { display: block; overflow-x: auto; border: 1px solid var(--hpr-border-soft); border-radius: var(--hpr-radius-card); background: var(--hpr-bg-surface); }
.prose .kg-embed-card { align-items: center; }
.prose .kg-embed-card iframe { border-radius: var(--hpr-radius-card); max-width: 100%; }

/* members-only content */
.gh-post-upgrade-cta { border-radius: var(--hpr-radius-panel) !important; background: radial-gradient(120% 140% at 0% 0%, #3c309d 0%, #1c174a 60%, #121110 100%) !important; }
.gh-post-upgrade-cta-content h2 { font-family: var(--hpr-font-display) !important; font-weight: 400 !important; }
.gh-post-upgrade-cta a.gh-btn { background: #fff !important; color: var(--hpr-brand-800) !important; border-radius: var(--hpr-radius-md) !important; }

@media (max-width: 720px) {
  .prose .kg-bookmark-card a.kg-bookmark-container { flex-direction: column-reverse; }
  .prose .kg-bookmark-thumbnail { flex-basis: 150px; min-height: 150px; }
}
.badge svg.i { width: 11px; height: 11px; }
.post-tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.comments-wrap { padding-top: 8px; }
.crumbs svg.i { width: 14px; height: 14px; }
.btn svg.i { width: 15px; height: 15px; }
.author-box h4 a:hover { color: var(--hpr-accent); }
.load-more .btn.loading { opacity: .6; pointer-events: none; }

/* Ghost Admin > Design > Brand fonts. Our fonts stay the default. */
:root {
  --hpr-font-display: var(--gh-font-heading, "Instrument Serif", Georgia, "Times New Roman", serif);
  --hpr-font-sans: var(--gh-font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
}
