/* ================================================================
   Aurora — layout layer
   Home grid, cards, sidebar, page headers, footer
   ================================================================ */

/* ---------------------------------------------------------------
   7. Section headings
   --------------------------------------------------------------- */
.home-section {
  position: relative;
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(48px, 6vw, 72px);
}

.page-home .home-section {
  padding-top: calc(var(--header-h) + clamp(34px, 5vw, 52px));
}

.home-layout {
  display: block;
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.section-head > div {
  max-width: 620px;
}

.section-title {
  margin-top: 12px;
  font-size: clamp(1.85rem, 2.8vw, 2.55rem);
  font-weight: 780;
  letter-spacing: -0.04em;
}

.section-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.section-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.section-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  transform: translateY(-1px);
}

.section-link:hover .icon {
  transform: translateX(3px);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 64px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: var(--surface-2);
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--muted);
}

/* ---------------------------------------------------------------
   8. Post grid & cards
   --------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  box-shadow: var(--shadow-md);
}

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9.8;
  overflow: hidden;
  background: hsl(var(--hue, 240) 60% 92%);
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.post-card:hover .post-card-media img {
  transform: scale(1.05);
}

.post-card-media img.is-broken {
  display: none;
}

.post-card-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(9, 13, 24, 0.6);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.post-card-lock .icon {
  width: 14px;
  height: 14px;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 21px 22px 20px;
}

.post-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.post-card-category {
  color: var(--accent);
  font-weight: 650;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

a.post-card-category:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-card-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: none;
}

.post-card-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-card-title {
  font-size: 1.15rem;
  font-weight: 720;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.post-card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease), color 0.25s;
}

.post-card:hover .post-card-title a {
  color: var(--accent);
  background-size: 100% 1px;
}

.post-card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.75;
}

.post-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.post-card-reading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.post-card-reading .icon {
  width: 13px;
  height: 13px;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.post-card-tags span {
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
  transition: background-color 0.25s, color 0.25s, transform 0.3s var(--ease);
}

.post-card-arrow .icon {
  width: 13px;
  height: 13px;
}

.post-card:hover .post-card-arrow {
  background: var(--accent);
  color: var(--on-accent);
  transform: rotate(45deg);
}

/* Last odd card in a two-column grid becomes a wide horizontal card */
.post-grid > .post-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
}

.post-grid > .post-card:last-child:nth-child(odd) .post-card-media {
  width: 42%;
  aspect-ratio: auto;
  min-height: 240px;
  flex: none;
}

.post-grid > .post-card:last-child:nth-child(odd) .post-card-body {
  justify-content: center;
  padding: 26px 28px;
}

.post-grid > .post-card:last-child:nth-child(odd) .post-card-title {
  font-size: 1.3rem;
}

.post-grid > .post-card:last-child:nth-child(odd) .post-card-excerpt {
  -webkit-line-clamp: 2;
}

/* Compact cards (related posts) */
.post-card--compact {
  border-radius: var(--radius-md);
}

.post-card--compact .post-card-media,
.post-card--compact .post-card-excerpt,
.post-card--compact .post-card-tags {
  display: none;
}

.post-card--compact .post-card-body {
  gap: 10px;
  padding: 20px;
}

.post-card--compact .post-card-title {
  font-size: 0.98rem;
  line-height: 1.45;
}

.post-card--compact .post-card-foot {
  padding-top: 12px;
}

/* Cover art (gradient fallback) */
.cover-art {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 15%, hsl(calc(var(--hue, 240) + 30) 85% 90%), transparent 46%),
    radial-gradient(circle at 85% 90%, hsl(calc(var(--hue, 240) - 25) 75% 86%), transparent 52%),
    linear-gradient(135deg, hsl(var(--hue, 240) 58% 92%), hsl(calc(var(--hue, 240) + 42) 62% 95%));
}

[data-theme="dark"] .cover-art {
  background:
    radial-gradient(circle at 20% 15%, hsl(calc(var(--hue, 240) + 20) 48% 26%), transparent 48%),
    radial-gradient(circle at 85% 90%, hsl(calc(var(--hue, 240) - 20) 45% 22%), transparent 54%),
    linear-gradient(135deg, hsl(var(--hue, 240) 32% 15%), hsl(calc(var(--hue, 240) + 40) 32% 19%));
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 19px);
  mask-image: linear-gradient(120deg, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 62%);
  opacity: 0.32;
}

[data-theme="dark"] .cover-art::before {
  background-image: repeating-linear-gradient(115deg, rgba(148, 163, 184, 0.18) 0 1px, transparent 1px 19px);
}

.cover-art::after {
  content: "";
  position: absolute;
  right: -15%;
  bottom: -34%;
  z-index: 0;
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.06), 0 0 0 48px rgba(255, 255, 255, 0.045),
    0 0 0 78px rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .cover-art::after {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 0 0 20px rgba(148, 163, 184, 0.04), 0 0 0 48px rgba(148, 163, 184, 0.03),
    0 0 0 78px rgba(148, 163, 184, 0.02);
}

.cover-orb {
  position: absolute;
  z-index: 1;
  top: -22%;
  right: -12%;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.05) 68%);
  filter: blur(2px);
  opacity: 0.55;
}

[data-theme="dark"] .cover-orb {
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.18), transparent 68%);
}

.cover-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 30% 30%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000, transparent 72%);
  opacity: 0.32;
}

[data-theme="dark"] .cover-grid {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
}

.cover-word {
  position: absolute;
  left: 8%;
  bottom: 7%;
  z-index: 2;
  color: hsl(var(--hue, 240) 48% 27%);
  font-size: clamp(1.7rem, 3.4vw, 2.65rem);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.92;
  opacity: 0.82;
  text-transform: uppercase;
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-feature-media .cover-index {
  top: auto;
  left: auto;
  right: 16px;
  bottom: 13px;
}

[data-theme="dark"] .cover-word {
  color: hsl(var(--hue, 240) 65% 86%);
  opacity: 0.55;
}

.cover-index {
  position: absolute;
  top: 13px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: hsl(var(--hue, 240) 40% 30%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.cover-index span {
  font-size: 8px;
  letter-spacing: 0.18em;
  opacity: 0.6;
}

[data-theme="dark"] .cover-index {
  color: hsl(var(--hue, 240) 60% 82%);
}

.cover-glyph {
  position: absolute;
  right: 8%;
  top: 9%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: hsl(var(--hue, 240) 55% 32%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

[data-theme="dark"] .cover-glyph {
  background: rgba(9, 13, 24, 0.28);
  border-color: rgba(255, 255, 255, 0.12);
  color: hsl(var(--hue, 240) 65% 86%);
}

.cover-glyph .icon {
  width: 18px;
  height: 18px;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 46px;
}

.pagination a,
.pagination > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.pagination a:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}

.pagination .current {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.pagination .extend {
  gap: 6px;
}

.pagination .extend .icon {
  width: 15px;
  height: 15px;
}

.pagination .prev .icon {
  order: -1;
}

.pagination .next .icon {
  order: 1;
}

.pagination .space {
  border: 0;
  color: var(--muted-2);
  min-width: 20px;
  padding: 0;
}

.pagination .page-label {
  display: inline-flex;
}

/* ---------------------------------------------------------------
   9. Sidebar
   --------------------------------------------------------------- */
.home-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.side-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.side-card-head h3 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-card-head a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: color 0.2s;
}

.side-card-head a .icon {
  width: 12px;
  height: 12px;
}

.side-card-head a:hover {
  color: var(--accent);
}

.profile-card {
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 58%),
    var(--surface);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  padding: 3px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
  background: var(--surface);
}

.profile-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid var(--surface);
}

.profile-heading h3 {
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.profile-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.profile-bio {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.75;
}

.profile-location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.profile-location .icon {
  width: 14px;
  height: 14px;
}

.profile-socials {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.side-link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}

.side-link:hover .icon {
  transform: translateX(3px);
}

.category-mini-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.category-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.category-mini:hover {
  background: var(--accent-softer);
}

.category-mini-name {
  color: var(--text-soft);
  font-size: 12.8px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-mini:hover .category-mini-name {
  color: var(--accent);
}

.category-mini-count {
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.category-mini-bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.category-mini-bar span {
  display: block;
  height: 100%;
  width: var(--progress, 20%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.7;
}

.tag-cloud-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.side-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-soft);
  font-size: 12.8px;
  font-weight: 500;
  border-top: 1px solid var(--line);
}

.side-card--links .side-card-head + .side-link-row {
  border-top: 0;
}

.side-link-row .icon:last-child {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--muted-2);
}

.side-link-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}

.side-link-icon .icon {
  width: 15px;
  height: 15px;
}

.side-link-row:hover {
  color: var(--accent);
}

.side-link-row:hover .side-link-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------------------------------------------------------------
   10. Page hero
   --------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 54px) 0 clamp(44px, 6vw, 64px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(75% 90% at 12% 0%, var(--accent-soft), transparent 58%),
    radial-gradient(60% 80% at 92% 10%, rgba(6, 182, 212, 0.09), transparent 60%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.page-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, var(--bg) 100%);
}

.page-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.45;
}

[data-theme="dark"] .page-hero-orb {
  opacity: 0.35;
}

.page-hero-orb--1 {
  width: 340px;
  height: 340px;
  top: -180px;
  left: -60px;
  background: rgba(99, 102, 241, 0.45);
}

.page-hero-orb--2 {
  width: 300px;
  height: 300px;
  top: -120px;
  right: -40px;
  background: rgba(6, 182, 212, 0.3);
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 80% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 80% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.5;
}

.page-hero-inner {
  max-width: 980px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 500;
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-current="page"] {
  color: var(--text-soft);
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-hero .kicker {
  margin-top: 4px;
}

.page-hero-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.page-hero-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--line);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  flex: none;
}

.page-hero-icon .icon {
  width: 26px;
  height: 26px;
}

.page-hero-title {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.page-hero-subtitle {
  max-width: 660px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.page-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.page-hero .hero-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
}

.page-hero .hero-stat strong {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.page-hero .hero-stat span {
  font-size: 11px;
  color: var(--muted);
}

/* ---------------------------------------------------------------
   11. Footer
   --------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: clamp(56px, 7vw, 84px);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(70% 60% at 15% 0%, var(--accent-softer), transparent 60%),
    var(--surface-2);
}

.footer-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(30px, 4.5vw, 48px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(118deg, #4338ca 0%, #6d28d9 46%, #0891b2 105%);
  box-shadow: 0 36px 80px -34px rgba(67, 56, 202, 0.65);
  isolation: isolate;
}

.footer-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(48% 80% at 90% 0%, rgba(255, 255, 255, 0.24), transparent 60%),
    radial-gradient(40% 70% at 10% 110%, rgba(0, 0, 0, 0.28), transparent 60%);
}

.footer-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 100% at 80% 20%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 80% 20%, #000, transparent 75%);
}

.footer-cta .kicker {
  color: rgba(255, 255, 255, 0.72);
}

.footer-cta .kicker-dot {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.footer-cta h2 {
  margin-top: 12px;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -0.04em;
}

.footer-cta p {
  max-width: 520px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13.5px;
  line-height: 1.75;
}

.footer-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: none;
}

.footer-cta .btn-primary {
  background: #fff;
  color: #312e81;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
}

.footer-cta .btn-primary:hover {
  background: #fff;
  color: #312e81;
}

.footer-cta .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.footer-cta .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.75fr 0.75fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(44px, 6vw, 64px) 0 clamp(32px, 4vw, 44px);
}

.footer-brand .brand {
  font-size: 18px;
}

.footer-bio {
  max-width: 330px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.8;
}

.footer-socials {
  display: flex;
  gap: 5px;
  margin-top: 18px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h3 {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  width: fit-content;
  color: var(--text-soft);
  font-size: 12.8px;
  transition: color 0.2s, transform 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.footer-note-col p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.footer-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 11px;
  width: fit-content !important;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.footer-mini-link .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.footer-bottom p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.footer-bottom a {
  color: var(--text-soft);
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--muted-2);
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease), color 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.back-to-top .icon {
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------------
   Article rows (list-first editorial layout)
   --------------------------------------------------------------- */
.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 48px;
  gap: 22px;
  align-items: center;
  padding: 25px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s, padding-left 0.35s var(--ease);
}

.post-row::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}

.post-row:hover {
  background: var(--accent-softer);
  padding-left: 12px;
}

.post-row:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.post-row-index {
  align-self: start;
  padding-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.post-row-main {
  min-width: 0;
}

.post-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.post-row-category {
  color: var(--accent);
  font-weight: 650;
  font-size: 11px;
}

a.post-row-category:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-row-sep {
  color: var(--muted-2);
}

.post-row-reading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-row-reading .icon {
  width: 12px;
  height: 12px;
}

.post-row-lock {
  display: inline-flex;
  color: #d97706;
}

.post-row-lock .icon {
  width: 12px;
  height: 12px;
}

.post-row-title {
  margin: 8px 0 6px;
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.post-row-title a {
  display: inline;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.25s, background-size 0.35s var(--ease);
}

.post-row:hover .post-row-title a {
  color: var(--accent);
  background-size: 100% 1px;
}

.post-row-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 760px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.75;
}

.post-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.post-row-tags a {
  color: var(--muted-2);
  transition: color 0.2s;
}

.post-row-tags a:hover {
  color: var(--accent);
}

.post-row-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.post-row-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  transition: color 0.25s, background-color 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}

.post-row-arrow .icon {
  width: 14px;
  height: 14px;
}

.post-row:hover .post-row-arrow {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

.post-row--compact {
  grid-template-columns: 30px minmax(0, 1fr) 36px;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.post-row--compact .post-row-title {
  margin: 3px 0 0;
  font-size: 0.98rem;
}

.post-row--compact .post-row-excerpt,
.post-row--compact .post-row-tags {
  display: none;
}

.post-row--compact .post-row-index {
  font-size: 9px;
}

.related-list {
  border-top: 1px solid var(--line);
}

/* Minimal footer */
.site-footer {
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
}

.footer-minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.footer-minimal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.footer-minimal-nav a {
  color: var(--muted);
  font-size: 12px;
  transition: color 0.2s;
}

.footer-minimal-nav a:hover {
  color: var(--accent);
}


.footer-simple {
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.01em;
}

/* Compact left/right page layout for primary navigation pages */
.page-layout-section {
  padding-top: calc(var(--header-h) + clamp(26px, 4vw, 46px));
  padding-bottom: clamp(48px, 6vw, 72px);
}

.page-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(34px, 5vw, 76px);
  align-items: start;
}

.page-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  min-width: 0;
}

.page-breadcrumb {
  margin: 0 0 30px;
  font-size: 10px;
}

.page-sidebar .kicker {
  margin-bottom: 10px;
}

.page-side-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 14px;
}

.page-side-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--accent);
}

.page-side-icon .icon {
  width: 19px;
  height: 19px;
}

.page-side-title h1 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.page-side-desc {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-side-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.page-side-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-side-stats strong {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.page-side-stats span {
  color: var(--muted);
  font-size: 10px;
}

.page-side-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.2s;
}

.page-side-back:hover {
  color: var(--accent);
}

.page-side-back .icon {
  width: 13px;
  height: 13px;
}

.page-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.page-filter .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.page-filter input {
  width: 100%;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  outline: none;
}

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

.page-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-main .timeline {
  margin-top: 0;
}

.year-filter--side {
  margin: 22px 0 0;
  gap: 5px;
}

.year-filter--side .year-chip {
  padding: 4px 8px;
  font-size: 10px;
}

.category-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-grid--compact .category-card {
  min-height: 0;
  padding: 16px;
}

.category-grid--compact .category-card h2 {
  margin: 14px 0 8px;
  font-size: 1.02rem;
}

.category-grid--compact .category-card-posts li {
  font-size: 10.5px;
}

.page-main .tag-cloud-large {
  padding-top: 4px;
}

.page-main .page-prose {
  max-width: 860px;
}

@media (max-width: 980px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .page-sidebar {
    position: static;
  }

  .page-breadcrumb {
    margin-bottom: 20px;
  }

  .page-side-title {
    margin: 8px 0 10px;
  }

  .page-side-desc {
    max-width: 640px;
  }

  .page-side-stats {
    margin-top: 18px;
  }

  .page-filter {
    max-width: 420px;
  }

  .category-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .page-layout-section {
    padding-top: calc(var(--header-h) + 24px);
  }

  .page-side-title h1 {
    font-size: 1.9rem;
  }

  .page-side-icon {
    width: 38px;
    height: 38px;
  }

  .page-side-stats {
    gap: 16px;
  }

  .page-side-stats strong {
    font-size: 1.15rem;
  }

  .category-grid--compact {
    grid-template-columns: 1fr;
  }

  .page-main-head {
    font-size: 9px;
  }
}
