/* =========================================================
   TheTechWide — editorial tech theme
   ========================================================= */

:root {
  --font-display: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #f6f8fc;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e7ecf6;
  --text: #0b1222;
  --text-soft: #35415a;
  --muted: #64708a;
  --border: #e1e7f1;
  --border-strong: #cad4e5;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-2: #0891b2;
  --brand-soft: #eef0ff;
  --brand-soft-2: rgba(79, 70, 229, 0.08);
  --accent: #f59e0b;
  --success: #059669;
  --header-bg: rgba(255, 255, 255, 0.86);
  --footer-bg: #080d19;
  --shadow-sm: 0 1px 2px rgba(13, 18, 32, 0.04);
  --shadow: 0 16px 40px -20px rgba(13, 18, 32, 0.25);
  --shadow-lg: 0 30px 70px -30px rgba(13, 18, 32, 0.4);
  --radius: 18px;
  --radius-lg: 24px;
  --container: 1200px;
  --header-height: 76px;
}

[data-theme='dark'] {
  --bg: #070b15;
  --bg-soft: #0a101d;
  --surface: #0d1424;
  --surface-2: #121b2e;
  --surface-3: #19243b;
  --text: #eef3ff;
  --text-soft: #c2cce0;
  --muted: #94a1ba;
  --border: #1c2740;
  --border-strong: #2d3b5a;
  --brand: #818cf8;
  --brand-strong: #a5b4fc;
  --brand-2: #22d3ee;
  --brand-soft: #181e3a;
  --brand-soft-2: rgba(129, 140, 248, 0.1);
  --header-bg: rgba(7, 11, 21, 0.88);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(79, 70, 229, 0.08), transparent 65%),
    radial-gradient(900px 480px at 100% 0%, rgba(8, 145, 178, 0.06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[data-theme='dark'] body {
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(99, 102, 241, 0.12), transparent 65%),
    radial-gradient(900px 480px at 100% 0%, rgba(34, 211, 238, 0.06), transparent 60%),
    var(--bg);
}

body.menu-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.2;
}

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: -80px;
  left: 18px;
  z-index: 999;
  padding: 12px 18px;
  color: #fff;
  background: var(--brand);
  border-radius: 10px;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), #6d28d9 55%, var(--brand-2));
  box-shadow: 0 10px 24px -12px rgba(79, 70, 229, 0.8);
}

.btn-light {
  color: #0b1222;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-light:hover {
  background: #f0f3fb;
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  transition: gap 0.18s ease, color 0.18s ease;
}

.text-link:hover {
  gap: 9px;
  color: var(--brand-strong);
}

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

/* =========================================================
   Top bar & header
   ========================================================= */

.topbar {
  background: #080d19;
  color: #9aa8c3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 38px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.topbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c3cee2;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}

.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar-date .icon {
  width: 13px;
  height: 13px;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.02);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 30px -18px rgba(10, 15, 30, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.8);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.brand-text strong span {
  background: linear-gradient(100deg, var(--brand), #7c3aed 45%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  margin-top: 1px;
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.main-nav {
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.16s ease, background 0.16s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.main-nav a.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

.theme-toggle .theme-moon {
  display: none;
}

[data-theme='dark'] .theme-toggle .theme-sun {
  display: none;
}

[data-theme='dark'] .theme-toggle .theme-moon {
  display: inline-flex;
}

.menu-toggle {
  display: none;
}

.menu-icon-close {
  display: none;
}

.menu-toggle[aria-expanded='true'] .menu-icon-open {
  display: none;
}

.menu-toggle[aria-expanded='true'] .menu-icon-close {
  display: inline-flex;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 40px -28px rgba(10, 15, 30, 0.4);
}

.mobile-nav > nav {
  padding-block: 18px 24px;
}

.mobile-nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface-2);
}

.mobile-nav-links a.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.mobile-nav-links .icon {
  width: 15px;
  height: 15px;
  opacity: 0.5;
}

.mobile-search-link {
  width: 100%;
  margin-top: 14px;
}

.mobile-nav-foot {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

/* =========================================================
   Category chips & badges
   ========================================================= */

.cat-ai {
  --cat: #7c3aed;
  --cat-bg: rgba(124, 58, 237, 0.1);
  --cat-border: rgba(124, 58, 237, 0.25);
}

.cat-gadget {
  --cat: #2563eb;
  --cat-bg: rgba(37, 99, 235, 0.1);
  --cat-border: rgba(37, 99, 235, 0.25);
}

.cat-tips {
  --cat: #059669;
  --cat-bg: rgba(5, 150, 105, 0.1);
  --cat-border: rgba(5, 150, 105, 0.25);
}

.cat-security {
  --cat: #e11d48;
  --cat-bg: rgba(225, 29, 72, 0.1);
  --cat-border: rgba(225, 29, 72, 0.25);
}

[data-theme='dark'] .cat-ai {
  --cat: #c4b5fd;
  --cat-bg: rgba(139, 92, 246, 0.16);
  --cat-border: rgba(196, 181, 253, 0.24);
}

[data-theme='dark'] .cat-gadget {
  --cat: #93c5fd;
  --cat-bg: rgba(59, 130, 246, 0.16);
  --cat-border: rgba(147, 197, 253, 0.24);
}

[data-theme='dark'] .cat-tips {
  --cat: #6ee7b7;
  --cat-bg: rgba(16, 185, 129, 0.15);
  --cat-border: rgba(110, 231, 183, 0.24);
}

[data-theme='dark'] .cat-security {
  --cat: #fda4af;
  --cat-bg: rgba(244, 63, 94, 0.16);
  --cat-border: rgba(253, 164, 175, 0.24);
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 10px;
  color: var(--cat);
  background: var(--cat-bg);
  border: 1px solid var(--cat-border);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.cat-chip .icon {
  width: 13px;
  height: 13px;
}

a.cat-chip:hover {
  filter: brightness(1.08);
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.cat-dot-ai {
  background: #8b5cf6;
}

.cat-dot-gadget {
  background: #3b82f6;
}

.cat-dot-tips {
  background: #10b981;
}

.cat-dot-security {
  background: #f43f5e;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  flex: 0 0 auto;
}

/* =========================================================
   Home intro
   ========================================================= */

.home-head {
  padding: 54px 0 30px;
}

.home-head .kicker {
  margin-bottom: 12px;
}

.home-title {
  max-width: 930px;
  margin-bottom: 16px;
  font-size: clamp(2.15rem, 4.6vw, 3.55rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.home-title span {
  background: linear-gradient(100deg, var(--brand), #7c3aed 45%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-lead {
  max-width: 660px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 500;
}

.home-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--brand);
}

/* =========================================================
   Layout & sidebar
   ========================================================= */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 38px;
  align-items: start;
}

.layout--post {
  gap: 44px;
  padding-top: 0;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.widget {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.widget-head h2 {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.widget-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.widget-badge .icon {
  width: 11px;
  height: 11px;
}

.widget-link {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brand);
}

.widget-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.widget-about {
  background:
    radial-gradient(500px 200px at 100% 0%, var(--brand-soft-2), transparent 70%),
    var(--surface);
}

.widget-about-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.widget-about-head img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.widget-about-head h2 {
  margin: 2px 0 0;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
}

.widget-about p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.sidebar-search {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sidebar-search input {
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 0.8rem;
}

.sidebar-search input::placeholder {
  color: var(--muted);
}

.sidebar-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

.sidebar-search button .icon {
  width: 17px;
  height: 17px;
}

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: picks;
}

.pick-list li {
  display: grid;
  grid-template-columns: 20px 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.pick-number {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
  opacity: 0.65;
}

.pick-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pick-list li:hover .pick-thumb img {
  transform: scale(1.06);
}

.pick-copy {
  min-width: 0;
}

.pick-copy a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.16s ease;
}

.pick-copy a:hover {
  color: var(--brand);
}

.pick-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.cat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-list li + li {
  border-top: 1px solid var(--border);
}

.cat-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.16s ease;
}

.cat-list a:hover {
  color: var(--brand);
}

.cat-list .cat-count {
  margin-left: auto;
  padding: 1px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 600;
}

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

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.5;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.tag-chip:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand-soft);
}

.widget-rss {
  position: relative;
  overflow: hidden;
  color: #e8edf8;
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(34, 211, 238, 0.28), transparent 65%),
    linear-gradient(145deg, #101a34, #0a1020 60%, #12102b);
  border-color: rgba(255, 255, 255, 0.1);
}

.widget-rss .kicker {
  color: #7dd3fc;
}

.widget-rss h2 {
  margin: 6px 0 8px;
  max-width: 230px;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.widget-rss p {
  margin-bottom: 14px;
  color: #9fadc6;
  font-size: 0.78rem;
  line-height: 1.6;
}

.widget-rss .btn {
  width: 100%;
}

.rss-orb {
  position: absolute;
  top: -18px;
  right: -14px;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 50%;
  opacity: 0.7;
}

.rss-orb .icon {
  width: 44px;
  height: 44px;
}

/* TOC */
.widget-toc {
  padding-bottom: 16px;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
}

.toc-item a {
  display: block;
  padding: 5px 0 5px 13px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.toc-item a:hover,
.toc-item a.is-active {
  color: var(--brand);
  border-left-color: var(--brand);
}

.toc-level-3 a {
  padding-left: 26px;
  font-size: 0.72rem;
}

/* =========================================================
   Hero & cards
   ========================================================= */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(245px, 0.78fr);
  gap: 20px;
  align-items: stretch;
}

.hero-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 440px;
  overflow: hidden;
  color: #fff;
  background: #0a1020;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.hero-card:hover .hero-media img {
  transform: scale(1.035);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 9, 19, 0.05) 0%, rgba(5, 9, 19, 0.28) 44%, rgba(5, 9, 19, 0.94) 100%),
    linear-gradient(90deg, rgba(5, 9, 19, 0.4), transparent 65%);
}

.hero-content {
  position: relative;
  width: 100%;
  padding: 30px 30px 28px;
}

.hero-card .cat-chip {
  color: #fff;
  background: rgba(8, 13, 25, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-title {
  max-width: 560px;
  margin: 12px 0 10px;
  color: #fff;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.hero-title a:hover {
  color: #c7d2fe;
}

.hero-excerpt {
  display: -webkit-box;
  max-width: 520px;
  margin-bottom: 14px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(236, 242, 255, 0.78);
  font-size: 0.88rem;
  line-height: 1.65;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.7rem;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-row .icon {
  width: 13px;
  height: 13px;
}

.meta-row--light {
  color: rgba(226, 234, 250, 0.65);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mini-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mini-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.mini-card-media {
  position: relative;
  display: block;
  height: 146px;
  overflow: hidden;
  background: var(--surface-2);
}

.mini-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mini-card:hover .mini-card-media img {
  transform: scale(1.045);
}

.mini-card-media .cat-chip {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: #fff;
  background: rgba(6, 11, 22, 0.6);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.mini-card-body {
  padding: 14px 16px 16px;
}

.mini-card-body h3 {
  margin-bottom: 7px;
  font-size: 0.94rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.mini-card-body h3 a:hover {
  color: var(--brand);
}

.mini-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.66rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 42px 0 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-mark {
  width: 5px;
  height: 21px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.section-title h2 {
  margin: 0;
  font-size: 1.32rem;
  letter-spacing: -0.035em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

.post-card-media .cat-chip {
  position: absolute;
  bottom: 12px;
  left: 12px;
  color: #fff;
  background: rgba(6, 11, 22, 0.6);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(9px);
}

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

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}

.post-card-title {
  margin: 8px 0 8px;
  font-size: 1.13rem;
  line-height: 1.34;
  letter-spacing: -0.027em;
}

.post-card-title a {
  transition: color 0.16s ease;
}

.post-card-title a:hover {
  color: var(--brand);
}

.post-card-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.62;
}

.post-card--compact .post-card-body {
  padding: 14px 15px 16px;
}

.post-card--compact .post-card-title {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.post-card--compact .post-card-media .cat-chip {
  bottom: 8px;
  left: 8px;
  font-size: 0.58rem;
  padding: 4px 7px;
}

/* =========================================================
   Pagination
   ========================================================= */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 38px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.77rem;
  font-weight: 600;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.page-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.page-btn.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.page-btn--text {
  gap: 4px;
  padding-inline: 11px;
  font-size: 0.72rem;
  font-weight: 500;
}

.page-btn--text .icon {
  width: 14px;
  height: 14px;
}

.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* =========================================================
   Post page
   ========================================================= */

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 220;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #a855f7, var(--brand-2));
  transform: scaleX(0);
  transform-origin: left center;
}

.post {
  min-width: 0;
}

.breadcrumbs {
  margin: 26px 0 18px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.7rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--border-strong);
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.post-header h1 {
  max-width: 820px;
  margin: 15px 0 14px;
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.post-excerpt {
  max-width: 730px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.author-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #7c3aed 55%, #06b6d4);
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 16px -10px rgba(79, 70, 229, 0.8);
}

.author-mini-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.author-mini-copy strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.author-mini-copy time {
  color: var(--muted);
  font-size: 0.68rem;
}

.post-meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.71rem;
}

.post-meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-meta-info .icon {
  width: 14px;
  height: 14px;
}

.share-links {
  display: flex;
  align-items: center;
  gap: 5px;
}

.share-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.share-label .icon {
  width: 13px;
  height: 13px;
}

.share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.share-btn .icon {
  width: 15px;
  height: 15px;
}

.share-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.share-btn--x:hover {
  color: #fff;
  background: #0b1222;
  border-color: #0b1222;
}

.share-btn--wa:hover {
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
}

.share-btn[data-copied='true'] {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.share-btn[data-copied='true']::after {
  content: 'Tersalin';
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 3px 7px;
  color: #fff;
  background: #0b1222;
  border-radius: 5px;
  font-size: 0.6rem;
  line-height: 1.4;
  white-space: nowrap;
  transform: translateX(-50%);
}

.post-cover {
  margin: 0 0 28px;
}

.post-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.post-cover figcaption {
  margin-top: 8px;
  padding-left: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.toc-mobile {
  display: none;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toc-mobile summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.toc-mobile summary::-webkit-details-marker {
  display: none;
}

.toc-mobile summary .icon:first-child {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.toc-mobile summary .icon:last-child {
  margin-left: auto;
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.toc-mobile[open] summary .icon:last-child {
  transform: rotate(180deg);
}

.toc-mobile .toc-list {
  margin: 0 16px;
  padding-bottom: 14px;
}

.post-body {
  max-width: 770px;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.86;
}

.post-body > p:first-child {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.8;
}

.post-body p {
  margin: 0 0 1.25em;
}

.post-body h2 {
  margin: 2em 0 0.65em;
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
}

.post-body h3 {
  margin: 1.7em 0 0.5em;
  font-size: 1.13rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.post-body h2 + p,
.post-body h3 + p {
  margin-top: 0;
}

.heading-anchor {
  margin-left: 0.25em;
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.post-body h2:hover .heading-anchor,
.post-body h3:hover .heading-anchor {
  opacity: 0.55;
}

.post-body a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.16s ease;
}

[data-theme='dark'] .post-body a {
  text-decoration-color: rgba(129, 140, 248, 0.35);
}

.post-body a:hover {
  text-decoration-color: currentColor;
}

.post-body strong {
  color: var(--text);
  font-weight: 650;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.35em;
  padding-left: 1.3em;
}

.post-body li {
  margin: 0.42em 0;
  padding-left: 0.15em;
}

.post-body li::marker {
  color: var(--brand);
  font-weight: 600;
}

.post-body blockquote {
  margin: 1.6em 0;
  padding: 16px 20px;
  color: var(--text);
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body code {
  padding: 0.15em 0.4em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.post-body pre {
  margin: 1.5em 0;
  padding: 18px;
  overflow-x: auto;
  color: #dce6ff;
  background: #0b1120;
  border: 1px solid #1d2942;
  border-radius: 13px;
  font-size: 0.82rem;
  line-height: 1.65;
}

.post-body pre code {
  padding: 0;
  color: inherit;
  background: none;
  font-size: inherit;
}

.post-body hr {
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.post-body table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.post-body th,
.post-body td {
  padding: 9px 11px;
  text-align: left;
  border: 1px solid var(--border);
}

.post-body th {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.post-tags {
  max-width: 770px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.post-tags-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-tags-label .icon {
  width: 14px;
  height: 14px;
}

.post-tags .tag-cloud {
  gap: 7px;
}

.post-tags .tag-chip {
  padding: 5px 10px;
  font-size: 0.7rem;
}

.post-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 770px;
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.post-share-row > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.author-box {
  display: flex;
  gap: 15px;
  max-width: 770px;
  margin-top: 30px;
  padding: 20px;
  background:
    radial-gradient(400px 180px at 100% 0%, var(--brand-soft-2), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.author-box .avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 15px;
  font-size: 0.9rem;
}

.author-box h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.author-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.author-box .text-link {
  margin-top: 7px;
  font-size: 0.72rem;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 770px;
  margin-top: 30px;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.post-nav a:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.post-nav span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-nav span .icon {
  width: 12px;
  height: 12px;
}

.post-nav strong {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-nav .post-nav-next {
  text-align: right;
}

.post-nav .post-nav-next span {
  justify-content: flex-end;
}

.related-section {
  max-width: 770px;
  margin-top: 42px;
}

.related-section .section-head {
  margin: 0 0 16px;
}

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

.related-grid .post-card-title {
  font-size: 0.86rem;
}

/* =========================================================
   Category / tag / archive headers
   ========================================================= */

.archive-hero {
  position: relative;
  overflow: hidden;
  padding: 8px 0 38px;
  background:
    linear-gradient(160deg, var(--cat-soft, var(--brand-soft)), transparent 62%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.archive-hero::after {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 380px;
  height: 380px;
  background: var(--cat-color, var(--brand));
  border-radius: 50%;
  opacity: 0.07;
  filter: blur(10px);
  pointer-events: none;
}

.archive-hero .breadcrumbs {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.archive-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.archive-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  color: var(--cat-color, var(--brand));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.archive-icon .icon {
  width: 28px;
  height: 28px;
}

.archive-hero h1 {
  margin: 5px 0 9px;
  font-size: clamp(2rem, 4vw, 2.85rem);
  letter-spacing: -0.05em;
}

.archive-hero p {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.7rem;
}

.archive-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.archive-meta .icon {
  width: 13px;
  height: 13px;
}

.archive-hero--tag {
  padding-bottom: 30px;
}

.archive-hero--tag .archive-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
}

.archive-hero--tag h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.archive-body {
  padding-top: 30px;
}

.archive-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.74rem;
}

.archive-count strong {
  color: var(--text);
  font-weight: 600;
}

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

.archive-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.archive-item time {
  color: var(--muted);
  font-size: 0.69rem;
}

.archive-item h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.archive-item h3 a:hover {
  color: var(--brand);
}

.archive-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.archive-item .cat-chip {
  font-size: 0.6rem;
}

.archive-month {
  margin: 32px 0 8px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.archive-month:first-child {
  margin-top: 3px;
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state .icon {
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  color: var(--brand);
}

.empty-state h2 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.82rem;
}

.tags-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tags-index-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 0.79rem;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.tags-index-link:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.tags-index-link span {
  padding: 1px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.64rem;
}

/* =========================================================
   Static pages / prose
   ========================================================= */

.page-hero {
  padding: 42px 0 36px;
  background:
    radial-gradient(700px 280px at 15% 0%, var(--brand-soft-2), transparent 70%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.page-hero .breadcrumbs {
  margin-top: 0;
}

.page-hero h1 {
  max-width: 780px;
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4vw, 2.9rem);
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.page-hero-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.7rem;
}

.page-body {
  padding: 36px 0 0;
}

.prose {
  max-width: 770px;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.85;
}

.prose > p:first-child {
  font-size: 1.08rem;
  color: var(--text);
}

.prose h2 {
  margin: 1.9em 0 0.6em;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin: 1.5em 0 0.5em;
  font-size: 1.08rem;
}

.prose p {
  margin-bottom: 1.15em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.4em 0;
}

.prose li::marker {
  color: var(--brand);
  font-weight: 600;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(79, 70, 229, 0.3);
}

.prose strong {
  color: var(--text);
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-card strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
}

.contact-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* =========================================================
   Search
   ========================================================= */

.search-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: 84vh;
  margin: 9vh auto auto;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-dialog::backdrop {
  background: rgba(4, 8, 18, 0.65);
  backdrop-filter: blur(6px);
}

.search-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
}

.search-dialog-head h2 {
  margin: 4px 0 0;
  font-size: 1.28rem;
  letter-spacing: -0.04em;
}

.search-dialog-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.search-field-icon {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.search-dialog-form input {
  flex: 1;
  min-width: 0;
  padding: 17px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 0.96rem;
}

.search-dialog-form input::placeholder {
  color: var(--muted);
}

.search-dialog-form kbd {
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.65rem;
}

.search-results {
  max-height: 46vh;
  min-height: 120px;
  overflow-y: auto;
  padding: 8px;
}

.search-hint {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-result-item {
  display: block;
  padding: 11px 13px;
  border-radius: 11px;
  transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: var(--surface-2);
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.65rem;
}

.search-result-meta .cat-name {
  color: var(--cat, var(--brand));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search-result-item h3 {
  margin: 3px 0 2px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.search-result-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  color: var(--muted);
  font-size: 0.73rem;
}

.search-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.67rem;
}

.search-dialog-foot span,
.search-dialog-foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.search-dialog-foot a {
  color: var(--brand);
  font-weight: 600;
}

.search-dialog-foot .icon {
  width: 12px;
  height: 12px;
}

.search-page > .container {
  padding-top: 34px;
}

.search-page-form {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.search-page-form .icon {
  width: 20px;
  height: 20px;
  margin-left: 10px;
  align-self: center;
  color: var(--brand);
}

.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 2px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1rem;
}

.search-page-form button {
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.search-page-results {
  margin-top: 22px;
}

.search-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.77rem;
}

.search-results-summary strong {
  color: var(--text);
}

.search-page-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-page-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.search-page-item:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.search-page-thumb {
  overflow: hidden;
  border-radius: 9px;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}

.search-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-page-item h3 {
  margin: 2px 0 5px;
  font-size: 1rem;
  line-height: 1.4;
}

.search-page-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.search-page-item .search-result-meta {
  margin-bottom: 2px;
}

.search-suggestions {
  margin-top: 26px;
}

.search-suggestions h2 {
  margin-bottom: 10px;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  position: relative;
  margin-top: 76px;
  color: #a4b0c7;
  background:
    radial-gradient(700px 300px at 15% 0%, rgba(79, 70, 229, 0.18), transparent 68%),
    radial-gradient(600px 280px at 100% 0%, rgba(8, 145, 178, 0.1), transparent 65%),
    var(--footer-bg);
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.6), rgba(34, 211, 238, 0.5), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr 1fr 1.5fr;
  gap: 42px;
  padding: 52px 0 40px;
}

.footer-brand .brand-text strong {
  color: #fff;
}

.footer-brand .brand-text small {
  color: #71809c;
}

.footer-brand p {
  max-width: 320px;
  margin: 16px 0 16px;
  color: #8e9bb4;
  font-size: 0.81rem;
  line-height: 1.7;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #aab7cc;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.social-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.social-link .icon {
  width: 16px;
  height: 16px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
  padding: 5px 9px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.16);
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 500;
}

.footer-badge .icon {
  width: 12px;
  height: 12px;
}

.footer-col h3 {
  margin: 0 0 13px;
  color: #edf2ff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin: 7px 0;
}

.footer-col a {
  color: #9daac1;
  font-size: 0.79rem;
  transition: color 0.16s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-connect p {
  margin: 0 0 14px;
  color: #8e9bb4;
  font-size: 0.78rem;
  line-height: 1.65;
}

.footer-connect .btn {
  font-size: 0.75rem;
  min-height: 38px;
  padding: 8px 14px;
}

.footer-mail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: #9daac1;
  font-size: 0.75rem;
  word-break: break-all;
}

.footer-mail:hover {
  color: #fff;
}

.footer-mail .icon {
  width: 14px;
  height: 14px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #73819b;
  font-size: 0.69rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: 7px;
  align-items: center;
}

.footer-legal a:hover {
  color: #fff;
}

/* =========================================================
   Back to top
   ========================================================= */

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 12px 30px -12px rgba(79, 70, 229, 0.8);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1120px) {
  .container {
    width: min(var(--container), calc(100% - 40px));
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
  }

  .brand-text small {
    display: none;
  }

  .main-nav a {
    padding-inline: 10px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(230px, 0.8fr);
  }

  .hero-content {
    padding: 24px;
  }

  .mini-card-media {
    height: 132px;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .sidebar .widget-toc {
    display: none;
  }

  .toc-mobile {
    display: block;
  }

  .widget-rss,
  .widget-about {
    grid-column: auto;
  }

  .hero-card {
    min-height: 410px;
  }

  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-nav {
    display: block;
  }

  .header-inner {
    gap: 14px;
  }

  .header-actions {
    margin-left: auto;
  }

  .archive-hero-inner {
    gap: 16px;
  }

  .footer-grid {
    grid-template-columns: 1.7fr 1fr 1.3fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-brand p {
    max-width: 470px;
  }
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 34px);
  }

  .topbar-date {
    display: none;
  }

  .home-head {
    padding-top: 38px;
  }

  .home-title {
    font-size: clamp(2rem, 8.5vw, 2.8rem);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    min-height: 390px;
  }

  .hero-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-card-media {
    height: 150px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

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

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

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav .post-nav-next {
    text-align: left;
  }

  .post-nav .post-nav-next span {
    justify-content: flex-start;
  }

  .post-meta-row {
    align-items: flex-start;
  }

  .post-meta-info {
    order: 3;
    width: 100%;
  }

  .post-share-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination .page-btn--text {
    order: 2;
  }

  .page-numbers {
    order: 1;
    width: 100%;
    justify-content: center;
  }

  .archive-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .archive-item .cat-chip {
    grid-column: 2;
    width: fit-content;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 42px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .search-page-item {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .archive-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
  }

  .archive-icon .icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    grid-template-columns: 1fr;
  }

  .home-meta span:nth-child(3) {
    display: none;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .mini-card-media {
    height: 170px;
  }

  .hero-content {
    padding: 20px;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-excerpt {
    -webkit-line-clamp: 3;
    font-size: 0.82rem;
  }

  .section-head {
    margin-top: 34px;
  }

  .section-title h2 {
    font-size: 1.16rem;
  }

  .post-card-body {
    padding: 17px 17px 19px;
  }

  .post-card-title {
    font-size: 1.08rem;
  }

  .post-header h1 {
    font-size: clamp(1.75rem, 7.4vw, 2.3rem);
  }

  .post-excerpt {
    font-size: 0.92rem;
  }

  .post-body {
    font-size: 0.97rem;
    line-height: 1.82;
  }

  .post-body > p:first-child {
    font-size: 1.03rem;
  }

  .post-body h2 {
    font-size: 1.32rem;
  }

  .post-cover img {
    border-radius: 15px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-grid .post-card {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .related-grid .post-card-media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 120px;
  }

  .archive-hero {
    padding-bottom: 30px;
  }

  .archive-hero h1 {
    font-size: 1.9rem;
  }

  .archive-icon {
    display: none;
  }

  .tags-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding-top: 30px;
  }

  .prose {
    font-size: 0.95rem;
  }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-page-item {
    grid-template-columns: 1fr;
  }

  .search-page-thumb {
    display: none;
  }

  .search-dialog {
    margin-top: 4vh;
    max-height: 92vh;
  }

  .search-dialog-head {
    padding: 18px 18px 14px;
  }

  .search-dialog-form {
    padding-inline: 16px;
  }

  .search-dialog-form input {
    padding: 14px 0;
  }

  .search-dialog-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 10px 16px;
  }

  .search-results {
    max-height: 54vh;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-brand {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 28px);
  }

  .topbar {
    display: none;
  }

  .header-inner {
    min-height: 66px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand-text strong {
    font-size: 1.1rem;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .header-actions {
    gap: 2px;
  }

  .home-head {
    padding-top: 30px;
  }

  .home-title {
    font-size: 1.95rem;
  }

  .hero-card {
    min-height: 360px;
  }

  .hero-content {
    padding: 18px;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .section-head .text-link {
    font-size: 0.72rem;
  }

  .post-meta-row {
    gap: 12px;
  }

  .post-meta-info {
    font-size: 0.68rem;
  }

  .share-links {
    margin-left: auto;
  }

  .share-label {
    display: none;
  }

  .post-cover figcaption {
    font-size: 0.64rem;
  }

  .post-tags .tag-chip {
    font-size: 0.67rem;
    padding: 4px 8px;
  }

  .post-share-row {
    padding: 12px;
  }

  .author-box {
    flex-direction: column;
    gap: 10px;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .archive-item .cat-chip {
    grid-column: auto;
    margin-top: 4px;
  }

  .archive-item time {
    order: -1;
  }

  .page-btn {
    min-width: 34px;
    height: 34px;
    font-size: 0.72rem;
  }

  .page-btn--text {
    font-size: 0.68rem;
    padding-inline: 8px;
  }

  .footer-grid {
    padding-top: 34px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

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