/* =========================================================
   MindStream — design system
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f3efe8;
  --surface-3: #ebe5da;
  --text: #1d1a16;
  --text-2: #57504a;
  --text-3: #6f685e;
  --border: #e8e2d8;
  --border-strong: #d5ccbe;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fbeadf;
  --accent-text: #9a3412;
  --on-accent: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --success: #157f3c;
  --success-soft: #e6f5ec;
  --like: #e0245e;
  --overlay: rgba(250, 248, 244, 0.82);
  --hero-bg: #f6dcc6;
  --hero-ink: #1d1a16;
  --hero-line: #1d1a16;
  --rank: #d5ccbe;
  --shadow-sm: 0 1px 2px rgba(29, 26, 22, 0.06);
  --shadow-md: 0 4px 16px -4px rgba(29, 26, 22, 0.12), 0 2px 4px rgba(29, 26, 22, 0.04);
  --shadow-lg: 0 18px 48px -12px rgba(29, 26, 22, 0.25);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --gutter: 16px;
  --topbar-h: 60px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #141210;
  --surface: #1b1815;
  --surface-2: #231f1b;
  --surface-3: #2e2924;
  --text: #efe9e1;
  --text-2: #b8afa3;
  --text-3: #9a9186;
  --border: #2c2722;
  --border-strong: #3d3731;
  --accent: #f0875a;
  --accent-hover: #f6a57f;
  --accent-soft: #3a2319;
  --accent-text: #f6a57f;
  --on-accent: #1d0e06;
  --danger: #f2877e;
  --danger-soft: #3b1b18;
  --success: #6fd49a;
  --success-soft: #16301f;
  --like: #ff6b93;
  --overlay: rgba(20, 18, 16, 0.8);
  --hero-bg: #211813;
  --hero-ink: #efe9e1;
  --hero-line: #3a2c22;
  --rank: #5a5047;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px -12px rgba(0, 0, 0, 0.7);
}

@media (min-width: 720px) {
  :root { --gutter: 24px; --topbar-h: 64px; }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
a:not([class]) { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:not([class]):hover { text-decoration-thickness: 2px; }

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--text); }

.icon { width: 20px; height: 20px; flex: none; }

.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 728px; }

.muted { color: var(--text-3); }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; flex: none; }

.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.section-label { font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 32px 0 8px; }
.page-head { padding-top: 40px; padding-bottom: 8px; }
.page-title { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }

@media (max-width: 719.98px) { .hide-mobile { display: none !important; } }
@media (min-width: 960px) { .only-narrow { display: none !important; } }

/* ---------- Buttons ---------- */

.btn {
  --btn-h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 500; line-height: 1; white-space: nowrap;
  background: transparent; color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 18px; height: 18px; }
.btn--sm { --btn-h: 34px; padding: 0 12px; font-size: 0.875rem; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { --btn-h: 48px; padding: 0 24px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline { border-color: var(--border-strong); background: var(--surface); }
.btn--outline:hover { border-color: var(--text-3); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
:root[data-theme='dark'] .btn--danger { color: #1d0e06; }
.btn--danger-ghost { color: var(--danger); border-color: var(--border); }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2);
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }

.toggle.is-active { color: var(--accent); }
.toggle.is-active .icon { fill: currentColor; }
.toggle--like.is-active { color: var(--like); }
.toggle.pop .icon { animation: pop 0.35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.3); } }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 0.9375rem; font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill.is-active { border-color: currentColor; background: color-mix(in srgb, currentColor 8%, var(--surface)); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--overlay);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: var(--topbar-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--accent); color: var(--on-accent);
}
.brand__mark .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.brand__mark--lg { width: 52px; height: 52px; border-radius: 14px; }
.brand__mark--lg .icon { width: 32px; height: 32px; }
.brand__name { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; }
.brand--sm .brand__mark { width: 26px; height: 26px; border-radius: 7px; }
.brand--sm .brand__mark .icon { width: 16px; height: 16px; }
.brand--sm .brand__name { font-size: 1.125rem; }

.topbar__search {
  position: relative; flex: 1; max-width: 360px;
  display: none;
}
.topbar__search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.topbar__search input {
  width: 100%; height: 40px; padding: 0 16px 0 42px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--surface-2); outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.topbar__search input:focus { border-color: var(--border-strong); background: var(--surface); }
.topbar__search input::placeholder { color: var(--text-3); }
@media (min-width: 720px) { .topbar__search { display: block; } }

.topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.theme-icon { display: grid; }
:root[data-theme='dark'] .theme-icon--moon, :root:not([data-theme='dark']) .theme-icon--sun { display: none; }

/* Account menu (native <details>) */
.menu { position: relative; }
.menu__trigger { list-style: none; cursor: pointer; border-radius: 999px; padding: 2px; display: block; }
.menu__trigger::-webkit-details-marker { display: none; }
.menu__trigger:hover .avatar { box-shadow: 0 0 0 3px var(--surface-3); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: menu-in 0.16s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.menu__head { padding: 10px 12px 12px; display: grid; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu__head span { color: var(--text-3); font-size: 0.875rem; }
.menu__panel form { margin: 0; }
.menu__panel button { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.menu__panel a, .menu__panel button { text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 0.9375rem; }
.menu__panel a:hover, .menu__panel button:hover { background: var(--surface-2); color: var(--text); }
.menu__panel .is-danger { color: var(--danger); }
.menu__panel .is-danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu__dots { list-style: none; letter-spacing: 0.1em; }
.menu__dots::-webkit-details-marker { display: none; }
.menu__panel .icon { width: 18px; height: 18px; }
.menu__panel hr { margin: 6px 0; }

/* ---------- Avatar ---------- */

.avatar {
  --h: 20;
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 45% 28%);
  font-weight: 600; font-size: 0.875rem; letter-spacing: 0.02em;
  user-select: none;
}
:root[data-theme='dark'] .avatar { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 60% 82%); }
.avatar--xs { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar--sm { width: 34px; height: 34px; font-size: 0.75rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar--xl { width: 96px; height: 96px; font-size: 2rem; font-family: var(--font-serif); }

/* ---------- Toasts & alerts ---------- */

.toasts {
  position: fixed; z-index: 60; top: calc(var(--topbar-h) + 12px); left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 2 * var(--gutter)));
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 12px 14px; border-radius: var(--radius);
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 0.9375rem; font-weight: 500;
  pointer-events: auto; animation: toast-in 0.3s var(--ease);
  transition: opacity 0.25s, transform 0.25s;
}
.toast span { flex: 1; }
.toast > .icon { width: 18px; height: 18px; }
.toast--success > .icon { color: #7ee2a4; }
.toast--error > .icon { color: #ff9b91; }
:root[data-theme='dark'] .toast--success > .icon { color: var(--success-soft); }
:root[data-theme='dark'] .toast--error > .icon { color: #b42318; }
.toast__close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: 0.6; }
.toast__close:hover { opacity: 1; }
.toast__close .icon { width: 16px; height: 16px; }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 20px;
  border-radius: var(--radius-sm); font-size: 0.9375rem;
}
.alert .icon { width: 18px; height: 18px; }
.alert--error { background: var(--danger-soft); color: var(--danger); }

.notice {
  padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-2); text-align: center; margin-bottom: 24px;
}

/* ---------- Landing (logged-out home) ---------- */

.page-landing .topbar {
  background: var(--hero-bg); border-bottom-color: var(--hero-line);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: background-color 0.3s, border-color 0.3s;
}
.page-landing .topbar.is-scrolled {
  background: var(--overlay); border-bottom-color: var(--border);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}
.page-landing .topbar:not(.is-scrolled) { color: var(--hero-ink); }
.page-landing .topbar:not(.is-scrolled) .btn--primary { background: var(--hero-ink); color: var(--hero-bg); }
.page-landing .topbar:not(.is-scrolled) .btn--ghost:hover,
.page-landing .topbar:not(.is-scrolled) .icon-btn:hover { background: color-mix(in srgb, var(--hero-ink) 8%, transparent); }
.page-landing .topbar:not(.is-scrolled) .icon-btn { color: var(--hero-ink); }
.page-landing .topbar .btn--primary { transition: background-color 0.3s, color 0.3s; }

.hero { background: var(--hero-bg); color: var(--hero-ink); border-bottom: 1px solid var(--hero-line); overflow: hidden; }
.hero__inner { display: grid; padding-top: 48px; }
.hero__copy { position: relative; z-index: 1; }
.hero__title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(3.5rem, 15vw, 7.5rem); line-height: 0.92; letter-spacing: -0.045em;
  max-width: 7.5ch;
}
.hero__title em { font-style: italic; color: var(--accent); padding-right: 0.05em; }
.hero__lede {
  margin-top: 24px; max-width: 32ch;
  font-size: clamp(1.125rem, 2.4vw, 1.5rem); line-height: 1.45;
  color: color-mix(in srgb, var(--hero-ink) 75%, var(--hero-bg));
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 36px; }
.btn--ink { background: var(--hero-ink); color: var(--hero-bg); padding: 0 32px; }
.btn--ink:hover { background: color-mix(in srgb, var(--hero-ink) 85%, var(--hero-bg)); }
.btn--link { color: inherit; padding: 0 12px; }
.btn--link:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn--link .icon { transition: transform 0.2s var(--ease); }
.btn--link:hover .icon { transform: translateX(3px); }

.hero__art { height: 220px; margin: 32px calc(-1 * var(--gutter)) 0; color: var(--hero-ink); }
.hero__art svg { width: 100%; height: 100%; }
.hero__sun { fill: var(--accent); }
.wave { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; animation: wave-flow var(--dur) linear infinite; }
.wave--accent { stroke: var(--accent); stroke-width: 3; }
.waves--knockout .wave { stroke: var(--hero-bg); stroke-width: 2.2; opacity: 1; }
@keyframes wave-flow { to { transform: translateX(var(--wl)); } }

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; min-height: 540px; padding-top: 0; }
  .hero__copy { padding: 72px 0; }
  /* Bleed to the right edge of the window, fade in on the left. */
  .hero__art {
    height: auto; align-self: stretch;
    margin: 0 calc(-1 * (max(0px, (100vw - 1140px) / 2) + var(--gutter))) 0 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 22%);
    mask-image: linear-gradient(to right, transparent, #000 22%);
  }
}
@media (max-width: 479.98px) { .hero__actions .btn--ink { flex: 1; } }

/* Trending grid */
.trending { border-bottom: 1px solid var(--border); padding: 40px 0 8px; }
.trending__head { display: flex; align-items: center; gap: 12px; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin-bottom: 24px; }
.trending__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--text); }
.trending__icon .icon { width: 16px; height: 16px; }
.trending__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 48px; }
@media (min-width: 640px) { .trending__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .trending__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trend { display: flex; gap: 16px; padding-bottom: 32px; }
.trend__num { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--rank); min-width: 2ch; margin-top: -2px; }
.trend__body { display: grid; gap: 8px; min-width: 0; align-content: start; }
.trend__title {
  font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.trend__title:hover { color: var(--accent-text); }
.trend__meta { font-size: 0.8125rem; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.trend__likes { display: inline-flex; align-items: center; gap: 3px; }
.trend__likes .icon { width: 13px; height: 13px; }

/* Closing call to action */
.cta-band { background: var(--text); color: var(--bg); }
.cta-band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding-top: 56px; padding-bottom: 56px; }
.cta-band h2 { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; letter-spacing: -0.03em; }
.cta-band p { margin-top: 8px; max-width: 46ch; opacity: 0.75; font-size: 1.0625rem; }
.cta-band .btn--primary { background: var(--accent); }
@media (max-width: 479.98px) { .cta-band .btn { width: 100%; } }

/* ---------- Feed layout ---------- */

.layout { display: grid; gap: 40px; padding-top: 24px; padding-bottom: 56px; }
.layout__main { min-width: 0; }
.layout__side { display: none; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; padding-top: 40px; }
  .layout__side { display: grid; align-content: start; gap: 36px; position: sticky; top: var(--side-top, calc(var(--topbar-h) + 40px)); }
}

.feed-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin-bottom: 4px; }
.feed-head > h1, .feed-head > p { flex-basis: 100%; }
.feed-head__title { font-family: var(--font-serif); font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); width: 100%; margin-top: 8px; }
.tabs__item {
  position: relative; padding: 10px 0 12px; color: var(--text-3); font-weight: 500; font-size: 0.9375rem;
}
.tabs__item:hover { color: var(--text); }
.tabs__item.is-active { color: var(--text); }
.tabs__item.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px; }

.chip-row {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter) 2px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); }

.searchbox { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.searchbox > .icon { position: absolute; left: 16px; color: var(--text-3); pointer-events: none; }
.searchbox input {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px 0 48px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  font-size: 1.0625rem; outline: none;
}
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbox .btn { position: absolute; right: 8px; }

/* Post list */
.post-list { display: grid; }
.post-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.post-item.has-cover { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.post-item__main { min-width: 0; }
.post-item__thumb { display: block; width: 88px; height: 88px; margin-top: 34px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 720px) { .post-item.has-cover { gap: 40px; } .post-item__thumb { width: 160px; height: 107px; } }
.post-item:last-child { border-bottom: 0; }
.post-item__meta { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-3); margin-bottom: 10px; }
.byline-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; min-width: 0; }
.byline-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.byline-chip:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.post-item__link { display: block; }
.post-item__title {
  font-family: var(--font-serif); font-size: 1.375rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em;
  transition: color 0.15s;
}
.post-item__link:hover .post-item__title { color: var(--accent-text); }
.post-item__excerpt {
  margin-top: 6px; color: var(--text-2); font-size: 0.9688rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-item__footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; font-size: 0.8125rem; }
.post-item__footer .icon-btn { margin: -8px -8px -8px 0; }
@media (min-width: 720px) { .post-item__title { font-size: 1.5rem; } .post-item { padding: 28px 0; } }

.stat { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.stat .icon { width: 16px; height: 16px; }
a.stat:hover { color: var(--text); }
.stat.is-liked { color: var(--like); }
.stat.is-liked .icon { fill: currentColor; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.tag:hover { background: var(--surface-3); color: var(--text); }
.tag.is-active { background: var(--text); color: var(--bg); }
.tag--lg { padding: 8px 14px; font-size: 0.9375rem; }
.tag--lg span { color: var(--text-3); font-size: 0.8125rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.card h3 { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 20px; }
.card--accent { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--accent) 20%, var(--border)); }
.side-section { display: grid; gap: 16px; }
.side-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; }
.side-title .icon { width: 18px; height: 18px; }
.side-link { font-size: 0.875rem; color: var(--accent-text); justify-self: start; }
.side-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag--md { padding: 7px 14px; font-size: 0.875rem; }
.byline-chip--sm { font-size: 0.8125rem; gap: 6px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.mini-list li { display: flex; gap: 12px; }
.mini-list__num { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; line-height: 1; color: var(--rank); min-width: 1.6em; }
.mini-list li > div { display: grid; gap: 4px; min-width: 0; }
.mini-list__title { font-family: var(--font-serif); font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-list__title:hover { color: var(--accent-text); }

.writer-list { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 2px; }
.writer { display: flex; align-items: center; gap: 8px; }
.writer__link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius); transition: background-color 0.15s; }
.writer__link:hover { background: var(--surface-2); }
.writer__text { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.writer__text strong { font-size: 0.9375rem; font-weight: 600; }
.writer__text span { font-size: 0.8125rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-footer { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--text-3); }
.side-footer:first-child { border-top: 0; padding-top: 0; }
.side-footer a { color: inherit; text-decoration: none; }
.side-footer a:hover { color: var(--text); }

.empty { text-align: center; padding: 64px 16px; display: grid; justify-items: center; gap: 10px; }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); margin-bottom: 8px; }
.empty__icon .icon { width: 28px; height: 28px; }
.empty h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.empty p { color: var(--text-2); max-width: 36ch; margin-bottom: 12px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 32px 0 8px; font-size: 0.875rem; }

/* ---------- Article ---------- */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 45; pointer-events: none; }
.progress__bar { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.article { padding-top: 32px; }
@media (min-width: 720px) { .article { padding-top: 56px; } }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.article__title {
  font-family: var(--font-serif); font-weight: 650;
  font-size: clamp(2rem, 6.5vw, 3.25rem); line-height: 1.1; letter-spacing: -0.025em;
}

.byline { display: flex; align-items: center; gap: 12px; margin: 24px 0 8px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.byline__text { display: grid; min-width: 0; font-size: 0.875rem; line-height: 1.4; }
.byline__name { font-weight: 600; font-size: 0.9375rem; color: var(--text); }
a.byline__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.byline__actions { display: flex; gap: 8px; margin-left: auto; }
.byline__top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.byline__top form { display: inline; }
@media (max-width: 719.98px) { .byline__actions .btn { width: 34px; padding: 0; } }

/* Long-form reading typography */
.prose {
  font-family: var(--font-serif); font-size: 1.1875rem; line-height: 1.75; color: var(--text);
  overflow-wrap: break-word; padding: 24px 0 8px;
  font-optical-sizing: auto;
}
@media (min-width: 720px) { .prose { font-size: 1.3125rem; } }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-weight: 650; letter-spacing: -0.015em; margin-top: 1.8em; line-height: 1.25; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1.1em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.5em; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote { margin-inline: 0; padding: 2px 0 2px 1.1em; border-left: 3px solid var(--accent); color: var(--text-2); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--text-3); }
.prose code { font-family: var(--font-mono); font-size: 0.82em; background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 5px; }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: 0.78em; }
.prose hr { width: 120px; margin: 2.4em auto; border-top: 0; text-align: center; overflow: visible; height: auto; }
.prose hr::before { content: '···'; letter-spacing: 1em; color: var(--text-3); font-size: 1.2em; }

.actionbar { display: flex; align-items: center; gap: 8px; padding: 16px 0; margin-top: 32px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.actionbar .pill .icon { width: 18px; height: 18px; }
.toggle--like.pill.is-active { color: var(--like); }

.author-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 32px 0 8px; padding: 20px; background: var(--surface-2); border-radius: var(--radius-lg); }
.author-card__text { flex: 1; min-width: 180px; }
.author-card .eyebrow { color: var(--text-3); margin-bottom: 2px; }
.author-card__name { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }
.author-card__name:hover { color: var(--accent-text); }
.author-card__bio { color: var(--text-2); font-size: 0.9375rem; margin-top: 4px; }

/* Comments */
.comments { padding-top: 40px; padding-bottom: 48px; }
.comments__title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; margin-bottom: 20px; }
.comments__title .muted { font-weight: 400; }
.comment-form { display: flex; gap: 12px; margin-bottom: 32px; }
.comment-form__box {
  flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
}
.comment-form__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.comment-form textarea { display: block; width: 100%; border: 0; background: transparent; padding: 12px 14px 4px; resize: none; outline: none; min-height: 48px; line-height: 1.5; }
.comment-form__actions { display: flex; justify-content: flex-end; padding: 8px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; }
.comment { display: flex; gap: 12px; padding: 18px 0; border-top: 1px solid var(--border); }
.comment:target { background: linear-gradient(90deg, var(--accent-soft), transparent); border-radius: var(--radius-sm); }
.comment__main { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 0.875rem; min-height: 34px; }
.comment__name { font-weight: 600; }
a.comment__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.comment__delete { margin-left: auto; }
.comment__body { color: var(--text-2); white-space: pre-line; overflow-wrap: break-word; margin-top: 2px; }
.comments__empty { padding: 16px 0; }
.badge { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }

.more { background: var(--surface-2); padding: 8px 0 32px; border-top: 1px solid var(--border); }
.more .post-item { border-color: var(--border-strong); }

/* ---------- Editor ---------- */

.page-editor .site-footer { display: none; }
.editor { padding-bottom: 48px; }
.editor__bar {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 0; margin-bottom: 16px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.editor__status { font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--text-3); }
.editor__status.is-error { color: var(--danger); white-space: normal; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.segmented__item { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; color: var(--text-3); }
.segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.editor__title {
  display: block; width: 100%; border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  font-family: var(--font-serif); font-size: clamp(2rem, 6.5vw, 3rem); font-weight: 650; line-height: 1.15; letter-spacing: -0.02em;
  padding: 8px 0;
}
.editor__subtitle {
  display: block; width: 100%; border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  font-family: var(--font-serif); font-size: clamp(1.25rem, 3.5vw, 1.5rem); line-height: 1.35; color: var(--text-2); padding: 0 0 8px;
}
.editor__title::placeholder, .editor__subtitle::placeholder, .editor__body::placeholder { color: var(--text-3); opacity: 0.7; }
.editor__tags { display: flex; align-items: center; gap: 10px; padding: 8px 0 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.editor__tags .icon { width: 18px; height: 18px; }
.editor__tags input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 0.9375rem; padding: 6px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 0; margin-left: -6px; }
.editor__body {
  display: block; width: 100%; min-height: 50vh; border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  font-family: var(--font-serif); font-size: 1.1875rem; line-height: 1.75; padding: 8px 0;
}
@media (min-width: 720px) { .editor__body { font-size: 1.3125rem; } }
.editor__preview { min-height: 50vh; }
.editor__preview:empty::before { content: 'Nothing to preview yet.'; color: var(--text-3); font-style: italic; }
.is-invalid::placeholder { color: var(--danger) !important; }
.editor__foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.md-help summary { cursor: pointer; color: var(--text-2); }
.md-help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 12px 0 0; }
.md-help dt { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text); }
.md-help dd { margin: 0; }

/* ---------- Auth ---------- */

.page-auth { padding-bottom: 0 !important; }
.auth { display: grid; min-height: 100vh; min-height: 100dvh; }
.auth__aside { display: none; }
.auth__panel { display: flex; flex-direction: column; padding: 16px var(--gutter) 48px; }
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.auth__back { display: none; margin-left: -12px; }
.auth__form { width: 100%; max-width: 400px; margin: auto; padding-top: 32px; }
.auth__form h1 { font-family: var(--font-serif); font-size: 2.25rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth__form > .muted { margin-bottom: 28px; }
.auth__switch { text-align: center; margin-top: 20px; color: var(--text-2); font-size: 0.9375rem; }
.page-auth .toasts { top: 16px; bottom: auto; }

@media (min-width: 960px) {
  .auth { grid-template-columns: 1fr 1fr; }
  .auth__brand { display: none; }
  .auth__back { display: inline-flex; }
  .auth__panel { padding: 24px 32px 48px; }
  .auth__form { padding-top: 0; }
  .page-auth .toasts { left: 75%; top: 72px; }
  .auth__aside {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; justify-content: space-between; padding: 40px 56px 56px;
    background:
      radial-gradient(40rem 30rem at 0% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
      #1d1a16;
    color: #efe9e1;
  }
  .auth__quote { margin: 0; max-width: 460px; }
  .auth__quote blockquote { margin: 0 0 16px; font-family: var(--font-serif); font-size: clamp(1.75rem, 2.4vw, 2.25rem); line-height: 1.3; font-style: italic; letter-spacing: -0.01em; }
  .auth__quote figcaption { opacity: 0.7; }
}

/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.field-row { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 1rem; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.has-error .input { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.field__error { color: var(--danger); font-size: 0.8125rem; }
.field__hint { color: var(--text-3); font-size: 0.8125rem; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-prefix .input { padding-left: 32px; }

/* ---------- Profile & settings ---------- */

.profile { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--bg)); }
.profile__inner { display: grid; grid-template-columns: auto 1fr; gap: 16px 24px; align-items: start; padding-top: 40px; padding-bottom: 32px; }
.profile__name { font-family: var(--font-serif); font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; }
.profile__handle { margin-top: 2px; }
.profile__bio { margin-top: 12px; color: var(--text-2); max-width: 52ch; }
.profile__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; list-style: none; padding: 0; margin: 16px 0 0; font-size: 0.9375rem; color: var(--text-2); }
.profile__stats strong { color: var(--text); }
.profile__stats li { display: inline-flex; align-items: center; gap: 6px; }
.profile__stats .icon { width: 16px; height: 16px; }
.profile__actions { grid-column: 1 / -1; }
@media (max-width: 559.98px) {
  .profile__inner { grid-template-columns: 1fr; }
  .profile .avatar--xl { width: 76px; height: 76px; font-size: 1.625rem; }
}
@media (min-width: 560px) { .profile__actions { grid-column: auto; grid-row: 1; grid-column-start: 3; } .profile__inner { grid-template-columns: auto 1fr auto; } }

.settings { display: grid; gap: 20px; padding-top: 16px; padding-bottom: 56px; }
.settings__card h2 { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 600; margin-bottom: 20px; }
.settings__card--row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.settings__line { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--border); }
.settings__line:first-of-type { border-top: 0; padding-top: 0; }
.settings__line p { margin: 2px 0 0; font-size: 0.875rem; max-width: 46ch; }
.settings__card--danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.settings__card--danger h2 { color: var(--danger); }
.settings__card--danger > .muted { margin: -8px 0 20px; }
.settings__card--row h2 { margin-bottom: 4px; }
.settings__card--row p { margin: 0; }
.settings__preview { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.settings__preview p { margin: 0; font-size: 0.875rem; }
.settings__actions { display: flex; justify-content: flex-end; }
@media (max-width: 479.98px) { .settings__actions .btn { width: 100%; } .card { padding: 20px 16px; } }

/* ---------- Error ---------- */

.error-page { display: grid; place-items: center; text-align: center; padding: 64px 0; }
.error-page__code { font-family: var(--font-serif); font-size: clamp(5rem, 22vw, 9rem); font-weight: 500; line-height: 1; letter-spacing: -0.04em; color: var(--accent); margin-bottom: 8px; }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }

/* ---------- Footer & mobile tab bar ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-3); font-size: 0.875rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.tabbar { display: none; }
@media (max-width: 719.98px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--overlay);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-3); font-size: 0.6875rem; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item .icon { width: 22px; height: 22px; }
  .tabbar__item.is-active { color: var(--text); }
  .tabbar__item.is-active .icon { stroke-width: 2.4; }
  .tabbar__fab {
    display: grid; place-items: center; width: 48px; height: 40px; border-radius: 14px;
    background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-md);
  }
  .tabbar__item--primary:active .tabbar__fab { transform: scale(0.94); }
  .page-editor .tabbar { display: none; }
  .page-editor { padding-bottom: env(safe-area-inset-bottom); }
  .toasts { top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .page-editor .toasts { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .wave { animation: none !important; }
}

/* ---------- Fresh start (no stories yet) ---------- */

.fresh { padding: 56px 0 72px; }
.fresh__inner { display: grid; justify-items: center; text-align: center; }
.fresh__mark {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px;
  border-radius: 18px; background: var(--accent-soft); color: var(--accent);
}
.fresh__mark .icon { width: 34px; height: 34px; stroke-width: 2.2; }
.fresh__title {
  margin-top: 10px; max-width: 16ch;
  font-family: var(--font-serif); font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05;
}
.fresh__lede { margin-top: 16px; max-width: 44ch; color: var(--text-2); font-size: 1.125rem; }
.fresh__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.steps {
  list-style: none; margin: 56px 0 0; padding: 0; width: 100%; max-width: 920px;
  display: grid; gap: 16px; text-align: left;
}
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.step__badge {
  display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 16px;
  border-radius: 50%; background: var(--surface-2); color: var(--text-2);
  font-family: var(--font-serif); font-weight: 700;
}
.step__badge .icon { width: 16px; height: 16px; stroke-width: 3; }
.step.is-done .step__badge { background: var(--success-soft); color: var(--success); }
.step h3 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }
.step p { margin-top: 6px; color: var(--text-2); font-size: 0.9375rem; }
@media (max-width: 479.98px) { .fresh__actions .btn { flex: 1; } }
:root[data-theme='dark'] .auth__aside { border-right: 1px solid var(--border); }

/* Show / hide password */
.password { position: relative; }
.password .input { padding-right: 48px; }
.password__toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3);
}
.password__toggle:hover { color: var(--text); }
.password__toggle .icon { width: 18px; height: 18px; }
.password__toggle .pw-hide, .password__toggle[aria-pressed='true'] .pw-show { display: none; }
.password__toggle[aria-pressed='true'] .pw-hide { display: grid; }

/* ---------- Notifications bell ---------- */

.bell { position: relative; }
.bell.is-active { color: var(--text); background: var(--surface-2); }
.bell__badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; border: 2px solid var(--bg); background: var(--accent); color: var(--on-accent);
  font-size: 0.625rem; font-weight: 700; line-height: 14px; text-align: center;
}

/* ---------- Follow buttons ---------- */

.follow-btn { background: var(--text); color: var(--bg); }
.follow-btn:hover { background: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.follow-btn__on { display: none; }
.follow-btn.is-active { background: transparent; color: var(--text); border-color: var(--border-strong); }
.follow-btn.is-active:hover { border-color: var(--text-3); }
.follow-btn.is-active .follow-btn__on { display: inline; }
.follow-btn.is-active .follow-btn__off { display: none; }
.btn--md { --btn-h: 40px; padding: 0 20px; }
/* In a byline, "Follow" is a plain text link, like Medium. */
.follow-btn.btn--link { --btn-h: auto; padding: 0; background: none; border: 0; color: var(--accent-text); font-weight: 600; font-size: 0.9375rem; }
.follow-btn.btn--link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.follow-btn.btn--link.is-active { color: var(--text-3); }

/* ---------- Article extras ---------- */

.article__subtitle { margin-top: 12px; font-family: var(--font-serif); font-size: clamp(1.25rem, 3.4vw, 1.5rem); line-height: 1.4; color: var(--text-2); }

.draft-banner { background: var(--accent-soft); border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); }
.draft-banner__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; font-size: 0.9375rem; color: var(--accent-text); }
.draft-banner__inner span { display: inline-flex; align-items: center; gap: 8px; }
.draft-banner .icon { width: 18px; height: 18px; }

.prose figure { margin: 2em 0; }
.prose figure img, .prose p img { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--radius-sm); }
.prose p img { display: inline-block; vertical-align: middle; }
.prose figcaption { margin-top: 10px; text-align: center; font-family: var(--font-sans); font-size: 0.875rem; color: var(--text-3); }

.more--recs { background: var(--bg); }

/* ---------- People ---------- */

.people-list { list-style: none; margin: 0; padding: 0; display: grid; }
.person { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: 0; }
.person__link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.person__text { display: grid; gap: 2px; min-width: 0; line-height: 1.35; }
.person__text strong { font-size: 1rem; }
.person__text .muted { font-size: 0.8125rem; }
.person__bio { color: var(--text-2); font-size: 0.875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person__link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.people-list--compact { width: 100%; max-width: 440px; margin-top: 16px; text-align: left; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 0.875rem; margin-bottom: 12px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--text); }
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .tabs { margin-top: 16px; }
.tabs__count { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-3); font-size: 0.75rem; font-weight: 600; }
.page-head .searchbox { margin-bottom: 28px; }
.search-results { padding-bottom: 48px; }

.profile__stats a { color: inherit; text-decoration: none; }
.profile__stats a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.profile__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Your stories ---------- */

.story-rows { list-style: none; margin: 0; padding: 0 0 48px; }
.story-row { display: flex; align-items: flex-start; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.story-row__main { flex: 1; min-width: 0; }
.story-row__title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 650; line-height: 1.3; }
.story-row__main:hover .story-row__title { color: var(--accent-text); }
.story-row__excerpt { margin-top: 4px; color: var(--text-2); font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-row__meta { margin-top: 8px; font-size: 0.8125rem; }
.story-row__actions { display: flex; gap: 6px; flex: none; }

/* ---------- Stats ---------- */

.stat-tiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tiles li { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 4px; }
.stat-tiles__label { font-size: 0.8125rem; color: var(--text-3); }
.stat-tiles strong { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }

.stats-table { margin-bottom: 56px; }
.stats-table__row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 88px); gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.stats-table__row > span:not(:first-child) { text-align: right; }
.stats-table__head { font-size: 0.8125rem; color: var(--text-3); font-weight: 600; padding-top: 0; }
.stats-table__story { display: grid; gap: 2px; min-width: 0; }
.stats-table__story a { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-table__story a:hover { color: var(--accent-text); }
.stats-table__story .muted { font-size: 0.8125rem; }
@media (max-width: 559.98px) {
  .stats-table__head { display: none; }
  .stats-table__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-table__story { grid-column: 1 / -1; }
  .stats-table__row > span:not(:first-child) { text-align: left; font-weight: 600; }
  .stats-table__row > span[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-3); }
}

/* ---------- Notifications ---------- */

.notes { list-style: none; margin: 0 0 56px; padding: 0; }
.note { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 16px 12px; margin: 0 -12px; border-radius: var(--radius); }
.note + .note { border-top: 1px solid var(--border); border-radius: 0; }
.note.is-unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.note__body { display: grid; gap: 4px; flex: 1; min-width: 0; line-height: 1.45; }
.note__text em { font-family: var(--font-serif); font-style: normal; font-weight: 650; }
.note__body:hover .note__text em { color: var(--accent-text); }
.note__quote { color: var(--text-2); font-size: 0.9375rem; padding-left: 10px; border-left: 2px solid var(--border-strong); }
.note__body time { font-size: 0.8125rem; }
.note__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); flex: none; }
.note__icon .icon { width: 15px; height: 15px; }
.note__icon--like { color: var(--like); }
.note__icon--like .icon { fill: currentColor; }
.note__icon--follow, .note__icon--publish { color: var(--accent); }
.prose > figure:first-child { margin-top: 0; }
