/* ==========================================================================
   Gravy — public site components
   ========================================================================== */

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
@supports (background: color-mix(in srgb, red, transparent)) and ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    --glass-strength: var(--header-glass, .55);
    --glass-filter: saturate(calc(100% + 60% * var(--glass-strength))) blur(calc(24px * var(--glass-strength)));
    background-color: color-mix(in srgb, var(--bg) calc(100% - 30% * var(--glass-strength)), transparent);
    background-image: linear-gradient(155deg, rgb(255 255 255 / calc(.38 * var(--glass-strength))), transparent 66%);
    backdrop-filter: var(--glass-filter);
    -webkit-backdrop-filter: var(--glass-filter);
  }
  :root[data-theme="dark"] .site-header {
    background-image: linear-gradient(155deg, rgb(255 255 255 / calc(.12 * var(--glass-strength))), transparent 66%);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header, :root[data-theme="dark"] .site-header {
    background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -28px rgba(0, 0, 0, 0.5);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 32px;
  font-size: 0.72rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar__date { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }
.topbar__date svg { width: 13px; height: 13px; opacity: 0.8; }
.topbar__ticker {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topbar__ticker b {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar__ticker a { color: var(--ink-2); transition: color 0.2s var(--ease); }
.topbar__ticker a:hover { color: var(--accent); }
.topbar__socials { display: flex; align-items: center; gap: 12px; }
.topbar__socials a { display: inline-flex; opacity: 0.7; transition: opacity 0.2s var(--ease), color 0.2s var(--ease); }
.topbar__socials a:hover { opacity: 1; color: var(--accent); }
.topbar__socials svg { width: 14px; height: 14px; }

.nav-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.nav-primary { display: flex; justify-content: center; }
.nav-primary ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-primary > ul > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-primary > ul > li > a:hover { color: var(--ink); background: var(--surface-2); }
/* the demo marks the current item with the accent colour, not a filled pill */
.nav-primary > ul > li > a.is-active { color: var(--accent); font-weight: 560; }
.nav-primary > ul > li > a.is-active:hover { color: var(--accent); }
.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 230px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  z-index: 40;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.dropdown a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}
.dropdown a span { color: var(--ink-3); font-size: 0.75rem; }
.dropdown a:hover { background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .icon-btn { background: transparent; border-color: transparent; }
.theme-toggle__icon { display: grid; place-items: center; line-height: 0; }
.nav-actions .icon-btn:hover { background: var(--surface); border-color: var(--line); }
.nav-toggle { display: none; }

/* mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__anchor { display: contents; }
.mobile-nav__scrim {
  position: absolute; inset: 0;
  background: rgba(10, 11, 14, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.mobile-nav.is-open .mobile-nav__scrim { opacity: 1; }
.mobile-nav__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 88vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 20px 22px 32px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.36s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mobile-nav.is-open .mobile-nav__panel { transform: none; }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; }
.mobile-nav__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mobile-nav__links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line);
}
.mobile-nav__links a:hover { color: var(--accent); }
.mobile-nav__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-nav__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.mobile-nav__links a { justify-content: flex-start; gap: 8px; min-height: 44px; }
.mobile-nav__links svg, .mobile-nav__cats :is(svg, img) { flex: none; }
.mobile-nav__links span, .mobile-nav__cats span { min-width: 0; overflow-wrap: anywhere; }
.mobile-nav__cats a { min-height: 44px; }
.mobile-nav__action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-width: 44px; height: 44px; padding: 8px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 650;
}

@media (max-width: 1080px) {
  .nav-primary { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav-bar { grid-template-columns: auto 1fr auto; }
  .nav-actions { justify-content: flex-end; }
  .topbar__ticker { display: none; }
}
@media (max-width: 620px) {
  .topbar { height: 34px; font-size: 0.72rem; }
  .topbar__socials { display: none; }
  .nav-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .nav-bar .brand { min-width: 0; }
  .nav-bar .brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-actions { gap: 2px; }
  .nav-actions .icon-btn { width: 36px; height: 40px; }
}

/* ------------------------------------------------------------ container */
.page-shell { min-height: 60vh; }

/* --------------------------------------------------------------- hero */
.home-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-block: clamp(28px, 4vw, 44px) clamp(18px, 2.6vw, 28px);
}
.home-intro h1 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(2.1rem, 4.4vw, 3.45rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.home-intro h1 em { color: var(--accent); font-style: italic; }
.home-intro p { max-width: 34ch; color: var(--ink-3); font-size: 0.95rem; margin: 0; }
.home-intro__meta { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: var(--ink-3); margin-top: 14px; }
.home-intro__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

.hero { padding-bottom: clamp(30px, 4vw, 52px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 36px);
}
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .home-intro { flex-direction: column; align-items: flex-start; gap: 14px; }
}

.hero-side { display: flex; flex-direction: column; min-width: 0; }
.hero-side__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 6px;
}
.hero-side__head h2 { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.hero-side__head span { font-size: 0.74rem; color: var(--ink-3); }
/* --------------------------------------------------------- story cards */
.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
}
.post-card__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--surface-2);
  margin-bottom: 16px;
}
.post-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__media .chip {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--surface);
  border-color: transparent;
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.66rem;
}
.post-card__media .post-card__read {
  position: absolute;
  bottom: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(12, 14, 18, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 550;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.post-card:hover .post-card__read { opacity: 1; transform: none; }
.post-card__body { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.post-card__cat {
  font-size: 0.68rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.post-card h3 {
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: -0.018em;
  margin: 0;
  transition: color 0.2s var(--ease);
}
.post-card:hover h3 { color: var(--accent); }
.post-card p {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.post-meta .avatar { width: 24px; height: 24px; }
.post-meta__author { color: var(--ink-2); font-weight: 520; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.7; }

.post-card--feature .post-card__media { aspect-ratio: 16 / 9; }
.post-card--feature h3 { font-family: var(--font-display); font-weight: 620; font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.18; letter-spacing: -0.025em; }
.post-card--feature p { -webkit-line-clamp: 3; font-size: 0.95rem; }

.post-card--row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.post-card--row .post-card__media { order: 2; margin: 0; aspect-ratio: 4 / 3; }
.post-card--row h3 { font-size: 1.15rem; }
@media (max-width: 560px) {
  .post-card--row { grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; }
  .post-card--row p { display: none; }
}

.post-card--mini {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.post-card--mini .post-card__media { margin: 0; aspect-ratio: 1; border-radius: var(--radius-sm); }
.post-card--mini h3 { font-size: 0.92rem; line-height: 1.34; }
.post-card--mini .post-card__cat { font-size: 0.62rem; }

/* ----------------------------------------------------------- editorial */
.editorial {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 40px);
}
@media (max-width: 900px) { .editorial { grid-template-columns: minmax(0, 1fr); } }

.side-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 28px);
}
.side-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.side-panel__head h3 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); font-weight: 650; }

.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-list li { counter-increment: rank; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.rank-list li::before {
  content: counter(rank, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--line-strong);
}
.rank-list a { font-size: 0.92rem; font-weight: 550; line-height: 1.36; letter-spacing: -0.01em; transition: color 0.2s var(--ease); }
.rank-list a:hover { color: var(--accent); }
.rank-list small { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--ink-3); }

/* Tag cloud styles live in base.css — the admin editor uses them too. */

.author-spotlight {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  justify-items: center;
}
.author-spotlight p { font-size: 0.86rem; color: var(--ink-3); margin: 0; }
.author-spotlight h3 { font-size: 1rem; }

/* ----------------------------------------------------------- newsletter */
.newsletter-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4.4vw, 56px);
  background: #1d1d1f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
  isolation: isolate;
}
.newsletter-band::before {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  right: -120px; top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 62%);
  z-index: -1;
}
.newsletter-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
  z-index: -1;
  mask-image: linear-gradient(120deg, transparent 40%, #000);
}
.newsletter-band .kicker { color: rgba(255, 255, 255, 0.7); }
.newsletter-band .input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.newsletter-band .input::placeholder { color: rgba(255, 255, 255, 0.5); }
.newsletter-band h2 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}
.newsletter-band p { color: rgba(255, 255, 255, 0.76); font-size: 0.95rem; max-width: 46ch; margin: 0; }
.newsletter-form { display: grid; gap: 10px; min-width: 0; }
.newsletter-form__row { display: flex; min-width: 0; gap: 6px; padding: 5px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--btn-radius-cta); }
.newsletter-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0 14px;
  height: 34px;
  font-size: 0.88rem;
  border-radius: var(--btn-radius-cta);
}
.newsletter-form input::placeholder { color: rgba(255, 255, 255, 0.55); }
.newsletter-form input:focus { outline: none; }
.newsletter-form .btn { padding: 0 18px; height: 34px; }
.newsletter-form small { color: rgba(255, 255, 255, 0.55); font-size: 0.76rem; display: flex; align-items: center; gap: 6px; }
.newsletter-form__success { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #c9f5da; }
@media (max-width: 480px) {
  .newsletter-form__row { flex-direction: column; border-radius: 12px; }
  .newsletter-form .btn { width: 100%; }
}
@media (max-width: 780px) {
  .newsletter-band { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------- footer */
.site-footer {
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.footer-top {
  display: grid;
  grid-template-columns: var(--footer-columns, minmax(0, 1.6fr) repeat(3, minmax(0, 0.8fr)));
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(38px, 5vw, 64px);
}
.footer-top--with-support { grid-template-columns: var(--footer-columns, minmax(0, 1.6fr) repeat(4, minmax(0, 0.8fr))); }
.footer-brand p { color: var(--ink-3); font-size: 0.9rem; max-width: 38ch; margin: 14px 0 18px; }
.footer-col h4 {
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 14px; font-weight: 650;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { font-size: 0.88rem; color: var(--ink-2); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-socials { display: flex; gap: 8px; }
.footer-socials .icon-btn { width: 36px; height: 36px; background: transparent; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.footer-bottom nav { display: flex; gap: 16px; }
.footer-bottom a:hover { color: var(--ink); }
.to-top:not([hidden]) {
  position: fixed; z-index: 64; inset-inline-end: max(16px, env(safe-area-inset-right));
  bottom: calc(14px + var(--bottom-nav-space, env(safe-area-inset-bottom, 0px)));
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
  background: var(--surface); box-shadow: 0 4px 16px rgb(0 0 0 / .16); cursor: pointer;
}
.to-top:hover { color: var(--accent); border-color: var(--accent); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .footer-top, .footer-top--with-support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------- page heading */
.page-head {
  padding-block: clamp(28px, 4vw, 52px) clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(26px, 3.6vw, 42px);
}
.page-head__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-weight: 620; font-size: clamp(1.9rem, 3.6vw, 2.85rem); line-height: 1.06; letter-spacing: -0.032em; }
.page-head p { margin: 12px 0 0; color: var(--ink-3); max-width: 62ch; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { opacity: 0.6; }

/* ------------------------------------------------------------- article */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 100;
  transition: width 0.1s linear;
}

.article-header { padding-block: clamp(24px, 4vw, 48px) 0; }
.article-header__inner { max-width: 860px; margin-inline: auto; }
.article-header h1 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.07;
  letter-spacing: -0.035em;
  margin: 16px 0 18px;
}
.article-header .dek { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--ink-2); line-height: 1.55; max-width: 60ch; margin: 0 0 26px; }
.article-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.article-meta__author { display: flex; align-items: center; gap: 12px; }
.article-meta__author .avatar { width: 42px; height: 42px; }
.article-meta__author b { display: block; font-size: 0.9rem; font-weight: 580; }
.article-meta__author span { font-size: 0.78rem; color: var(--ink-3); }
.article-meta__actions { display: flex; align-items: center; gap: 8px; }
.article-meta__actions .share-label { font-size: 0.76rem; color: var(--ink-3); margin-right: 2px; }

.article-hero {
  max-width: 1000px;
  margin: clamp(24px, 3.4vw, 40px) auto 0;
}
.article-hero figure { margin: 0; }
.article-hero img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 8 / 5; object-fit: cover; }
.article-hero figcaption { margin-top: 10px; font-size: 0.78rem; color: var(--ink-3); text-align: center; }

.article-layout {
  display: grid;
  /* Cap the columns together: a wide site must not stretch the prose track
     past its readable width and push the sidebar away from the article. */
  grid-template-columns: minmax(0, 740px) 280px;
  column-gap: clamp(24px, 3vw, 48px);
  row-gap: 28px;
  max-width: 1068px;
  margin-inline: auto;
  align-items: start;
  padding-top: clamp(34px, 4.4vw, 56px);
}
.article-layout__main { min-width: 0; max-width: 740px; }
.article-layout__aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 22px; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); max-width: 740px; }
  .article-layout__aside { position: static; order: 3; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--surface);
}
.toc h4 { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; font-weight: 650; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 6px 10px 6px 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.toc a:hover { color: var(--accent); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.toc .toc-h3 a { padding-left: 22px; font-size: 0.8rem; color: var(--ink-3); }

.aside-share { display: flex; gap: 8px; }
.aside-card form.stack { gap: 8px; }
.aside-card .btn { width: 100%; }
.aside-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--surface);
}
.aside-card h4 { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.aside-card p { font-size: 0.84rem; color: var(--ink-3); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(28px, 4vw, 44px); }

.author-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: clamp(32px, 4vw, 48px);
}
.author-box h3 { font-size: 1.05rem; margin-bottom: 4px; }
.author-box .role { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; display: block; }
.author-box p { font-size: 0.9rem; color: var(--ink-3); margin: 0 0 12px; }
.author-box__links { display: flex; gap: 10px; font-size: 0.8rem; }
.author-box__links a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.author-box__links a:hover { color: var(--accent); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: clamp(28px, 4vw, 44px); }
.post-nav a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.post-nav a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-nav span { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.post-nav b { font-size: 0.95rem; font-weight: 580; line-height: 1.35; }
.post-nav a:last-child { text-align: right; align-items: flex-end; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav a:last-child { text-align: left; align-items: flex-start; } }

/* comments */
.comments { margin-top: clamp(36px, 5vw, 64px); padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.comments__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.comments__head h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment__head b { font-size: 0.9rem; }
.comment__head time { font-size: 0.76rem; color: var(--ink-3); }
.comment__body { font-size: 0.94rem; color: var(--ink-2); line-height: 1.65; padding-left: 44px; }
.comment__reply { margin-left: 44px; margin-top: 8px; font-size: 0.78rem; color: var(--ink-3); }
.comment__reply:hover { color: var(--accent); }
.comment-list .comment-list { margin-left: 44px; padding-top: 10px; }
.comment-list .comment-list .comment:last-child { border-bottom: 0; }
.comment-form { margin-top: 28px; padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 14px; }
.comment-form h3 { font-size: 1.1rem; }
.comment-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .comment-form__row { grid-template-columns: 1fr; } .comment__body, .comment__reply, .comment-list .comment-list { padding-left: 0; margin-left: 0; } }

/* ---------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: clamp(32px, 4vw, 52px); flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-grid; place-items: center;
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-2);
  background: var(--surface);
  transition: all 0.2s var(--ease);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .is-current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }
.pagination .ellipsis { border-color: transparent; background: none; }

/* -------------------------------------------------------------- search */
.search-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: none;
  background: var(--bg);
  backdrop-filter: blur(10px);
  padding: clamp(20px, 8vh, 100px) 20px;
}
.search-overlay.is-open { display: block; }
.search-panel { max-width: 680px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-panel form { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.search-panel form svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search-panel input { flex: 1; min-width: 0; border: 0; background: none; font-size: 1.05rem; outline: none; }
.search-panel__close {
  flex: none;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--surface-2);
}
.search-panel__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-panel__hints { padding: 16px 22px 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-panel__hints span { font-size: 0.76rem; color: var(--ink-3); margin-right: 4px; }
.search-panel__results { max-height: 46vh; overflow-y: auto; }
.search-result { display: flex; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.search-result:hover { background: var(--surface-2); }
.search-result img { width: 54px; height: 42px; border-radius: 8px; object-fit: cover; }

/* Toast styles live in base.css so the Studio gets them too — see the note there. */

/* ---------------------------------------------------------- empty state */
.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: clamp(40px, 8vw, 80px) 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty h3 { font-size: 1.2rem; }
.empty p { color: var(--ink-3); font-size: 0.9rem; margin: 0; max-width: 40ch; }
.empty__icon { width: 44px; height: 44px; color: var(--ink-3); opacity: 0.6; }

/* ------------------------------------------------------------- contact */
.split-page {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 880px) { .split-page { grid-template-columns: minmax(0, 1fr); } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.contact-list li { display: grid; gap: 3px; }
.contact-list b { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.contact-list a, .contact-list span { font-size: 0.98rem; }
.contact-list a:hover { color: var(--accent); }

/* 404 / status styles live in base.css — the admin error page uses them too. */

/* ------------------------------------------------------- extra surfaces */
.post-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.9);
}
.post-card__placeholder .serif { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; opacity: 0.9; letter-spacing: -0.04em; }
.post-card__placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 16px 16px;
}

.link-btn {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 520;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.filter-row__label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}
.sort-form { margin-left: auto; }
.sort-form .select {
  padding: 7px 34px 7px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  width: auto;
}

.panel-form {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.code-copy {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cfd6e6;
  font-size: 0.68rem;
  font-weight: 550;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.prose pre:hover .code-copy { opacity: 1; }
.code-copy:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* -------------------------------------------------------------- archive */
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
@media (max-width: 760px) { .archive-grid { grid-template-columns: minmax(0, 1fr); } }
.archive-month__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); margin-bottom: 6px;
}
.archive-month__head h2 { font-family: var(--font-display); font-weight: 620; font-size: 1.35rem; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.archive-list li:last-child { border-bottom: 0; }
.archive-list time { font-size: 0.76rem; color: var(--ink-3); }
.archive-list a:not(.chip) { font-size: 0.92rem; font-weight: 520; transition: color 0.2s var(--ease); }
.archive-list a:not(.chip):hover { color: var(--accent); }
.archive-list .chip { font-size: 0.62rem; padding: 3px 8px; }
@media (max-width: 520px) { .archive-list li { grid-template-columns: 50px minmax(0, 1fr); } .archive-list .chip { display: none; } }


/* ==========================================================================
   Recap-style additions
   ========================================================================== */

/* ---------------------------------------------------------- mega dropdown */
.mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 8px);
  width: min(680px, calc(100vw - 40px));
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  z-index: 40;
}
.has-dropdown:hover .mega,
.has-dropdown:focus-within .mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.mega__item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  transition: background 0.18s var(--ease);
}
.mega__item:hover { background: var(--surface-2); }
.mega__thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}
.mega__body { display: grid; gap: 2px; min-width: 0; }
.mega__body b { font-size: 0.86rem; font-weight: 560; letter-spacing: -0.015em; }
.mega__body span {
  font-size: 0.75rem;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mega__foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 10px 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-3);
}
@media (max-width: 980px) { .mega { display: none; } }

/* ------------------------------------------------------- newsletter popup */
.pop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}
.pop[hidden] { display: none; }
.pop__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: pop-fade 0.25s var(--ease);
}
.pop__card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px 32px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.55);
  animation: pop-rise 0.3s var(--ease);
}
.pop__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pop__close:hover { background: var(--surface-2); color: var(--ink); }
.pop__card h2 { font-size: 1.55rem; font-weight: 640; letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 8px; }
.pop__card p { color: var(--ink-3); font-size: 0.88rem; margin: 0 0 18px; }
.pop__form { display: grid; gap: 8px; }
.pop__row { display: flex; gap: 8px; }
.pop__row .input { flex: 1; min-width: 0; }
.pop__hint { font-size: 0.72rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
body.pop-open { overflow: hidden; }
@media (max-width: 480px) {
  .pop__card { padding: 28px 20px 22px; }
  .pop__row { flex-direction: column; }
}
@keyframes pop-fade { from { opacity: 0; } }
@keyframes pop-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* ------------------------------------------------------- before you go bar */
.bye-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 140%);
  width: min(720px, calc(100vw - 24px));
  z-index: 70;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
}
.bye-bar.is-visible { transform: translate(-50%, 0); opacity: 1; }
.bye-bar[hidden] { display: none; }
.bye-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--surface);
  backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.45);
}
.bye-bar__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.bye-bar__post { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.bye-bar__post img, .bye-bar__thumb {
  width: 38px; height: 38px; flex: none;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-2);
}
.bye-bar__text { min-width: 0; display: grid; gap: 1px; }
.bye-bar__text b { font-size: 0.85rem; font-weight: 560; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bye-bar__text span { font-size: 0.72rem; color: var(--ink-3); }
.bye-bar .icon-btn { width: 30px; height: 30px; flex: none; border-color: transparent; background: transparent; }
@media (max-width: 620px) {
  .bye-bar__label { display: none; }
  .bye-bar__inner { padding: 9px 10px; }
  .bye-bar .btn { display: none; }
}

/* -------------------------------------------------------------- up next */
.up-next { margin: 46px 0 40px; }
.up-next__card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.up-next__card:hover { border-color: var(--line-strong); }
.up-next__media { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.up-next__media img { width: 100%; height: 100%; object-fit: cover; }
.up-next__body { display: grid; gap: 6px; }
.up-next__body h3 { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.025em; line-height: 1.24; }
.up-next__body h3 a:hover { color: var(--accent); }
.up-next__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--ink-3); }
.up-next__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.up-next__actions { display: flex; gap: 8px; margin-top: 6px; }
.up-next__loaded { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); animation: pop-rise 0.4s var(--ease); }
.up-next__loaded h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 640; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 14px; }
.up-next__loaded .prose { max-width: 70ch; }
.up-next__loaded .post-meta { margin-bottom: 18px; }
.up-next__loaded-head { margin-bottom: 18px; }
.up-next__loaded-head h2 a:hover { color: var(--accent); }
.up-next__loaded .prose h2:first-child { margin-top: 0; }
.up-next__loaded .up-next__more { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .up-next__card { grid-template-columns: minmax(0, 1fr); }
  .up-next__media { aspect-ratio: 16 / 9; }
}

/* --------------------------------------------------- category spotlight */
.spotlight { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(22px, 3vw, 40px); align-items: start; }
.spotlight__lead { display: grid; gap: 14px; }
.spotlight__lead-media {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}
.spotlight__lead-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.spotlight__lead:hover .spotlight__lead-media img { transform: scale(1.03); }
.spotlight__lead h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 620; letter-spacing: -0.03em; line-height: 1.2; }
.spotlight__lead h3 a:hover { color: var(--accent); }
.spotlight__lead p { color: var(--ink-2); font-size: 0.94rem; margin: 0; max-width: 54ch; }
.spotlight__rows { display: grid; gap: 4px; }
.spotlight__row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.18s var(--ease);
}
.spotlight__row + .spotlight__row { border-top: 1px solid var(--line); border-radius: 0; }
.spotlight__row:hover { background: var(--surface-2); }
.spotlight__row img, .spotlight__row .spotlight__ph {
  width: 84px; height: 84px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.spotlight__row b { font-size: 0.96rem; font-weight: 560; letter-spacing: -0.02em; line-height: 1.3; display: block; }
.spotlight__row:hover b { color: var(--accent); }
.spotlight__row span { font-size: 0.74rem; color: var(--ink-3); }
@media (max-width: 900px) {
  .spotlight { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------- empty state helpers */
.empty__suggest { margin-top: 18px; display: grid; gap: 10px; justify-items: center; }
.empty__suggest .tag-cloud { justify-content: center; }

/* ---------------------------------------------- staff-only preview banner */
/* Rendered only for /preview/:ref, so a visitor never sees this. Colours come
   from the shared tokens so light and dark themes both work. */
.preview-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.preview-banner__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.preview-banner__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.preview-banner p {
  margin: 0;
  flex: 1 1 260px;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.preview-banner p strong { color: var(--ink); text-transform: capitalize; }
.preview-banner__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.preview-banner__back:hover { border-color: var(--accent); color: var(--accent); }

/* ----------------------------------------------------------------------- *
 * News strip
 *
 * A running band of headlines above the header, from RSS sources configured in
 * the dashboard. It renders nothing at all unless the feature is on and holding
 * headlines, so none of this is loaded on a site that has not configured a feed.
 *
 * Colour is `--ink` on `--bg` rather than a literal pair. Both tokens are
 * swapped under [data-theme='dark'], so the band is dark on a light page and
 * light on a dark page with no dark-mode override to forget — and it is always
 * maximum contrast against the page it sits on.
 *
 * z-index stays below .site-header (60). The header is sticky and this band is
 * not, so as the page scrolls the header must paint over it; a higher z-index
 * here would leave a strip of headlines floating on top of the navigation.
 * ----------------------------------------------------------------------- */
.news-strip {
  position: relative;
  z-index: 1;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.78rem;
  line-height: 1.4;
}
.news-strip__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: 38px;
}

.news-strip__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--bg);
  opacity: 0.72;
}
.news-strip__label b {
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 1;
}
.news-strip__label svg { width: 13px; height: 13px; }

/* The scroll window. Headlines fade out at both edges rather than being cut
   mid-glyph, which is what makes a marquee readable instead of noisy. */
.news-strip__viewport {
  position: relative;
  overflow: hidden;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
}

.news-strip__track {
  display: flex;
  width: max-content;
  animation: news-scroll var(--news-speed, 45s) linear infinite;
  will-change: transform;
}
.news-strip__set { display: flex; align-items: center; flex: none; }

/*
  Half the track, not the width of one item. The markup renders the headline
  list twice, so translating -50% moves exactly one copy: the second arrives at
  the left edge at the moment the first leaves it, and the loop has no seam.
*/
@keyframes news-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.news-strip__item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 18px;
  white-space: nowrap;
  color: var(--bg);
  opacity: 0.82;
  text-decoration: none;
  border-right: 1px solid color-mix(in srgb, var(--bg) 16%, transparent);
  transition: opacity 0.2s var(--ease);
}
.news-strip__item:hover { opacity: 1; text-decoration: underline; }
.news-strip__source {
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.62;
}
.news-strip__title { font-weight: 450; }

.news-strip__toggle {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1px solid color-mix(in srgb, var(--bg) 24%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--bg);
  opacity: 0.72;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.news-strip__toggle:hover { opacity: 1; border-color: color-mix(in srgb, var(--bg) 46%, transparent); }
.news-strip__toggle svg { width: 12px; height: 12px; }
/* Both glyphs are in the markup; the paused state decides which one shows. */
.news-strip__icon { display: inline-flex; }
.news-strip__icon[data-icon-play] { display: none; }
[data-news-strip][data-paused='true'] .news-strip__icon[data-icon-pause] { display: none; }
[data-news-strip][data-paused='true'] .news-strip__icon[data-icon-play] { display: inline-flex; }

/* Paused by the button. Animation is stopped rather than removed, so resuming
   continues from where the reader was instead of jumping to the top. */
[data-news-strip][data-paused='true'] .news-strip__track { animation-play-state: paused; }
/* Only headlines pause on hover, not the surrounding strip or Play button.
   Otherwise clicking Resume leaves the animation paused under the pointer.
   Avoid sticky hover on touchscreens; the explicit button works on all inputs. */
@media (hover: hover) and (pointer: fine) {
  [data-news-strip][data-pause='1'] .news-strip__viewport:hover .news-strip__track { animation-play-state: paused; }
}

/*
  A reader who asks their system for less motion gets a strip that does not move.
  The viewport becomes horizontally scrollable instead, so the headlines are
  still all reachable — removing the animation must not remove the content.
*/
@media (prefers-reduced-motion: reduce) {
  .news-strip__track { animation: none; }
  .news-strip__viewport { overflow-x: auto; scrollbar-width: thin; }
}

@media (max-width: 720px) {
  .news-strip__inner { grid-template-columns: minmax(0, 1fr) auto; height: 34px; }
  .news-strip__label { display: none; }
  .news-strip__item { padding: 0 14px; }
}

/* ----------------------------------------------------------------------- *
 * Brand marks
 *
 * Two places: beside an external link inside a post, and on a category.
 * ----------------------------------------------------------------------- */

/*
  Inserted by site.js next to links the renderer tagged with a domain. Sized in
  em and aligned to the text baseline so it scales with whatever body copy it
  lands in, and given the surface colour as a background so a transparent logo
  does not disappear into a dark page.
*/
.ext-link__icon {
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.34em;
  border-radius: 0.22em;
  object-fit: contain;
  vertical-align: -0.16em;
  background: var(--surface-2);
  flex: none;
}
/* A mark that failed to load is removed by the script; if it is ever seen in the
   meantime it should not draw a broken-image glyph inline with the text. */
.ext-link__icon:not([src]) { visibility: hidden; }

/* Buttons, headings and the mega-menu already carry their own iconography, so
   the script skips them; this is the belt-and-braces version of that rule. */
.btn .ext-link__icon,
h1 .ext-link__icon, h2 .ext-link__icon, h3 .ext-link__icon,
.mega .ext-link__icon { display: none; }

/* ------------------------------------------------------------------ */
/* Header composition: the three extra ticker placements and the      */
/* configurable topbar. Added after the strip rules on purpose — the  */
/* shared track/viewport classes keep the strip's specifics at equal  */
/* specificity, so source order is what lets each placement resize    */
/* the track without fighting the original band.                      */
/* ------------------------------------------------------------------ */

/* Broadcast panel: a weather-band-style slab above the header. */
.news-panel {
  position: relative;
  z-index: 1;
  color: #fff;
  background:
    radial-gradient(70rem 26rem at 8% 130%, rgba(32, 107, 234, 0.4), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 44px),
    linear-gradient(115deg, #0b1224, #101a33 55%, #0b1224);
  border-bottom: 1px solid var(--line);
}
.news-panel__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 0;
}
.news-panel__when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}
.news-panel__day {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.news-panel__date { font-size: 0.74rem; opacity: 0.72; }
.news-panel__label {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 0.66rem;
}
.news-panel__label b { text-transform: uppercase; letter-spacing: 0.08em; }
.news-panel__label svg { width: 12px; height: 12px; }
.news-panel .news-strip__viewport { height: 34px; }
.news-panel .news-strip__item { color: #fff; font-size: 0.82rem; }
.news-panel .news-strip__source { background: rgba(255, 255, 255, 0.16); color: #fff; }
.news-panel .news-strip__toggle { color: #fff; border-color: rgba(255, 255, 255, 0.34); }

/* Topbar: three slots, each element's side chosen in the dashboard. */
.topbar__group { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__group--mid { flex: 1; min-width: 0; justify-content: flex-start; }
.topbar__group--mid-right { justify-content: flex-end; }
.topbar__live {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.topbar__live .news-strip__viewport { height: 20px; }
.topbar__live .news-strip__item { font-size: 0.72rem; }
.topbar__live .news-strip__source { font-size: 0.6rem; padding: 1px 6px; }
.topbar__live .news-strip__toggle { width: 22px; height: 22px; flex: 0 0 auto; }
.news-strip__label--slim { padding: 2px 8px; font-size: 0.62rem; }

/* Header row placement: a slim band under the nav, inside the header. */
.header-ticker {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.header-ticker__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: 40px;
}
.header-ticker .news-strip__viewport { height: 22px; }
.header-ticker .news-strip__item { font-size: 0.76rem; }

/* Menu pushed to the right-hand side of the nav bar. */
.nav-bar--menu-right .nav-primary { justify-content: flex-end; }

@media (max-width: 1024px) {
  /* The slim bar has no room for a second moving thing on small screens;
     the strip and panel placements still carry the ticker there. */
  .topbar__live { display: none; }
  .news-panel__inner { grid-template-columns: minmax(0, 1fr) auto; }
  .news-panel__when { display: none; }
}
@media (max-width: 720px) {
  .news-panel__inner { grid-template-columns: minmax(0, 1fr); }
  .news-panel .news-strip__toggle { justify-self: end; }
  .header-ticker__inner { grid-template-columns: minmax(0, 1fr) auto; }
  .header-ticker .news-strip__label { display: none; }
}

/* Reader support ------------------------------------------------------
   Three skins for the same link list: a footer column, a card after an
   article, and a homepage band. Buttons stay pill-shaped and quiet so
   they read as an invitation, not an advert. */
.support-row { display: flex; flex-wrap: wrap; gap: 8px; }
.support-row--center { justify-content: center; }
.support-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.support-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.support-btn svg { flex: 0 0 auto; }
.support-btn--quiet { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.support-btn--quiet:hover { color: var(--accent-ink); }
.footer-col--support .support-row { margin-top: 2px; }
.support-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin: 26px 0; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft);
}
.support-card__text h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 4px; font-size: 1rem; font-weight: 700;
}
.support-card__text p { margin: 0; font-size: 0.86rem; color: var(--ink-2); }
.support-band { padding: clamp(30px, 5vw, 54px) 0; background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.support-band .container { text-align: center; }
.support-band h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.support-band p { margin: 0 auto 18px; max-width: 52ch; color: var(--ink-2); font-size: 0.92rem; }

/* ------------------------------------------------------------- deals */
.deals-hero { padding-bottom: 58px; }
.deals-hero__content { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 34px; }
.deals-hero h1 { margin-top: 12px; font-size: clamp(2.8rem, 6vw, 5.5rem); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: break-word; }
.deals-hero__content > div:first-child > p { max-width: 43ch; font-size: 1rem; line-height: 1.65; }
.deals-hero__note { width: min(100%, 285px); border: 1px solid var(--line); background: var(--surface); padding: 20px; border-radius: 14px; }
.deals-hero__note > span { display: block; color: var(--accent); font-size: 1.5rem; margin-bottom: 8px; }
.deals-hero__note b { font-size: .85rem; }
.deals-hero__note p { font-size: .8rem; line-height: 1.5; margin-top: 6px; }
.deals-directory { padding-top: 58px; padding-bottom: 90px; }
.deals-directory__intro { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; }
.deals-directory__intro h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.03em; margin-top: 8px; }
.deals-directory__intro p { max-width: 55ch; color: var(--ink-3); font-size: .82rem; line-height: 1.6; }
.deals-directory__intro a { color: var(--accent-ink); text-decoration: underline; }
.deals-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 40px; }
.deals-filter { border: 1px solid var(--line); border-radius: 100px; padding: 9px 15px; color: var(--ink-2); font-size: .78rem; font-weight: 600; transition: .2s ease; }
.deals-filter span { color: var(--ink-3); margin-left: 4px; }
.deals-filter:hover, .deals-filter.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.deals-filter:hover span, .deals-filter.is-active span { color: inherit; }
.deals-group { margin-top: 44px; }
.deals-group[hidden] { display: none; }
.deals-group__heading { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 20px; }
.deals-group__heading h2 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -.02em; }
.deals-group__heading span { color: var(--ink-3); font-size: .75rem; }
.deals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.deal-card { --deal-tone: #314c79; --deal-tint: #e9effa; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.deal-card--books-reading { --deal-tone: #795035; --deal-tint: #f7ede4; }
.deal-card--certifications { --deal-tone: #345c52; --deal-tint: #e7f2ed; }
.deal-card--hosting-platforms { --deal-tone: #544a80; --deal-tint: #eeeafa; }
.deal-card--creator-tools { --deal-tone: #854c60; --deal-tint: #faeaf0; }
.deal-card:hover, .deal-card:focus-within { border-color: var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.deal-card__brand { position: relative; isolation: isolate; display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 16px 18px; overflow: hidden; color: var(--deal-tone); background: var(--deal-tint); background-image: linear-gradient(135deg, transparent, rgba(255, 255, 255, .35)); }
.deal-card__brand-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .65rem; line-height: 1.3; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.deal-card__brand-main { display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 12px; }
.deal-card__brand-watermark { position: absolute; z-index: -1; right: -8px; bottom: -52px; font-size: 150px; font-weight: 800; line-height: 1; color: var(--deal-tone); opacity: .045; pointer-events: none; }
.deal-logo { width: 50px; height: 50px; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid rgba(0, 0, 0, .06); border-radius: 14px; box-shadow: 0 8px 20px rgba(30, 40, 60, .1); color: var(--deal-tone); font-size: 1.3rem; font-weight: 700; overflow: hidden; }
.deal-logo span, .deal-logo img { grid-area: 1 / 1; }
.deal-logo img { width: 32px; height: 32px; object-fit: contain; }
.deal-logo img[hidden], .deal-logo span[hidden] { display: none; }
.deal-card__identity { min-width: 0; }
.deal-card h3 { color: #20242b; font-size: 1.08rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; overflow-wrap: break-word; overflow-wrap: anywhere; }
.deal-domain { font-size: .75rem; color: #596271; margin: 5px 0 0; overflow-wrap: break-word; overflow-wrap: anywhere; }
.deal-status { padding: 4px 8px; border-radius: 100px; background: var(--surface); color: var(--ink-2); font-size: .65rem; font-weight: 600; letter-spacing: 0; text-transform: none; text-align: center; }
.deal-card__offer-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 16px; }
.deal-card__offer-details { flex: 1 1 125px; min-width: 0; }
.deal-offer { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.3; overflow-wrap: break-word; overflow-wrap: anywhere; }
.deal-code, .deal-valid { margin-top: 4px; color: var(--ink-2); font-size: .73rem; line-height: 1.4; overflow-wrap: break-word; overflow-wrap: anywhere; }
.deal-code strong { color: var(--ink); font-family: monospace; }
.deal-link { flex: none; }

/* Keep the brand panel and logo tile dark too, not just the card body. */
[data-theme='dark'] .deal-card { --deal-tone: #aec8f5; --deal-tint: #1c304c; }
[data-theme='dark'] .deal-card--books-reading { --deal-tone: #eac4a3; --deal-tint: #493222; }
[data-theme='dark'] .deal-card--certifications { --deal-tone: #a7d8c7; --deal-tint: #1e4037; }
[data-theme='dark'] .deal-card--hosting-platforms { --deal-tone: #cbbbf3; --deal-tint: #342950; }
[data-theme='dark'] .deal-card--creator-tools { --deal-tone: #efb8cd; --deal-tint: #492735; }
[data-theme='dark'] .deal-card__brand { background-image: linear-gradient(135deg, transparent, rgba(0, 0, 0, .2)); }
[data-theme='dark'] .deal-card h3 { color: var(--ink); }
[data-theme='dark'] .deal-domain { color: var(--ink-2); }
[data-theme='dark'] .deal-card__brand-watermark { opacity: .08; }
[data-theme='dark'] .deal-logo { background: #303236; border-color: rgba(255, 255, 255, .12); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
/* Many favicons contain dark artwork: a soft halo keeps them legible on a dark tile. */
[data-theme='dark'] .deal-logo img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .8)); }
@media (prefers-reduced-transparency: reduce) {
  .deal-card, .deals-hero__note { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .deal-card__brand { background: var(--deal-tint); }
}
@media (max-width: 900px) { .deals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .deals-hero__content, .deals-directory__intro { align-items: stretch; flex-direction: column; }
  .deals-hero__note { width: 100%; }
  .deals-grid { grid-template-columns: minmax(0, 1fr); }
  .deals-directory { padding-top: 38px; }
}

/* News sources and locally rendered feed articles. */
.news-source-groups { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; }
.news-source-groups summary { cursor: pointer; font-weight: 600; }
.news-source-groups ul { margin: 8px 0; padding-inline-start: 20px; }
.news-source-groups a { color: var(--accent); }
.news-entry__body { max-width: 780px; margin-inline: auto; padding-block: clamp(28px, 4vw, 56px); overflow-wrap: anywhere; }
.news-entry__body img { display: block; max-width: 100%; height: auto; }
.news-entry__body figure { margin-inline: 0; }
.news-entry__body pre { max-width: 100%; overflow-x: auto; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 0.55em 0.75em; border: 1px solid currentColor; text-align: start; vertical-align: top; }
.news-entry__source { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Shared topic heading and inline category marks. */
.toolkit-cover__badge {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f6f9ff;
  border: 1px solid #dce5ee;
  box-shadow: 0 2px 7px #101b2d12;
}
.toolkit-cover__badge img {
  position: static;
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: none;
}
img.mega__thumb { background: transparent; }
.mega__thumb.mega__thumb--mark { object-fit: contain; padding: 6px; }
.topic-page-title { display: flex; align-items: center; gap: 12px; }
.chip img.topic-chip-icon { position: static; width: 14px; height: 14px; object-fit: contain; padding: 1px; border-radius: 3px; background: #f6f9ff; transform: none; }

/* Reuse the Deals card component on Browse by topic, keeping the tiles square. */
.category-deals-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.category-deals-grid .category-deal-card {
  /* Keep content out of intrinsic sizing so long titles cannot stretch the tile. */
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  --deal-tone: color-mix(in srgb, var(--category-tone) 60%, var(--ink));
  --deal-tint: color-mix(in srgb, var(--category-tone) 16%, var(--surface));
}
.category-deal-card .deal-card__brand { position: absolute; inset: 0; padding: clamp(10px, 1.4vw, 18px); }
.category-deal-card :is(h2, h3) { margin: 0; color: var(--ink); font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.category-deal-card__description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.category-deal-card .deal-card__offer-row { padding-top: 8px; }
.category-deal-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1000px) { .category-deals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .category-deals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .category-deal-card__description { display: none; } .category-deal-card .deal-logo { width: 36px; height: 36px; } .category-deal-card .deal-logo img { width: 24px; height: 24px; } }
@media (max-width: 420px) { .category-deals-grid { grid-template-columns: minmax(0, 1fr); } }

.category-deal-card [data-category-card-logo]:not(.is-loaded) { opacity: 0; }

/* Homepage builder layouts. Defaults retain the existing editorial design. */
.home-hero--feature .hero__grid, .home-hero--stack .hero__grid { grid-template-columns:minmax(0,1fr); }
.home-hero--feature .hero-card { min-height:max(var(--hero-height, 460px), clamp(350px,52vw,620px)); }
.home-hero--stack .hero-side { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.home-hero--stack .hero-side__head, .home-hero--stack .hero-side > p { grid-column:1 / -1; }
.home-categories--wide { grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-categories--wide .category-deal-card { aspect-ratio: 1.65; min-height:180px; }
.home-categories--compact { grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-categories--compact .category-deal-card { aspect-ratio:auto; }
.home-categories--compact .deal-card__brand { position:relative; }
.home-categories--compact .deal-card__brand-main { margin:0; }
.home-categories--compact :is(.deal-card__brand-meta,.category-deal-card__description,.deal-card__offer-row) { display:none; }
.home-spotlight--stack, .home-picks--stack { grid-template-columns:minmax(0,1fr); }
.home-spotlight--stack .spotlight__lead-media { aspect-ratio:2.5; }
.home-picks--stack > aside { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:14px; }
.home-picks--stack > aside > * { margin:0; }
.home-newsletter--center { grid-template-columns:minmax(0,1fr); justify-items:center; text-align:center; }
.home-newsletter--center .newsletter-form { width:min(100%,480px); }
.home-newsletter--compact { width:min(100%,720px); margin-inline:auto; grid-template-columns:minmax(0,1fr); padding:25px; gap:16px; }
.home-journal-list { grid-template-columns:minmax(0,1fr); max-width:880px; margin-inline:auto; }
.home-support--center .support-band { width:min(calc(100% - 32px),820px); margin-inline:auto; border:1px solid var(--line); border-radius:var(--radius-lg); }
@media(min-width:901px) {
  .home-spotlight--mirror .spotlight__lead, .home-picks--mirror > :first-child { grid-area:1 / 2; }
  .home-spotlight--mirror .spotlight__rows, .home-picks--mirror > aside { grid-area:1 / 1; }
  .home-picks--mirror { grid-template-columns:minmax(220px,.75fr) minmax(0,1.7fr); }
}
@media(max-width:720px) {
  .home-hero--stack .hero-side { grid-template-columns:minmax(0,1fr); }
  .home-categories--wide, .home-categories--compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:440px) { .home-categories--wide, .home-categories--compact { grid-template-columns:minmax(0,1fr); } }

/* Browse by topic: feather the artwork into the same tinted surface as the copy. */
.category-deal-card--immersive .deal-card__brand { padding: clamp(12px, 1.55vw, 22px); }
.category-deal-card__art {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 54%, transparent 98%);
}
.category-deal-card__art img {
  position: absolute; top: 3%; left: 0; width: 74%; height: 76%;
  object-fit: contain; object-position: left center;
  opacity: .8;
  mask-image: linear-gradient(to right, #000 10%, #000 28%, rgb(0 0 0 / .55) 64%, transparent 100%);
}
.category-deal-card--immersive .deal-card__brand-meta { justify-content: flex-end; }
.category-deal-card__copy { position: relative; margin-top: auto; isolation: isolate; }
.category-deal-card__copy::before {
  content: ''; position: absolute; z-index: -1; inset: -20px -24px -24px;
  pointer-events: none; background: linear-gradient(0deg, var(--deal-tint) 54%, transparent);
}
.category-deal-card--immersive :is(h2, h3) { font-size: clamp(1.35rem, 2.3vw, 2.1rem); color: color-mix(in srgb, var(--ink) 68%, var(--deal-tone)); font-weight: 680; letter-spacing: -.045em; }
.category-deal-card--immersive .deal-domain { font-size: .86rem; color: var(--ink-2); }

/* Spectra-inspired topic grid: crisp panels, pill metadata, and a clear card action. */
.category-card-view .category-deal-card--immersive {
  border-radius: 22px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 8%, transparent);
}
.category-card-view .category-deal-card--immersive:hover,
.category-card-view .category-deal-card--immersive:focus-visible {
  border-color: var(--deal-tone);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--deal-tone) 18%, transparent);
}
.category-card-view .category-deal-card--immersive .deal-card__brand {
  background-image: radial-gradient(ellipse at 9% 25%, color-mix(in srgb, var(--category-tone) 27%, transparent), transparent 69%);
}
.category-card-view .category-deal-card--immersive .deal-status {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.category-card-view .category-deal-card--immersive :is(h2, h3) {
  color: var(--ink);
  font-weight: 740;
}
.category-card-view .category-deal-card__copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 8px;
}
.category-card-view .category-deal-card__copy :is(h2, h3) { grid-column: 1; }
.category-card-view .category-deal-card__arrow {
  grid-area: 1 / 2;
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}

/* Use softened, theme-aware foregrounds instead of stark black or white. */
.category-card-view .category-deal-card--immersive :is(h2, h3) {
  color: color-mix(in srgb, color-mix(in srgb, var(--ink-2) 84%, var(--category-tone)) 88%, var(--surface));
}
.category-card-view .category-deal-card--immersive :is(.deal-status, .category-deal-card__arrow) {
  color: var(--ink-2);
}

/* Nudge the category title toward the lower-left edge without moving the arrow. */
.category-card-view .category-deal-card__copy :is(h2, h3) {
  position: relative;
  inset-block-start: 4px;
  inset-inline-start: -4px;
}

/* Homepage category cards share the topic page title palette at a compact scale. */
.category-deals-grid .category-deal-card:not(.category-deal-card--immersive) h3 {
  font-size: clamp(1.4rem, 2.15vw, 1.85rem);
  color: color-mix(in srgb, color-mix(in srgb, var(--ink-2) 84%, var(--category-tone)) 88%, var(--surface));
}
.category-deal-card:not(.category-deal-card--immersive) .deal-card__brand-meta { justify-content: flex-end; }

/* Let homepage category logos sit directly on the card background. */
.category-deal-card:not(.category-deal-card--immersive) .deal-logo {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.category-deal-card:not(.category-deal-card--immersive) .deal-logo img {
  width: clamp(38px, 4vw, 46px);
  height: clamp(38px, 4vw, 46px);
}
@media (max-width: 540px) {
  .category-deal-card:not(.category-deal-card--immersive) .deal-logo img { width: 32px; height: 32px; }
}

/* Selectable homepage category designs. */
.reading-preview { padding-block:40px; }
.reading-preview__section { margin-top:40px; }
.reading-preview__section > h2 { margin-bottom:14px; }
:is(.home-categories--clean,.home-categories--side-by-side,.home-categories--mosaic,.home-categories--centered,.home-categories--index) .category-deal-card__description { display:none; }
.home-categories--clean .deal-card__brand-main { flex-direction:column; align-items:flex-start; flex:1; justify-content:space-between; margin-top:0; }
.home-categories--centered .deal-card__brand { align-items:center; justify-content:center; gap:8px; }
.home-categories--centered .deal-card__brand-main { flex-direction:column; text-align:center; order:-1; margin:0; }
.home-categories--index { grid-template-columns:1fr; gap:8px; }
.home-categories--index .category-deal-card { aspect-ratio:auto; }
.home-categories--index .deal-card__brand { position:relative; flex-direction:row-reverse; justify-content:space-between; gap:12px; }
.home-categories--index .deal-card__brand-main { margin:0; }
@media(min-width:721px) {
  .home-categories--mosaic { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .home-categories--mosaic .category-deal-card { grid-column:span 2; }
  .home-categories--mosaic .category-deal-card:first-child { grid-column:span 4; grid-row:span 2; }
}

.home-categories--side-by-side { grid-template-columns: repeat(3,minmax(0,1fr)); }
@media(max-width: 900px) { .home-categories--side-by-side { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width: 560px) { .home-categories--side-by-side { grid-template-columns:1fr; } }
.home-categories--side-by-side .category-deal-card { aspect-ratio:auto; min-height:112px; }
.home-categories--side-by-side .deal-card__brand { position:relative; display:flex; flex-direction:row-reverse; align-items:center; justify-content:space-between; gap:8px; }
.home-categories--side-by-side .deal-card__brand-main { margin:0; flex:1; min-width:0; }
.home-categories--side-by-side .deal-status { white-space:nowrap; }

/* Article-end suggestions use the same logo-first pill language as menu topics. */
.related-post-links { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.related-post-links li { min-width: 0; }
.related-post-link {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.related-post-link:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--surface-2); }
.related-post-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.related-post-link__logo { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; }
.related-post-link__logo :is(img, svg) { display: block; width: 24px; height: 24px; object-fit: contain; }
.related-post-link__text { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; font-weight: 600; line-height: 1.5; }

/* Mute category artwork without blurring small logo details. */
:is(.home-category-grid .deal-logo img, .home-category-grid .category-deal-card__art img, .category-page-grid .category-deal-card__art img, .mega__thumb--mark, .mobile-nav__cats img, .related-post-link__logo img) {
  filter: var(--category-logo-base-filter, brightness(1)) saturate(calc(1 - .64 * var(--category-logo-softness, .5))) contrast(calc(1 - .2 * var(--category-logo-softness, .5)));
}
:is(.home-category-grid .deal-logo img.is-loaded, .mega__thumb--mark, .mobile-nav__cats img, .related-post-link__logo img) { opacity: calc(1 - .52 * var(--category-logo-softness, .5)); }
:is(.home-category-grid, .category-page-grid) .category-deal-card__art img { opacity: calc(.8 - .3 * var(--category-logo-softness, .5)); }

/* Use white silhouettes for the bundled dark marks, then apply the softness setting. */
:root[data-theme="dark"] :is(.home-category-grid, .category-page-grid, .mega, .mobile-nav__cats, .related-post-links)
  img:is([src="/assets/toolkit/docker.svg"], [src="/assets/toolkit/linux.svg"]) {
  --category-logo-base-filter: brightness(0) invert(1);
}

/* Mobile bottom navigation: primary links scroll, More stays within reach. */
.bottom-nav { display: none; }
@media (max-width: 1080px) {
  body.has-bottom-nav { --bottom-nav-space: calc(65px + env(safe-area-inset-bottom)); padding-bottom: var(--bottom-nav-space); }
  .has-bottom-nav .nav-toggle { display: none; }
  .has-bottom-nav .mobile-nav { bottom: var(--bottom-nav-space); }
  .bottom-nav {
    position: fixed; inset: auto 0 0; z-index: 65;
    display: flex; align-items: center; gap: 6px;
    padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -6px 24px rgb(0 0 0 / .12);
  }
  .bottom-nav__scroll {
    position: relative; display: flex; flex: 1; min-width: 0; gap: 5px;
    overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin;
    padding: 3px;
  }
  .bottom-nav__link, .bottom-nav__bubble {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 44px; padding-inline: 12px; flex: none; white-space: nowrap;
    border: 1px solid var(--line); border-radius: 999px;
    color: var(--ink); background: var(--surface-2); font-size: .8rem; font-weight: 650;
  }
  .bottom-nav__link.is-active { color: var(--ink); background: color-mix(in srgb, var(--accent) 19%, var(--surface)); border-color: var(--accent); }
  .bottom-nav--icons :is(.bottom-nav__link, .bottom-nav__bubble) { min-width: 44px; padding-inline: 0; }
  .bottom-nav__bubble { cursor: pointer; }
  .bottom-nav :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
}

/* Keep topic names on one line even when desktop cards are narrow. */
.category-card-view .category-deal-card__copy:has(> h2) { container-type: inline-size; }
.category-card-view .category-deal-card__copy h2 {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(.85rem, 13cqi, 2.1rem);
}

@media (max-width: 720px) {
  .category-card-view > .category-deals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card-view .category-deal-card__copy h2 { font-size: clamp(.85rem, 13cqi, 1.35rem); }
  .category-card-view .category-deal-card__arrow { width: 24px; }
}

/* The pointed bubble and panel move as one surface, including on close. */
@media (max-width: 1080px) {
  .mobile-nav--bottle {
    display: block; visibility: hidden; pointer-events: none;
    transition: visibility 0s linear 260ms;
  }
  .mobile-nav--bottle.is-open {
    visibility: visible; pointer-events: auto; transition-delay: 0s;
  }
  .mobile-nav--bottle .mobile-nav__scrim { backdrop-filter: none; background: rgb(10 11 14 / .25); transition-duration: 260ms; }
  .mobile-nav--bottle .mobile-nav__anchor {
    display: block; position: absolute;
    inset: auto max(10px, env(safe-area-inset-right)) 16px auto;
    width: min(280px, calc(100% - 24px));
    opacity: 0; transform: translateY(10px) scale(.96);
    transform-origin: var(--menu-tip, calc(100% - 25px)) bottom;
    transition: transform 260ms var(--ease), opacity 260ms var(--ease);
  }
  .mobile-nav--bottle.is-open .mobile-nav__anchor { opacity: 1; transform: none; }
  .mobile-nav--bottle .mobile-nav__anchor::after {
    content: ''; position: absolute; bottom: -8px;
    left: clamp(24px, var(--menu-tip, calc(100% - 25px)), calc(100% - 24px));
    width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg);
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    border-radius: 0 0 3px 0; background: var(--surface); pointer-events: none;
  }
  .mobile-nav--bottle .mobile-nav__panel {
    position: relative; inset: auto; width: 100%;
    max-height: calc(100dvh - var(--bottom-nav-space, 0px) - 32px);
    gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 27px;
    background: var(--surface); box-shadow: 0 12px 28px rgb(0 0 0 / .24);
    overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
    transform: none; transition: none;
  }
  .mobile-nav--bottle .mobile-nav__panel > * { flex: none; }
  .mobile-nav--bottle .mobile-nav__head { justify-content: flex-end; }
  .mobile-nav--bottle .mobile-nav__head .brand { display: none; }
  .mobile-nav--bottle .mobile-nav__links,
  .mobile-nav--bottle .mobile-nav__cats,
  .mobile-nav--bottle .mobile-nav__foot { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 6px; margin: 0; }
  .mobile-nav--bottle .mobile-nav__foot {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch;
    padding-top: 10px; border-top: 1px solid var(--line);
  }
  .mobile-nav--bottle .mobile-nav__links a,
  .mobile-nav--bottle .mobile-nav__cats a {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    min-height: 44px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  }
  .mobile-nav--bottle .mobile-nav__links svg,
  .mobile-nav--bottle .mobile-nav__cats :is(img, svg) { flex: none; }
  /* Newsletter and sign-in/Studio share one aligned row with equal tap targets. */
  .mobile-nav--bottle .mobile-nav__action {
    display: flex; flex: none; align-items: center; justify-content: center; gap: 6px;
    width: 100%; min-width: 0; height: 44px; padding: 8px;
    border-radius: 999px; font-size: .8rem; font-weight: 650; line-height: 1.3; text-align: center;
  }
  .mobile-nav--bottle .mobile-nav__action svg { flex: none; }
  .mobile-nav--bottle .mobile-nav__action span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav--bubble {
    left: auto; gap: 0; padding-left: 0; border: 0; background: transparent; box-shadow: none;
  }
  .bottom-nav--bubble .bottom-nav__bubble {
    width: 50px; height: 50px; padding: 0; background: var(--surface);
    box-shadow: 0 5px 20px rgb(0 0 0 / .22);
  }
  .bottom-nav__bubble[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); }
  .nav-toggle.mobile-menu-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; }
  .nav-toggle.mobile-menu-trigger--labelled,
  .bottom-nav--bubble .mobile-menu-trigger--labelled {
    width: auto; padding-inline: 14px; border-radius: 999px; white-space: nowrap; font-size: .8rem;
  }
  .mobile-nav.mobile-nav--icons :is(.mobile-nav__links, .mobile-nav__cats) {
    display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 8px;
  }
  .mobile-nav.mobile-nav--icons :is(.mobile-nav__links, .mobile-nav__cats) a {
    justify-content: center; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 999px;
  }
  /* Keep a clear gap from the floating menu, and no competing control under its tip. */
  body:has(.bottom-nav--bubble) .to-top {
    bottom: calc(var(--bottom-nav-space, 64px) + 24px);
    transition: visibility 0s linear 260ms;
  }
  body.has-open-bubble .to-top { visibility: hidden; pointer-events: none; transition-delay: 0s; }
  @media (prefers-reduced-motion: reduce) {
    .mobile-nav--bottle,
    .mobile-nav--bottle .mobile-nav__anchor,
    .mobile-nav--bottle .mobile-nav__scrim,
    body:has(.bottom-nav--bubble) .to-top { transition: none; }
  }
}

.home-picks--no-sidebar { grid-template-columns: minmax(0, 1fr); }
.home-picks--no-sidebar > :first-child { grid-area: auto; }

/* References share related-post styling, but only the text-width pill is clickable. */
.prose .reference-links { list-style: none; padding: 0; margin: 16px 0; }
.prose .reference-links li { margin: 10px 0; padding: 0; }
.prose .reference-link {
  display: inline-flex; align-items: center; width: fit-content; max-width: 100%;
  box-sizing: border-box; padding: 10px 18px; border: 1px solid var(--line);
  border-radius: 26px; background: var(--surface); color: var(--ink);
  font-size: .95rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere;
  text-decoration: none; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.prose .reference-link:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--surface-2); }
.prose .reference-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prose .reference-link::after, .prose .reference-link .ext-link__icon { display: none; }
