/* ==========================================================================
   XO Minimal Dark — v2
   0. Tokens
   1. Base
   2. Ambient background
   3. Header & mobile drawer
   4. Buttons & chips
   5. Profile header & topic bar
   6. Feed cards
   7. Media carousel
   8. Pagination & infinite loader
   9. Article (post / page)
   10. Content typography & Koenig cards
   11. Footer
   12. Lightbox, dialog, toast
   13. Error page
   14. View transitions & motion
   ========================================================================== */

/* 0. Tokens
   ========================================================================== */
:root {
  --bg: #060607;
  --bg-raised: #0c0c0e;
  --bg-card: rgba(14, 14, 17, 0.72);
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-press: rgba(255, 255, 255, 0.07);

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text: #f4f4f5;
  --text-body: #d8d8dc;
  --text-2: #a1a1aa;
  --text-3: #6b6b74;

  --white: #fafafa;

  --font-sans: var(--gh-font-body, 'Geist'), ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: var(--gh-font-heading, 'Instrument Serif'), 'Iowan Old Style', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-name: 'Google Sans', 'Geist', ui-sans-serif, system-ui, sans-serif;

  --feed-width: 600px;
  --article-width: 680px;
  --wide-width: 920px;
  --header-h: 60px;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-fast: 0.18s var(--ease);
  --t: 0.32s var(--ease);
}

/* 1. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }

::selection { background: rgba(255, 255, 255, 0.9); color: #000; }

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: #000;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.875rem;
  transform: translateY(-160%);
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: none; }

.site-main { flex: 1; }

/* Reading time is intentionally hidden throughout */
.feed-reading-time, .post-reading-time, .post-card-reading-time { display: none !important; }

/* 2. Ambient background
   ========================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-aurora {
  position: absolute;
  inset: -20% -10% auto;
  height: 70vh;
  background:
    radial-gradient(50% 60% at 50% 0%, rgba(255, 255, 255, 0.075), transparent 70%),
    radial-gradient(30% 40% at 30% 10%, rgba(200, 205, 230, 0.04), transparent 70%),
    radial-gradient(30% 40% at 72% 6%, rgba(230, 220, 210, 0.035), transparent 70%);
  filter: blur(20px);
}

.ambient-orb {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 65%);
  will-change: transform;
}
.ambient-orb--a { top: 20%; left: -18vmax; animation: drift-a 40s ease-in-out infinite alternate; }
.ambient-orb--b { bottom: -20vmax; right: -16vmax; animation: drift-b 48s ease-in-out infinite alternate; }

@keyframes drift-a { to { transform: translate3d(14vmax, -8vmax, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-12vmax, -10vmax, 0) scale(0.9); } }

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Reading progress (post & page only) */
.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.reading-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), var(--white));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}
@supports (animation-timeline: scroll()) {
  .reading-progress span {
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* 3. Header & mobile drawer
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  view-transition-name: site-header;
  transition: transform var(--t), background-color var(--t), border-color var(--t);
  border-bottom: 1px solid transparent;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(6, 6, 7, 0.6);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  opacity: 0;
  transition: opacity var(--t);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-100%); }
.menu-open .site-header::before { opacity: 1; }

.header-inner {
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-spacer { justify-self: start; }

/* Ghost's search & portal render in iframes with a light color-scheme. It must be an explicit
   `light` (not `normal`, which inherits the page's dark meta) or the browser paints an opaque
   backdrop behind the iframe that hides the whole page. */
#sodo-search-root, #ghost-portal-root { color-scheme: light; }

.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, #fff 0 18%, transparent 19%),
    conic-gradient(from 210deg, #fafafa, #52525b, #a1a1aa, #18181b, #fafafa);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 0 18px rgba(255,255,255,0.18);
  flex: none;
}
.logo-mark--lg { width: 100%; height: 100%; }

.site-nav .nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.02);
}
.site-nav .nav a {
  display: block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.site-nav .nav a:hover { color: var(--text); }
.site-nav .nav-current a { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { color: var(--text); background: var(--bg-hover); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--ring { border: 1px solid var(--line-strong); }

.mobile-menu-toggle { display: none; }
.burger { position: relative; width: 18px; height: 10px; }
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t), top var(--t);
}
.burger span:first-child { top: 0; }
.burger span:last-child { top: 8px; }
.mobile-menu-toggle[aria-expanded="true"] .burger span:first-child { top: 4px; transform: rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] .burger span:last-child { top: 4px; transform: rotate(-45deg); }

/* Menu: a bottom sheet on phones, a compact popover anchored to the menu button on desktop */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.menu-open .menu-backdrop { opacity: 1; visibility: visible; }

.mobile-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 82vh;
  max-height: 82dvh;
  overflow-y: auto;
  padding: 0.6rem 0.9rem calc(1rem + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-strong);
  background: rgba(16, 16, 20, 0.97);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
}
.mobile-drawer[hidden] { display: flex; }
.mobile-drawer.is-open { transform: none; visibility: visible; }
.menu-grip { width: 38px; height: 4px; margin: 0.15rem auto 0.35rem; border-radius: 4px; background: rgba(255, 255, 255, 0.18); flex: none; }

.mobile-nav .nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav .nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.mobile-nav .nav a::after {
  content: '';
  width: 7px;
  height: 7px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.35;
  flex: none;
}
.mobile-nav .nav a:hover { color: var(--text); background: var(--bg-hover); }
.mobile-nav .nav-current a { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.mobile-nav .nav-current a::after {
  width: 7px; height: 7px; border: 0; border-radius: 50%; transform: none; opacity: 1;
  background: var(--hot, var(--white));
  box-shadow: 0 0 10px var(--hot, rgba(255, 255, 255, 0.6));
}
.mobile-drawer .pill-btn--block { height: 46px; flex: none; }

@media (min-width: 821px) {
  .menu-backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mobile-drawer {
    left: auto;
    bottom: auto;
    top: var(--menu-top, 70px);
    right: var(--menu-right, 24px);
    width: 250px;
    max-height: 70vh;
    gap: 0.4rem;
    padding: 0.4rem;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.4);
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    opacity: 0;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease), visibility 0.25s;
  }
  .mobile-drawer.is-open { transform: none; opacity: 1; }
  .mobile-drawer.is-up { transform: translateY(6px) scale(0.97); transform-origin: bottom right; }
  .mobile-drawer.is-up.is-open { transform: none; }
  .menu-grip { display: none; }
  .mobile-nav .nav a { padding: 0.6rem 0.75rem; font-size: 0.92rem; border-radius: 12px; }
  .mobile-drawer .pill-btn--block { height: 38px; font-size: 0.875rem; margin: 0.2rem 0.15rem 0.15rem; width: auto; }
}

@media (max-width: 820px) {
  .desktop-only { display: none !important; }
  .mobile-menu-toggle { display: inline-flex; }
  .header-inner { grid-template-columns: 1fr auto; }
}
@media (min-width: 821px) {
  body:not([data-headerless]) .mobile-drawer { display: none !important; }
}

/* 4. Buttons & chips
   ========================================================================== */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 1rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--white);
  color: #09090b;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.pill-btn:hover { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 6px 24px -6px rgba(255, 255, 255, 0.35); }
.pill-btn:active { transform: scale(0.97); }
.pill-btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.pill-btn--ghost:hover { background: var(--bg-hover); box-shadow: none; }
.pill-btn--block { width: 100%; height: 48px; font-size: 1rem; }

.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 0.85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active { background: var(--white); border-color: var(--white); color: #09090b; }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.75em;
  color: var(--text);
}

/* 5. Profile header & topic bar
   ========================================================================== */
.feed-container {
  width: 100%;
  max-width: calc(var(--feed-width) + 2rem);
  margin: 1.25rem auto 0;
  padding: 0 1rem;
  overflow-x: clip; /* keeps profile flair (tail, sparkles) from widening the page */
}

.profile {
  margin-bottom: 1.25rem;
  animation: rise 0.7s var(--ease) both;
}

.profile-cover {
  position: relative;
  aspect-ratio: 3 / 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 6, 7, 0.55));
}
.profile-cover.is-empty {
  background:
    radial-gradient(60% 120% at 20% 0%, rgba(255,255,255,0.10), transparent 60%),
    radial-gradient(50% 100% at 85% 100%, rgba(255,255,255,0.06), transparent 60%),
    var(--bg-raised);
}
.profile-cover.is-empty::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

.profile-body {
  position: relative;
  padding: 0 0.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
}

.profile-avatar {
  grid-column: 1;
  width: 88px;
  height: 88px;
  margin-top: -44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-raised);
  color: var(--text-3);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line-strong), 0 12px 32px -8px rgba(0,0,0,0.8);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar svg { width: 60%; height: 60%; }
.profile-avatar--glyph {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--text);
  background: radial-gradient(circle at 30% 25%, #26262b, #0c0c0e 70%);
}

.profile-actions {
  grid-column: 2;
  justify-self: end;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.75rem;
}

.profile-name {
  grid-column: 1 / -1;
  margin-top: 0.85rem;
  font-family: var(--font-name);
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.profile-bio {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 52ch;
}
.profile-stats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 0.75rem;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-3);
}
.profile-stats:empty { display: none; }
.profile-stats strong { color: var(--text); font-weight: 600; }
.profile-stats a { color: var(--text-2); transition: color var(--t-fast); }
.profile-stats a:hover { color: var(--text); }

.profile--compact .profile-cover { aspect-ratio: 4 / 1; }

/* 5b. Discord-style flair: frame, avatar decoration, effect
   ========================================================================== */
.profile { position: relative; --profile-bg: var(--bg); }

.profile-avatar-wrap {
  grid-column: 1;
  position: relative;
  width: 88px;
  height: 88px;
  margin-top: -44px;
  z-index: 2;
}
.profile-avatar-wrap .profile-avatar {
  width: 100%;
  height: 100%;
  margin-top: 0;
  box-shadow: 0 0 0 4px var(--profile-bg), 0 0 0 5px var(--line-strong), 0 12px 32px -8px rgba(0,0,0,0.8);
}

.avatar-deco {
  position: absolute;
  left: -22%;
  top: -22%;
  width: 144%;
  height: 144%;
  max-width: none; /* overrides the global svg max-width, which squashed it inward */
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
/* Give the name breathing room below the flowers that hang under the avatar */
.profile-avatar-wrap:has(.avatar-deco) ~ .profile-name { margin-top: 1.75rem; }

.deco-cluster { transform-box: view-box; animation: bob 4.5s ease-in-out infinite alternate; }
.deco-cluster--b { animation-delay: -2.2s; }
.deco-spark {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(255, 236, 170, 0.9));
  animation: twinkle 2.6s ease-in-out infinite;
}
.deco-spark--2 { animation-delay: -0.9s; }
.deco-spark--3 { animation-delay: -1.7s; }

.profile-effect {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
}

/* Cat frame.
   The card surface is painted on ::before (z 0) so the tail (z -1) can tuck in behind it. */
.profile.has-frame {
  --frame-fill: #0b0b0e;
  --frame-stroke: rgba(255, 255, 255, 0.2);
  --frame-accent: #f2a9bc;
  --frame-eye: #f6c96c;
  --profile-bg: #0f0f13;
  isolation: isolate;
  margin: 2.25rem 0.4rem 3.5rem;
  padding: 10px 10px 1.35rem;
  border-radius: 30px;
}
.profile.has-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #121217, #0c0c0f);
  border: 1.5px solid var(--frame-stroke);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(255, 255, 255, 0.1),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}
.profile.has-frame .profile-cover { z-index: 1; border-radius: 22px; }
.profile.has-frame .profile-body { z-index: 1; padding: 0 0.6rem; }

.frame { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
/* Ears sit behind the card surface (z -1), so the border and band cross their base.
   Set in from the corners, where the top edge is straight. */
.frame-ear {
  position: absolute;
  z-index: -1;
  top: -39px;
  overflow: visible;
  transform-origin: 50% 100%;
}
.frame-ear--l { left: 18px; animation: ear-twitch-l 7s ease-in-out infinite; }
.frame-ear--r { right: 18px; transform: scaleX(-1); animation: ear-twitch-r 9s ease-in-out 2s infinite; }

@keyframes ear-twitch-l {
  0%, 88%, 100% { transform: rotate(0deg); }
  91% { transform: rotate(-9deg); }
  94% { transform: rotate(3deg); }
}
@keyframes ear-twitch-r {
  0%, 88%, 100% { transform: scaleX(-1) rotate(0deg); }
  91% { transform: scaleX(-1) rotate(-9deg); }
  94% { transform: scaleX(-1) rotate(3deg); }
}
.frame-face { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); }
.frame-eyes { transform-box: fill-box; transform-origin: center; animation: cat-blink 5.5s infinite; }

.frame-tail {
  position: absolute;
  z-index: -1;
  left: -22px;
  bottom: -50px;
  width: 128px;
  height: 96px;
  overflow: visible;
  pointer-events: none;
  transform-origin: 85% 15%;
  animation: sway 4.2s ease-in-out infinite alternate;
}

.frame-sparkle {
  position: absolute;
  fill: #fff3cf;
  filter: drop-shadow(0 0 6px rgba(255, 236, 170, 0.85));
  animation: twinkle 2.8s ease-in-out infinite;
}
.frame-sparkle--1 { top: -28px; left: 88px; }
.frame-sparkle--2 { top: 58px; right: -15px; animation-delay: -0.7s; }
.frame-sparkle--3 { bottom: -14px; right: -10px; animation-delay: -1.4s; }
.frame-sparkle--4 { top: 46%; left: -15px; animation-delay: -2.1s; }

/* Petting: the face is the one clickable part of the frame */
.frame-face { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.frame-face ellipse { transition: transform 0.25s var(--ease); }
.frame-happy { opacity: 0; transition: opacity 0.15s; }
.frame.is-petted .frame-eyes { opacity: 0; }
.frame.is-petted .frame-happy { opacity: 1; }
.frame.is-petted .frame-face { animation: purr 0.5s var(--ease-spring); }

.frame-heart {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  color: var(--frame-accent);
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(242, 169, 188, 0.6));
  animation: heart-float 1.2s var(--ease) forwards;
}
@keyframes heart-float {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(var(--r)); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -58px) scale(1) rotate(var(--r)); }
}
@keyframes purr {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-3deg); }
  60% { transform: translateX(-50%) rotate(2.5deg); }
}

@keyframes cat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(4deg); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); } 50% { opacity: 0.35; transform: scale(0.6) rotate(20deg); } }
@keyframes bob { from { transform: translateY(-1.5px); } to { transform: translateY(1.5px); } }

@media (max-width: 640px) {
  .profile-avatar-wrap { width: 76px; height: 76px; margin-top: -38px; }
  .profile.has-frame { margin-left: 0.35rem; margin-right: 0.35rem; }
  .frame-face { transform: translateX(-50%) scale(0.85); transform-origin: top center; }
  .frame-tail { left: -14px; bottom: -44px; width: 112px; height: 84px; }
}

.topic-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 -1rem 1rem;
}
.topic-track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 1rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 2.5rem), transparent);
}

/* Homepage variant: carries search + menu (the top header is hidden) and sticks while scrolling */
.topic-bar.has-actions {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 0.55rem 0;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background-color var(--t);
}
/* Frosted only once it's pinned, so it's invisible while resting under the profile */
.topic-bar.has-actions.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(6, 6, 7, 0.82);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}
body[data-headerless] .feed-container { margin-top: 0; }

/* Homepage hero: the profile is centred in the first screen, leaving a strip at the bottom
   where the topic row and the top of the first post peek in as a cue to scroll. */
body[data-headerless] .profile-hero {
  --peek: 8.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--peek));
  min-height: calc(100svh - var(--peek));
  padding-top: 2.75rem; /* keeps room for the ears on short screens */
}
body[data-headerless] .profile-hero .profile { margin-bottom: 2.75rem; }
@media (max-width: 640px) {
  body[data-headerless] .profile-hero { --peek: 7.5rem; }
}
.topic-bar.has-actions .topic-track { padding-right: 0.5rem; }
.topic-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0.75rem 0 0.6rem;
  border-left: 1px solid var(--line);
}

/* Headerless homepage: no top bar (search + menu live in the topic row) */
body[data-headerless] .site-header { display: none; }
.topic-track::-webkit-scrollbar { display: none; }

/* 6. Feed cards
   ========================================================================== */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feed-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 0.85rem;
  padding: 1rem 1.1rem 0.6rem;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  isolation: isolate;
  outline: none;
  scroll-margin-top: calc(var(--header-h) + 12px);
  transition: border-color var(--t), background-color var(--t), transform var(--t);
  animation: rise 0.6s var(--ease) both;
}
.feed-card:nth-child(2) { animation-delay: 0.05s; }
.feed-card:nth-child(3) { animation-delay: 0.1s; }
.feed-card:nth-child(4) { animation-delay: 0.15s; }
.feed-card:nth-child(n+5) { animation-delay: 0.2s; }

/* Spotlight that follows the pointer (set by main.js) */
.feed-card::before,
.feed-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.feed-card::before {
  z-index: -1;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.018), transparent 50%);
}
.feed-card::after {
  padding: 1px;
  background: radial-gradient(220px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.11), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
@media (hover: hover) and (pointer: fine) {
  .feed-card:hover::before, .feed-card:hover::after { opacity: 1; }
}

.feed-card.is-focused {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255,255,255,0.06);
}

.feed-rail { padding-top: 2px; }

.feed-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #222227, #111114);
  color: var(--text-3);
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform var(--t-fast);
}
a.feed-avatar:hover { transform: scale(1.05); }
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-avatar svg { width: 62%; height: 62%; margin-top: 12%; }

.feed-main { min-width: 0; }

.feed-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.4rem;
  min-height: 22px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.feed-author { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
a.feed-author:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.feed-dot { color: var(--text-3); }
.feed-time { color: var(--text-3); font-variant-numeric: tabular-nums; transition: color var(--t-fast); }
.feed-time:hover { color: var(--text-2); }
.feed-tag {
  margin-left: auto;
  padding: 0.05rem 0.55rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.feed-tag:hover { color: var(--text); border-color: var(--line-strong); }

.feed-title {
  margin-top: 0.3rem;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
}
.feed-title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.feed-text {
  margin-top: 0.25rem;
  color: var(--text-body);
  font-size: 0.97rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.feed-title + .feed-text { color: var(--text-2); }

/* Caption sits under the media; posts without media (removed by main.js) keep the tight spacing */
.feed-media ~ .feed-caption { margin-top: 0.7rem; }
.feed-media ~ .feed-caption > :first-child { margin-top: 0; }

/* Text-only (status) posts read a little larger, like a status update */
.feed-card.is-text .feed-text {
  font-size: 1.075rem;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: -0.008em;
}

.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.55rem -0.5rem 0 -0.55rem;
}

.feed-read {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 34px;
  padding: 0 0.55rem;
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 400;
  transition: color var(--t-fast);
}
.feed-read svg { opacity: 0.7; transition: transform var(--t), opacity var(--t-fast); }
.feed-card:hover .feed-read { color: var(--text-2); }
.feed-read:hover { color: var(--text); }
.feed-read:hover svg { opacity: 1; transform: translate(1px, -1px); }

.feed-actions-end { display: flex; gap: 0.15rem; }

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.action-btn:hover { color: var(--text); background: var(--bg-hover); }
.action-btn:active { transform: scale(0.9); }
.action-btn.is-done { color: var(--text); animation: pop 0.4s var(--ease-spring); }
.action-btn--ring { width: 40px; height: 40px; border: 1px solid var(--line); color: var(--text-2); }

@media (max-width: 640px) {
  .feed-container { padding: 0 0.6rem; margin-top: 0.75rem; }
  .feed-card { grid-template-columns: 36px minmax(0, 1fr); gap: 0 0.7rem; padding: 0.9rem 0.9rem 0.5rem; border-radius: 18px; }
  .feed-avatar { width: 36px; height: 36px; }
  .profile-body { padding: 0 0.25rem; }
  .profile-avatar { width: 76px; height: 76px; margin-top: -38px; }
  .topic-bar { margin: 0 -0.6rem 0.85rem; }
  .topic-bar.has-actions { margin-bottom: 0.5rem; }
  .topic-actions { padding-right: 0.4rem; }
}

/* 7. Media carousel
   ========================================================================== */
.feed-media {
  position: relative;
  margin-top: 0.7rem;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0a0c;
  aspect-ratio: var(--media-ratio, 16 / 10);
  cursor: default;
}
.feed-media.is-empty { display: none; }
/* "Media shape" setting */
body[data-media="Classic"] { --media-ratio: 4 / 3; }
body[data-media="Square"] { --media-ratio: 1 / 1; }

.feed-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.feed-track::-webkit-scrollbar { display: none; }

.feed-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow: hidden;
}
.feed-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.8s var(--ease), opacity 0.4s var(--ease);
}
.feed-slide img.is-loading { opacity: 0; }

/* Portrait / square images: show the whole picture over a blurred fill */
.feed-slide.is-contain::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: var(--fill) center / cover no-repeat;
  filter: blur(28px) brightness(0.45) saturate(1.2);
}
.feed-slide.is-contain img { position: relative; object-fit: contain; }

/* YouTube click-to-load facade */
.yt-facade {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: #000;
  cursor: pointer;
}
/* hqdefault thumbnails are letterboxed 4:3 — scale crops the bars */
.yt-facade img { cursor: pointer; opacity: 0.85; transform: scale(1.12); transition: opacity var(--t), transform 0.8s var(--ease); }
.yt-facade:hover img { opacity: 1; transform: scale(1.15); }
.yt-play {
  position: absolute;
  top: 50%; left: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.25), 0 10px 30px rgba(0,0,0,0.5);
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform var(--t-fast), background-color var(--t-fast);
}
.yt-facade:hover .yt-play { transform: translate(-50%, -50%) scale(1.08); background: rgba(255,255,255,0.92); color: #000; }
.feed-slide iframe { width: 100%; height: 100%; border: 0; }

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 250, 250, 0.92);
  color: #09090b;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.carousel-btn--prev { left: 10px; }
.carousel-btn--next { right: 10px; }
.carousel-btn:hover { transform: scale(1.08); }
.carousel-btn[disabled] { opacity: 0 !important; pointer-events: none; }
.feed-media:hover .carousel-btn, .carousel-btn:focus-visible { opacity: 1; }
@media (hover: none) { .carousel-btn { display: none; } }

.carousel-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.carousel-dots span {
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.45);
  transition: width var(--t), background-color var(--t);
}
.carousel-dots span.is-active { width: 14px; background: #fff; }

/* 8. Pagination & infinite loader
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 3rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-3);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.9rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.pagination a:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-hover); }
.pagination-info { font-family: var(--font-mono); font-size: 0.75rem; }
.pagination.is-enhanced { display: none; }

.feed-loader {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 2.5rem 0 1rem;
}
.feed-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.3;
}
.feed-loader.is-loading span { animation: blink 1s infinite ease-in-out; }
.feed-loader.is-loading span:nth-child(2) { animation-delay: 0.15s; }
.feed-loader.is-loading span:nth-child(3) { animation-delay: 0.3s; }

.feed-end {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 0.5rem;
  color: var(--text-3);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
.feed-end::before, .feed-end::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 9. Article (post / page)
   ========================================================================== */
.article {
  width: 100%;
  max-width: calc(var(--article-width) + 3rem);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.article-header { animation: rise 0.6s var(--ease) both; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 2rem -0.7rem;
  height: 34px;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.back-link:hover { color: var(--text); background: var(--bg-hover); }
.back-link svg { transition: transform var(--t); }
.back-link:hover svg { transform: translateX(-3px); }

.article-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.article-byline-text { display: flex; flex-direction: column; line-height: 1.35; }
.article-byline-sub { font-size: 0.85rem; color: var(--text-3); }
.article-byline-sub a { color: var(--text-2); transition: color var(--t-fast); }
.article-byline-sub a:hover { color: var(--text); }

.article-title {
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.article-lede {
  margin-top: 1rem;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

.article-media {
  margin: 2.25rem auto 0;
  max-width: var(--wide-width);
  width: calc(100vw - 2rem);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.article-media img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.article-media figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
}

.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.share-row { display: flex; align-items: center; gap: 0.4rem; }
.share-label { margin-right: 0.35rem; font-size: 0.8rem; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

.article-comments { margin-top: 3rem; }

.more-posts {
  width: 100%;
  max-width: calc(var(--article-width) + 3rem);
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.more-posts:empty { display: none; }
.more-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-card);
  transition: border-color var(--t), transform var(--t);
}
.more-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.more-card--next { grid-column: 2; text-align: right; }
.more-card--next .more-body { flex-direction: row-reverse; }
.more-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.more-body { display: flex; align-items: center; gap: 0.75rem; }
.more-body img { width: 48px; height: 48px; flex: none; border-radius: var(--r-sm); object-fit: cover; }
.more-title {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .article { padding: 1rem 1.15rem 0; }
  .back-link { margin-bottom: 1.25rem; }
  .article-media { width: calc(100vw - 1.2rem); }
  .article-media img { border-radius: var(--r-md); }
  .more-posts { grid-template-columns: 1fr; padding: 0 1.15rem; }
  .more-card--next { grid-column: auto; }
}

/* 10. Content typography & Koenig cards
   ========================================================================== */
.gh-content {
  margin-top: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-body);
}
.gh-content > * + * { margin-top: 1.4em; }
.gh-content > :first-child { margin-top: 0; }

.gh-content h2, .gh-content h3, .gh-content h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}
.gh-content h2 { margin-top: 2.2em; font-size: 1.6rem; font-weight: 600; }
.gh-content h3 { margin-top: 1.8em; font-size: 1.3rem; font-weight: 600; }
.gh-content h4 { margin-top: 1.6em; font-size: 1.1rem; font-weight: 600; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 0.6em; }

.gh-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}
.gh-content a:hover { text-decoration-color: var(--text); }

.gh-content strong { color: var(--text); font-weight: 600; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: 0.5em; }
.gh-content li::marker { color: var(--text-3); }

.gh-content blockquote:not([class]) {
  padding-left: 1.25rem;
  border-left: 2px solid var(--text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--text);
}
.gh-content blockquote.kg-blockquote-alt {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-style: italic;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
  padding: 0 1rem;
}

.gh-content hr { border: 0; height: 1px; background: var(--line-strong); margin: 3em 0; }

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
}
.gh-content pre {
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  background: #0b0b0d;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
}
.gh-content pre code { padding: 0; background: none; border: 0; font-size: inherit; color: var(--text-body); }

.gh-content figure img, .kg-image-card img { border-radius: var(--r-md); }
.gh-content figcaption { margin-top: 0.7rem; text-align: center; font-size: 0.85rem; color: var(--text-3); }
.gh-content .kg-image-card img:not(a img), .gh-content .kg-gallery-image img { cursor: zoom-in; }

.kg-width-wide {
  position: relative;
  width: min(var(--wide-width), calc(100vw - 2rem));
  left: 50%;
  transform: translateX(-50%);
}
.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}
.kg-width-full img { border-radius: 0 !important; }

/* Dark-friendly Koenig card overrides */
.gh-content .kg-bookmark-container {
  border-radius: var(--r-md) !important;
  border: 1px solid var(--line-strong) !important;
  background: var(--bg-raised);
  color: var(--text) !important;
  text-decoration: none !important;
  transition: border-color var(--t-fast);
}
.gh-content .kg-bookmark-container:hover { border-color: rgba(255,255,255,0.25) !important; }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { color: var(--text-2) !important; }
.gh-content .kg-callout-card { border-radius: var(--r-md); }
.gh-content .kg-callout-card-grey, .gh-content .kg-callout-card-white { background: rgba(255,255,255,0.05); }
.gh-content .kg-toggle-card, .gh-content .kg-product-card-container, .gh-content .kg-file-card-container, .gh-content .kg-audio-card {
  background: var(--bg-raised) !important;
  border-color: var(--line-strong) !important;
  border-radius: var(--r-md);
}
.gh-content .kg-btn { border-radius: var(--r-pill); }

.paywall-card {
  margin-top: 2rem;
  padding: 2rem;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
}

/* 11. Footer
   ========================================================================== */
.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 1.5rem) calc(2.5rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 2rem;
  align-items: start;
}
.footer-title { font-family: var(--font-name); font-weight: 600; font-size: 1.15rem; color: var(--text); line-height: 1.2; letter-spacing: -0.01em; }
.footer-desc { margin-top: 0.4rem; max-width: 40ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; }
.footer-nav a { color: var(--text-2); transition: color var(--t-fast); }
.footer-nav a:hover { color: var(--text); }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-meta { align-items: flex-start; }
}

/* 12. Lightbox, dialog, toast
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 4rem 1rem;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity var(--t);
  touch-action: pan-y;
  user-select: none;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lightbox-backdrop {
  position: absolute;
  inset: -10%;
  background: var(--lb-fill, none) center / cover no-repeat;
  filter: blur(60px) brightness(0.35) saturate(1.3);
  transition: background-image 0.4s;
}

.lightbox-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; max-width: 100%; }
.lightbox-img {
  max-width: min(92vw, 1600px);
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  width: auto;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.9);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}
.lightbox.is-open .lightbox-img.is-ready { transform: none; opacity: 1; }
.lightbox-caption { max-width: 60ch; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.lightbox-caption:empty { display: none; }

.lightbox-bar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  z-index: 2;
}
.lightbox-counter { font-family: var(--font-mono); font-size: 0.8rem; color: rgba(255,255,255,0.7); }

.lightbox-close, .lightbox-nav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--t-fast), transform var(--t-fast);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox-nav { position: absolute; top: 50%; margin-top: -22px; z-index: 2; }
.lightbox-nav--prev { left: 1.25rem; }
.lightbox-nav--next { right: 1.25rem; }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .lightbox-nav { display: none; }
}

  margin: auto;
  width: min(380px, calc(100vw - 2rem));
  padding: 1.25rem 1.25rem 1.4rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: rgba(16, 16, 19, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 1100;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-pill);
  background: var(--white);
  color: #09090b;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-spring), opacity 0.25s var(--ease);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* 13. Error page
   ========================================================================== */
.error-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 6rem 1.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(7rem, 30vw, 11rem);
  line-height: 0.9;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.08));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.error-message { color: var(--text-3); margin-bottom: 1rem; }

/* 14. View transitions & motion
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { 50% { transform: scale(1.25); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes blink { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: none; } }

/* Cross-document view transitions: the card's image morphs into the article. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.28s; }

::view-transition-group(post-media) {
  animation-duration: 0.5s;
  animation-timing-function: var(--ease);
  border-radius: var(--r-lg);
  overflow: clip;
}
::view-transition-old(post-media),
::view-transition-new(post-media) {
  height: 100%;
  object-fit: cover;
}
::view-transition-group(site-header) { animation: none; }

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

/* 15. Styles (theme setting): NSFW + Halloween, sensitive media, age gate
   ========================================================================== */

/* Accent palette per style. Shared rules below use these variables. */
.theme-nsfw {
  --hot: #ff2d55;
  --hot-light: #ff3b62;
  --hot-deep: #b3123b;
  --hot-on: #fff;
  --aura-2: rgb(179 18 59 / 0.10);
  --aura-3: rgb(255 110 80 / 0.06);
  --mark-a: #ffd0da;
  --mark-b: #2a0710;
  --mark-c: #120307;
}
.theme-halloween {
  --hot: #ff7a1a;
  --hot-light: #ff9a3d;
  --hot-deep: #c2410c;
  --hot-on: #1a0d02;
  --aura-2: rgb(139 92 246 / 0.12);
  --aura-3: rgb(76 29 149 / 0.10);
  --mark-a: #ffe0b8;
  --mark-b: #2e1065;
  --mark-c: #140a24;
}

.theme-thanksgiving {
  --hot: #e8892b;
  --hot-light: #f4a64a;
  --hot-deep: #9a3412;
  --hot-on: #1c0f05;
  --aura-2: rgb(180 83 9 / 0.12);
  --aura-3: rgb(190 18 60 / 0.07);
  --mark-a: #fde7c2;
  --mark-b: #5a2a0c;
  --mark-c: #1f1007;
}

.theme-christmas {
  --hot: #e63946;
  --hot-light: #ff5a66;
  --hot-deep: #a4161a;
  --hot-on: #fff;
  --aura-2: rgb(22 163 74 / 0.12);
  --aura-3: rgb(234 179 8 / 0.07);
  --mark-a: #fff1c1;
  --mark-b: #14532d;
  --mark-c: #0a1f12;
}
.theme-seward {
  --hot: #2dd4bf;
  --hot-light: #5eead4;
  --hot-deep: #0f766e;
  --hot-on: #042f2a;
  --aura-2: rgb(74 222 128 / 0.10);
  --aura-3: rgb(167 139 250 / 0.09);
  --mark-a: #ecfeff;
  --mark-b: #0c4a6e;
  --mark-c: #071a2b;
}

/* "Brand color" accent setting: uses the accent colour from Ghost Settings → Brand (set inline on <body>) */
.theme-brand {
  --hot: var(--brand, #ff7a59);
  --hot-light: color-mix(in srgb, var(--hot) 78%, #fff);
  --hot-deep: color-mix(in srgb, var(--hot) 68%, #000);
  --hot-on: #fff;
  --aura-2: color-mix(in srgb, var(--hot) 9%, transparent);
  --aura-3: color-mix(in srgb, var(--hot) 5%, transparent);
  --mark-a: color-mix(in srgb, var(--hot) 25%, #fff);
  --mark-b: color-mix(in srgb, var(--hot) 35%, #000);
  --mark-c: color-mix(in srgb, var(--hot) 12%, #000);
}

/* Shared accent rules: any style that adds .theme-accent to <body> and defines the variables above. */.theme-accent {
  --hot-glow: color-mix(in srgb, var(--hot) 35%, transparent);
}
.theme-accent ::selection { background: var(--hot); color: var(--hot-on); }
.theme-accent :focus-visible { outline-color: var(--hot); }
.theme-accent .ambient-aurora {
  background:
    radial-gradient(50% 60% at 50% 0%, color-mix(in srgb, var(--hot) 12%, transparent), transparent 70%),
    radial-gradient(30% 40% at 25% 10%, var(--aura-2), transparent 70%),
    radial-gradient(30% 40% at 75% 6%, var(--aura-3), transparent 70%);
}
.theme-accent .ambient-orb { background: radial-gradient(circle, color-mix(in srgb, var(--hot) 5%, transparent), transparent 65%); }
.theme-accent .pill-btn:not(.pill-btn--ghost) { background: linear-gradient(135deg, var(--hot-light), var(--hot-deep)); color: var(--hot-on); }
.theme-accent .pill-btn:not(.pill-btn--ghost):hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hot) 15%, transparent), 0 6px 24px -6px var(--hot-glow); }
.theme-accent .chip.is-active { background: var(--hot); border-color: var(--hot); color: var(--hot-on); }
.theme-accent .reading-progress span { background: linear-gradient(90deg, color-mix(in srgb, var(--hot) 20%, transparent), var(--hot)); box-shadow: 0 0 12px var(--hot-glow); }
.theme-accent .feed-card::after { background: radial-gradient(220px circle at var(--mx) var(--my), color-mix(in srgb, var(--hot) 22%, transparent), transparent 65%); }
.theme-accent .feed-card.is-focused { border-color: color-mix(in srgb, var(--hot) 50%, transparent); }
.theme-accent .carousel-dots span.is-active { background: var(--hot); }
.theme-accent .action-btn.is-done { color: var(--hot); }
.theme-accent .logo-mark {
  background:
    radial-gradient(circle at 30% 28%, var(--mark-a) 0 16%, transparent 17%),
    conic-gradient(from 210deg, var(--hot-light), var(--mark-b), var(--hot-deep), var(--mark-c), var(--hot-light));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hot) 30%, transparent), 0 0 18px var(--hot-glow);
}

/* NSFW frame */
.profile.frame-nsfw {
  --frame-fill: #0e0507;
  --frame-stroke: rgba(255, 70, 100, 0.32);
  --frame-accent: #ff2d55;
  --profile-bg: #120709;
}
.profile.frame-nsfw::before {
  background: linear-gradient(180deg, #170a0e, #0d0608);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(255, 45, 85, 0.22),
    0 0 40px -6px rgba(255, 45, 85, 0.25),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}
.frame-horn {
  position: absolute;
  z-index: -1; /* behind the card, like the cat ears */
  top: -46px;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 0 10px rgba(255, 45, 85, 0.35));
}
.frame-horn--l { left: 22px; }
.frame-horn--r { right: 22px; transform: scaleX(-1); }
.frame-badge-text {
  font-family: var(--font-name);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  fill: var(--frame-accent);
  filter: drop-shadow(0 0 4px rgba(255, 45, 85, 0.8));
}
.frame-nsfw .frame-sparkle { fill: #ffb3c3; filter: drop-shadow(0 0 6px rgba(255, 45, 85, 0.9)); }
.frame-nsfw .deco-spark { filter: drop-shadow(0 0 4px rgba(255, 45, 85, 0.9)); }

/* Sensitive media (#nsfw posts) */
.feed-card.is-sensitive:not(.is-revealed) .feed-track,
.article.is-sensitive:not(.is-revealed) .article-media img,
.article.is-sensitive:not(.is-revealed) .gh-content img,
.article.is-sensitive:not(.is-revealed) .gh-content video,
.article.is-sensitive:not(.is-revealed) .gh-content iframe {
  filter: blur(32px) brightness(0.55) saturate(1.2);
  transform: scale(1.04);
}
.article.is-sensitive:not(.is-revealed) .gh-content figure { overflow: hidden; border-radius: var(--r-md); cursor: pointer; }
.article.is-sensitive:not(.is-revealed) .gh-content iframe,
.article.is-sensitive:not(.is-revealed) .gh-content video { pointer-events: none; }
.feed-track, .article-media img, .gh-content img { transition: filter 0.5s var(--ease), transform 0.5s var(--ease); }
.article-media { overflow: hidden; border-radius: var(--r-lg); }

.sensitive-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 0;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  cursor: pointer;
  text-align: center;
}
.sensitive-cover svg { margin-bottom: 0.2rem; opacity: 0.9; }
.sensitive-title { font-weight: 600; font-size: 0.95rem; }
.sensitive-sub {
  font-size: 0.78rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  transition: background-color var(--t-fast);
}
.sensitive-cover:hover .sensitive-sub { background: rgba(255, 255, 255, 0.18); }
.feed-card.is-sensitive .carousel-btn,
.feed-card.is-sensitive .carousel-dots,
.feed-card.is-sensitive .carousel-count { transition: opacity var(--t); }
.feed-card.is-sensitive:not(.is-revealed) .carousel-btn,
.feed-card.is-sensitive:not(.is-revealed) .carousel-dots { opacity: 0 !important; pointer-events: none; }

.sensitive-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--text-2);
}
.sensitive-notice span { flex: 1; }
.sensitive-notice svg { flex: none; color: var(--text-3); }
.sensitive-notice + .article-media { margin-top: 1rem; }

/* Age gate */
/* Visible whenever the setting is on (body.has-age-gate), even before scripts run;
   age-gate.js / main.js add html.age-ok once the visitor has confirmed. */
.age-gate { display: none; }
html:not(.age-ok) body.has-age-gate { overflow: hidden; }
html:not(.age-ok) .has-age-gate .age-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(6, 4, 5, 0.86);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}
.age-gate-card {
  width: min(420px, 100%);
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, #160a0d, #0c0607);
  border: 1px solid rgba(255, 70, 100, 0.3);
  box-shadow: 0 0 0 6px #0b0406, 0 0 60px -10px rgba(255, 45, 85, 0.35), 0 40px 100px -30px #000;
  animation: pop-in 0.45s var(--ease) both;
}
.age-gate-badge {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border-radius: 50%;
  font-family: var(--font-name);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #ff5d7d, #b3123b 70%);
  box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.15), 0 0 30px rgba(255, 45, 85, 0.5);
}
.age-gate-title { font-family: var(--font-name); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.age-gate-text { margin-top: 0.5rem; font-size: 0.92rem; color: var(--text-2); }
.age-gate-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.5rem; }
.age-gate-actions .pill-btn { height: 46px; font-size: 0.95rem; }
.age-gate-enter { background: linear-gradient(135deg, #ff3b62, #b3123b) !important; color: #fff !important; }

/* Halloween frame */
.profile.frame-halloween {
  --frame-fill: #0d0816;
  --frame-stroke: rgba(167, 139, 250, 0.3);
  --frame-accent: #ff7a1a;
  --profile-bg: #110b1c;
}
.profile.frame-halloween::before {
  background: linear-gradient(180deg, #150d22, #0b0712);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(139, 92, 246, 0.25),
    0 0 44px -8px rgba(255, 122, 26, 0.22),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}

.frame-wing {
  position: absolute;
  z-index: -1; /* behind the card */
  top: -36px;
  transform-origin: 92% 70%;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.45));
}
.frame-wing--l { left: -4px; animation: wing-flap-l 6s ease-in-out infinite; }
.frame-wing--r { right: -4px; transform-origin: 8% 70%; animation: wing-flap-r 6s ease-in-out 0.15s infinite; }
@keyframes wing-flap-l {
  0%, 80%, 100% { transform: rotate(0deg); }
  84% { transform: rotate(10deg); }
  88% { transform: rotate(-4deg); }
  92% { transform: rotate(8deg); }
}
@keyframes wing-flap-r {
  0%, 80%, 100% { transform: rotate(0deg); }
  84% { transform: rotate(-10deg); }
  88% { transform: rotate(4deg); }
  92% { transform: rotate(-8deg); }
}

.frame-pumpkin-glow { filter: drop-shadow(0 0 3px #ff9a3d) drop-shadow(0 0 7px rgba(255, 122, 26, 0.7)); animation: candle 2.4s ease-in-out infinite; }
@keyframes candle {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.82; }
  23% { opacity: 1; }
  55% { opacity: 0.9; }
  60% { opacity: 0.7; }
  64% { opacity: 1; }
}

.frame-web {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 78px;
  height: 78px;
  opacity: 0.32;
  border-top-left-radius: 22px;
  overflow: hidden;
}

/* Extra room underneath so the spider doesn't dangle into the topic row */
.profile.frame-halloween,
body[data-headerless] .profile-hero .profile.frame-halloween { margin-bottom: 4.75rem; }

.frame-spider {
  position: absolute;
  bottom: -64px;
  right: 74px;
  transform-origin: 50% 0;
  animation: spider-swing 3.6s ease-in-out infinite alternate;
}
@keyframes spider-swing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

.frame-halloween .frame-sparkle { fill: #ffd0a1; filter: drop-shadow(0 0 6px rgba(255, 122, 26, 0.9)); }
.frame-halloween .deco-spark { filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.9)); }
.frame-heart.is-bat { width: 22px; height: 22px; margin-left: -11px; color: #a78bfa; filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7)); }

@media (max-width: 640px) {
  .frame-wing--l { left: -2px; }
  .frame-wing--r { right: -2px; }
  .frame-spider { right: 48px; }
}

/* Thanksgiving frame */
.profile.frame-thanksgiving {
  --frame-fill: #110b07;
  --frame-stroke: rgba(244, 166, 74, 0.3);
  --frame-accent: #e8892b;
  --frame-eye: #1a0f08;
  --profile-bg: #150e09;
}
.profile.frame-thanksgiving::before {
  background: linear-gradient(180deg, #1b120b, #0f0a06);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(217, 72, 15, 0.28),
    0 0 44px -8px rgba(232, 137, 43, 0.22),
    0 0 60px -20px rgba(185, 28, 28, 0.2),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}
/* Extra room above for the tail fan and underneath for the hanging acorn */
.profile.frame-thanksgiving,
body[data-headerless] .profile-hero .profile.frame-thanksgiving { margin-top: 3.5rem; margin-bottom: 4.75rem; }

.frame-fan {
  position: absolute;
  z-index: -1; /* behind the card */
  top: -56px;
  left: 50%;
  margin-left: -110px;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 0 10px rgba(232, 137, 43, 0.3));
  animation: fan-strut 7s ease-in-out infinite;
}
/* now and then the turkey puffs up its tail */
@keyframes fan-strut {
  0%, 78%, 100% { transform: scale(1); }
  82% { transform: scale(1.08, 1.12); }
  86% { transform: scale(1.03, 1.05); }
  90% { transform: scale(1.08, 1.12); }
  95% { transform: scale(1); }
}
.frame-turkey .frame-wattle { transform-box: fill-box; transform-origin: 20% 0; animation: wattle 2.6s ease-in-out infinite alternate; }
@keyframes wattle { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }

.frame-wheat {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 78px;
  height: 78px;
  opacity: 0.4;
  border-top-left-radius: 22px;
  overflow: hidden;
}

.frame-acorn {
  position: absolute;
  bottom: -64px;
  right: 74px;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  animation: cane-swing 3.6s ease-in-out infinite alternate;
}

.frame-thanksgiving .frame-sparkle { fill: #ffe0a3; filter: drop-shadow(0 0 6px rgba(232, 137, 43, 0.9)); }
.frame-thanksgiving .deco-spark { filter: drop-shadow(0 0 4px rgba(232, 137, 43, 0.9)); }
.frame-heart.is-leaf { width: 20px; height: 20px; margin-left: -10px; color: #e8892b; filter: drop-shadow(0 0 5px rgba(217, 72, 15, 0.6)); }
.frame-heart.is-leaf:nth-of-type(3n) { color: #b91c1c; }
.frame-heart.is-leaf:nth-of-type(3n+1) { color: #f2b33d; }

@media (max-width: 640px) {
  .frame-fan { width: 190px; height: 60px; margin-left: -95px; top: -48px; }
  .frame-acorn { right: 48px; }
}

/* 16. Pixel world: footer scene + post critters (drawn by pixel.js)
   ========================================================================== */
.site-footer.has-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 330px;
}
.site-footer.has-scene .footer-inner { position: relative; z-index: 1; }
.footer-scene {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* Invisible behind the footer text, building to full strength at the very bottom */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 18%, rgba(0, 0, 0, 0.22) 42%, rgba(0, 0, 0, 0.7) 68%, #000 88%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 18%, rgba(0, 0, 0, 0.22) 42%, rgba(0, 0, 0, 0.7) 68%, #000 88%);
}
@media (max-width: 720px) {
  .site-footer.has-scene { min-height: 400px; }
}

.post-feed { gap: 1.75rem; } /* room for a critter to walk along a post's top edge */

.critter {
  position: absolute;
  bottom: calc(100% - 1px); /* feet on the card's top border */
  left: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  /* faint moonlit outline so dark critters (the black cat) read against the dark page */
  filter: drop-shadow(0 0 1px rgba(210, 210, 240, 0.55)) drop-shadow(0 0 4px rgba(210, 210, 240, 0.18));
}
.critter.is-in { opacity: var(--critter-alpha, 1); }
.critter svg { display: block; }

/* Christmas frame */
.profile.frame-christmas {
  --frame-fill: #0a100c;
  --frame-stroke: rgba(134, 239, 172, 0.26);
  --frame-accent: #e63946;
  --profile-bg: #0d1410;
}
.profile.frame-christmas::before {
  background: linear-gradient(180deg, #111a15, #0a0f0c);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(230, 57, 70, 0.28),
    0 0 44px -8px rgba(230, 57, 70, 0.2),
    0 0 60px -20px rgba(22, 163, 74, 0.25),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}
/* Extra room underneath for the hanging candy cane */
.profile.frame-christmas,
body[data-headerless] .profile-hero .profile.frame-christmas { margin-bottom: 4.75rem; }

.frame-antler {
  position: absolute;
  z-index: -1; /* behind the card */
  top: -44px;
  filter: drop-shadow(0 0 8px rgba(196, 154, 108, 0.25));
}
.frame-antler--l { left: 4px; }
.frame-antler--r { right: 4px; }

.frame-snowcap {
  position: absolute;
  top: -8px;
  left: 6px;
  right: 6px;
  width: calc(100% - 12px);
  height: 17px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.frame-lights {
  position: absolute;
  top: 9px;
  left: 34px;
  right: 34px;
  height: 18px;
  display: flex;
}
.frame-lights-wire { position: absolute; top: 0; left: 0; width: 100%; height: 7px; overflow: visible; }
.frame-lights span {
  flex: 1;
  position: relative;
  color: #ff4d5a;
}
.frame-lights span::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  width: 6px;
  height: 9px;
  margin-left: -3px;
  border-radius: 50% 50% 45% 45% / 40% 40% 60% 60%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
  animation: bulb 2.4s ease-in-out infinite;
}
.frame-lights span::after { /* little socket */
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  width: 3px;
  height: 2px;
  margin-left: -1.5px;
  background: #2b3a2f;
}
.frame-lights span:nth-child(5n+2) { color: #ff4d5a; }
.frame-lights span:nth-child(5n+3) { color: #4ade80; }
.frame-lights span:nth-child(5n+4) { color: #fcd34d; }
.frame-lights span:nth-child(5n+5) { color: #60a5fa; }
.frame-lights span:nth-child(5n+6) { color: #f9a8d4; }
.frame-lights span:nth-child(3n)::before { animation-delay: -0.8s; }
.frame-lights span:nth-child(3n+1)::before { animation-delay: -1.6s; }
.frame-lights span:nth-child(4n)::before { animation-duration: 1.9s; }
@keyframes bulb {
  0%, 100% { opacity: 1; filter: brightness(1.15); }
  50% { opacity: 0.35; filter: brightness(0.7); }
}

.frame-candycane {
  position: absolute;
  bottom: -77px;
  right: 70px;
  transform-origin: 50% 14%;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  animation: cane-swing 3.4s ease-in-out infinite alternate;
}
@keyframes cane-swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

.frame-christmas .frame-sparkle { fill: #ffe9a8; filter: drop-shadow(0 0 6px rgba(252, 211, 77, 0.9)); }
.frame-christmas .deco-spark { filter: drop-shadow(0 0 4px rgba(252, 211, 77, 0.9)); }
.frame-heart.is-snow { width: 18px; height: 18px; margin-left: -9px; color: #eef4ff; filter: drop-shadow(0 0 5px rgba(200, 220, 255, 0.8)); }

@media (max-width: 640px) {
  .frame-lights { left: 26px; right: 26px; }
  .frame-candycane { right: 46px; }
}

/* Seward frame */
.profile.frame-seward {
  --frame-fill: #08131f;
  --frame-stroke: rgba(125, 211, 252, 0.28);
  --frame-accent: #2dd4bf;
  --profile-bg: #0b1725;
}
.profile.frame-seward::before {
  background: linear-gradient(180deg, #0e1c2c, #08121d);
  box-shadow:
    0 0 0 6px var(--frame-fill),
    0 0 0 7.5px rgba(45, 212, 191, 0.25),
    0 0 50px -10px rgba(74, 222, 128, 0.22),
    0 0 60px -20px rgba(167, 139, 250, 0.25),
    0 30px 80px -30px rgba(0, 0, 0, 0.95);
}
/* Extra room underneath for the hanging anchor */
.profile.frame-seward,
body[data-headerless] .profile-hero .profile.frame-seward { margin-bottom: 4.75rem; }

.frame-peaks {
  position: absolute;
  z-index: -1; /* behind the card */
  top: -40px;
  filter: drop-shadow(0 0 10px rgba(125, 211, 252, 0.2));
}
.frame-peaks--l { left: -2px; }
.frame-peaks--r { right: -2px; }

.frame-anchor {
  position: absolute;
  bottom: -74px;
  right: 70px;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  animation: cane-swing 3.8s ease-in-out infinite alternate;
}

.frame-seward .frame-sparkle { fill: #ccfbf1; filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.9)); }
.frame-seward .deco-spark { filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.9)); }
.frame-heart.is-fish { width: 20px; height: 20px; margin-left: -10px; color: #bae6fd; filter: drop-shadow(0 0 5px rgba(125, 211, 252, 0.7)); }

@media (max-width: 640px) {
  .frame-anchor { right: 46px; }
}

/* Post ornaments: tiny decorations drifting around each card's edges (added by pixel.js) */
.card-orn {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.72;
  transform: rotate(var(--r, 0deg));
  transition: opacity 0.5s var(--ease);
  animation: orn-float var(--d, 7s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}
.card-orn svg { display: block; overflow: visible; }
.card-orn-mini {
  position: absolute;
  width: 55%;
  height: 55%;
  animation: orn-float var(--d, 6s) ease-in-out var(--delay, 0s) infinite;
}
.card-orn-mini.card-orn--twinkle { animation-name: orn-twinkle; }
.card-orn-mini.card-orn--spin { animation: orn-spin calc(var(--d, 6s) * 2.4) linear var(--delay, 0s) infinite; }
.feed-card:hover .card-orn { opacity: 0.9; }
.card-orn--twinkle { animation-name: orn-twinkle; }
.card-orn--spin { animation: orn-spin calc(var(--d, 7s) * 2.4) linear var(--delay, 0s) infinite; }
.card-orn--flap { animation-name: orn-flap; }
.card-orn--flap svg { animation: orn-wings 0.5s ease-in-out infinite alternate; transform-origin: center; }

@keyframes orn-float {
  0%, 100% { transform: translate(0, 0) rotate(var(--r, 0deg)); }
  50% { transform: translate(1.5px, -4px) rotate(calc(var(--r, 0deg) + 10deg)); }
}
@keyframes orn-twinkle {
  0%, 100% { transform: scale(1) rotate(var(--r, 0deg)); opacity: 0.6; }
  50% { transform: scale(0.55) rotate(calc(var(--r, 0deg) + 25deg)); opacity: 0.25; }
}
@keyframes orn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes orn-flap {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3px, -5px); }
}
@keyframes orn-wings { from { transform: scaleY(1.1); } to { transform: scaleY(0.75); } }

/* 17. Toggleable extras (theme settings)
   ========================================================================== */

/* "Footer links: Hide sign-up links" — Ghost's default "Sign up" item and any Portal (#/portal) links */
.footer-nav--no-signup li:has(> a[href*="#/portal"]),
.footer-nav--no-signup .nav-sign-up,
.footer-nav--no-signup .nav-subscribe { display: none; }

/* "Pagination: Load more button" */
.load-more { display: flex; margin: 2.5rem auto 0; height: 42px; padding: 0 1.4rem; }
.load-more[disabled] { opacity: 0.5; cursor: progress; }
.feed-loader[hidden] { display: none; }

/* "Reading aids": back-to-top button */
.to-top {
  position: fixed;
  right: calc(1.25rem + env(safe-area-inset-right));
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(16, 16, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-2);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity var(--t), transform var(--t), color var(--t-fast), border-color var(--t-fast);
}
.to-top[hidden] { display: none; }
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { color: var(--text); border-color: color-mix(in srgb, var(--hot, #fff) 45%, transparent); }
.menu-open .to-top { visibility: hidden; }

/* "Cursor trail" canvas */
.cursor-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1500;
  pointer-events: none;
}