body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.20), transparent 24rem),
    radial-gradient(circle at 86% 8%, rgba(124, 58, 237, 0.18), transparent 26rem),
    linear-gradient(180deg, #f8fafc 0%, #eef6ff 42%, #f8fafc 100%);
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.88;
  background:
    linear-gradient(rgba(15, 23, 42, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.052) 1px, transparent 1px),
    radial-gradient(circle at 18% 28%, rgba(91, 108, 255, 0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 66%, rgba(20, 184, 166, 0.26) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 24%, rgba(124, 58, 237, 0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 72%, rgba(14, 165, 233, 0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.55), transparent 28rem);
  background-size:
    44px 44px,
    44px 44px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.28) 62%, rgba(0, 0, 0, 0.14));
  animation: ai-grid-drift 26s linear infinite, ai-node-pulse 8s ease-in-out infinite alternate;
}

body::after {
  opacity: 0.78;
  background:
    linear-gradient(118deg, transparent 0 17%, rgba(91, 108, 255, 0.12) 17.18%, transparent 17.8% 43%, rgba(20, 184, 166, 0.11) 43.18%, transparent 43.8% 100%),
    linear-gradient(62deg, transparent 0 23%, rgba(14, 165, 233, 0.11) 23.18%, transparent 23.85% 71%, rgba(124, 58, 237, 0.10) 71.18%, transparent 71.8% 100%),
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.46) 48%, transparent 54% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.72), transparent 42rem);
  background-size: 140% 140%, 150% 150%, 180% 100%, 100% 100%;
  filter: saturate(1.08);
  animation: ai-signal-sweep 18s ease-in-out infinite alternate, ai-halo-breathe 10s ease-in-out infinite;
}

body > main,
body > footer {
  position: relative;
  z-index: 1;
}

.article-card img,
.timeline-entry img,
article img {
  background: rgba(226, 232, 240, 0.45);
}

.site-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #475569;
  transition: color 180ms ease;
}

.site-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b6cff, #7c3aed);
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-nav-link:hover {
  color: #5b6cff;
}

.site-nav-link-active {
  color: #0f172a;
}

.site-nav-link-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-nav-link-mobile {
  display: block;
  border-radius: 0.75rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #334155;
  transition: background-color 180ms ease, color 180ms ease;
}

.site-nav-link-mobile:hover {
  color: #5b6cff;
}

.site-nav-link-mobile.site-nav-link-active {
  background: rgba(91, 108, 255, 0.10);
  color: #4338ca;
}

.dark body {
  background:
    radial-gradient(circle at 16% 10%, rgba(34, 211, 238, 0.20), transparent 26rem),
    radial-gradient(circle at 84% 10%, rgba(124, 58, 237, 0.24), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #08111f 48%, #020617 100%);
}

.dark body::before {
  opacity: 0.95;
  background:
    linear-gradient(rgba(148, 163, 184, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.075) 1px, transparent 1px),
    radial-gradient(circle at 18% 28%, rgba(34, 211, 238, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 66%, rgba(45, 212, 191, 0.34) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 24%, rgba(139, 92, 246, 0.36) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 72%, rgba(56, 189, 248, 0.34) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 48%, rgba(15, 23, 42, 0.18), transparent 28rem);
  background-size:
    46px 46px,
    46px 46px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.42) 64%, rgba(0, 0, 0, 0.16));
}

.dark body::after {
  opacity: 0.86;
  background:
    linear-gradient(118deg, transparent 0 18%, rgba(34, 211, 238, 0.18) 18.2%, transparent 18.85% 42%, rgba(45, 212, 191, 0.16) 42.2%, transparent 42.85% 100%),
    linear-gradient(62deg, transparent 0 24%, rgba(56, 189, 248, 0.15) 24.2%, transparent 24.85% 72%, rgba(139, 92, 246, 0.18) 72.2%, transparent 72.85% 100%),
    linear-gradient(90deg, transparent 0 44%, rgba(34, 211, 238, 0.10) 48%, transparent 54% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.16), transparent 42rem);
  background-size: 140% 140%, 150% 150%, 180% 100%, 100% 100%;
}

@keyframes ai-grid-drift {
  0% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
  100% {
    background-position:
      44px 44px,
      44px 44px,
      2.5rem -1.5rem,
      -2rem 2.75rem,
      1.5rem 2rem,
      -2.5rem -2rem,
      0 0;
  }
}

@keyframes ai-node-pulse {
  0% {
    opacity: 0.66;
    filter: saturate(0.92);
  }
  100% {
    opacity: 0.96;
    filter: saturate(1.28);
  }
}

@keyframes ai-signal-sweep {
  0% {
    background-position: 0% 0%, 100% 0%, -50% 0%, 0 0;
    transform: translate3d(-1.2rem, 0, 0);
  }
  100% {
    background-position: 100% 22%, 0% 18%, 120% 0%, 0 0;
    transform: translate3d(1.2rem, 0, 0);
  }
}

@keyframes ai-halo-breathe {
  0%,
  100% {
    filter: saturate(1.02) brightness(1);
  }
  50% {
    filter: saturate(1.22) brightness(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

.dark .site-nav-link {
  color: #cbd5e1;
}

.dark .site-nav-link:hover,
.dark .site-nav-link-active {
  color: #f8fafc;
}

.dark .site-nav-link::after {
  background: linear-gradient(90deg, #6d5efc, #8b5cf6);
}

.dark .site-nav-link-mobile {
  color: #e2e8f0;
}

.dark .site-nav-link-mobile:hover {
  color: #c4b5fd;
}

.dark .site-nav-link-mobile.site-nav-link-active {
  background: rgba(124, 58, 237, 0.18);
  color: #ddd6fe;
}

.article-body h2 {
  scroll-margin-top: 5.75rem;
  margin-top: 2.25rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #0f172a;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.article-body h2::after {
  content: '';
  display: block;
  width: 4rem;
  height: 2px;
  margin-top: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b6cff, rgba(91, 108, 255, 0));
}

.dark .article-body h2 {
  color: #f8fafc;
  border-bottom-color: rgba(71, 85, 105, 0.52);
}

.dark .article-body h2::after {
  background: linear-gradient(90deg, #8b5cf6, rgba(139, 92, 246, 0));
}

.article-body p {
  margin-bottom: 1.1rem;
}

.article-shell {
  max-width: 52rem;
}

.article-title {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.article-toc {
  margin: 1.75rem 0 2.25rem;
  padding: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(148, 163, 184, 0.10);
  backdrop-filter: blur(10px);
}

.article-toc-title {
  margin-bottom: 0.75rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
}

.article-toc ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.2rem;
}

.article-toc a {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.55;
  text-decoration: none;
  transition: color 180ms ease;
}

.article-toc a:hover {
  color: #4f46e5;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.article-nav-link {
  display: flex;
  min-height: 5.5rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  padding: 1rem;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.10);
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.article-nav-link:hover {
  border-color: rgba(91, 108, 255, 0.7);
  color: #4f46e5;
  transform: translateY(-0.12rem);
}

.article-nav-kicker {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
}

.article-nav-title {
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.45;
}

.article-nav-placeholder {
  display: none;
}

.dark .article-toc,
.dark .article-nav-link {
  border-color: rgba(71, 85, 105, 0.82);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.22);
}

.dark .article-toc-title,
.dark .article-nav-title {
  color: #e2e8f0;
}

.dark .article-toc a,
.dark .article-nav-kicker {
  color: #cbd5e1;
}

.dark .article-toc a:hover,
.dark .article-nav-link:hover {
  color: #a5b4fc;
}

.article-body ul {
  margin: 1rem 0 1.2rem 1.2rem;
  list-style: disc;
}

.article-body li {
  margin-bottom: 0.55rem;
}

.article-body code {
  border-radius: 0.375rem;
  padding: 0.15rem 0.4rem;
  background: rgba(91, 108, 255, 0.10);
  color: #4f46e5;
  font-size: 0.9em;
}

.dark .article-body code {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
}

.ai-content-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(254, 243, 199, 0.95));
  color: #92400e;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.16);
}

.ai-content-notice::before {
  content: 'AI';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 1000;
}

.dark .ai-content-notice {
  border-color: rgba(251, 191, 36, 0.36);
  background: linear-gradient(135deg, rgba(69, 26, 3, 0.92), rgba(120, 53, 15, 0.8));
  color: #fde68a;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
}

.dark .ai-content-notice::before {
  background: #fbbf24;
  color: #451a03;
}

.about-section {
  padding: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.65rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 10px 28px rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(8px);
  text-align: center;
}

.about-section-primary {
  margin-top: 2.5rem;
}

.about-section-divider {
  height: 1px;
  margin: 1.75rem 0 2.25rem;
  background: rgba(226, 232, 240, 0.95);
}

.about-section-contact {
  margin-top: 1.25rem;
}

.about-contact-heading {
  margin-top: 0;
}

.about-section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.about-accent {
  flex: 0 0 auto;
  width: 4rem;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 108, 255, 0), #5b6cff, rgba(124, 58, 237, 0));
}

.contact-section-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
}

.contact-link {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.75rem;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.contact-link:hover {
  background: #5b6cff;
  transform: translateY(-0.125rem);
}

.dark .about-section {
  border-color: rgba(71, 85, 105, 0.85);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
}

.dark .about-section-divider {
  background: rgba(71, 85, 105, 0.52);
}

.dark .about-accent {
  background: linear-gradient(90deg, rgba(103, 232, 249, 0), #67e8f9, rgba(124, 58, 237, 0));
}

.dark .contact-link {
  border-color: rgba(51, 65, 85, 0.95);
  background: #ffffff;
  color: #0f172a;
}

.dark .contact-link:hover {
  background: #cffafe;
}

@media (min-width: 640px) {
  .article-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .article-nav-placeholder {
    display: block;
  }

  .about-section {
    padding: 2rem;
  }

  .contact-section-body {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
  }
}

footer .mx-auto a,
footer .mx-auto p,
footer .mx-auto span,
footer .mx-auto button,
.site-footer-meta {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.site-footer-home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
}

.site-footer-home > * {
  margin: 0;
}

.site-footer-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  justify-content: flex-start;
}

.footer-copy-email {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: color 180ms ease;
}

.footer-copy-email:hover {
  color: #5b6cff;
}

.dark .footer-copy-email:hover {
  color: #8b5cf6;
}

@media (min-width: 640px) {
  .site-footer-home {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    text-align: left;
  }

  .site-footer-home > :first-child {
    justify-self: start;
    text-align: left;
  }

  .site-footer-home > :last-child {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
  }
}

.excerpt-clamp,
.excerpt-clamp-2,
.excerpt-clamp-4,
.title-clamp-4 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.excerpt-clamp,
.excerpt-clamp-4,
.title-clamp-4 {
  -webkit-line-clamp: 4;
}

.excerpt-clamp-2 {
  -webkit-line-clamp: 2;
}
