html {
  background: #f3f7ff !important;
}

html:has([data-theme="dark"]) {
  background: #070b16 !important;
}

body {
  overflow-x: clip;
  background: transparent !important;
  cursor: url("../cursors/ansel-cursor.svg") 4 4, auto;
}

body :is(a, button, input, textarea, select, label, summary, [role="button"]) {
  cursor: url("../cursors/ansel-cursor-pointer.svg") 5 4, pointer;
}

body :is(input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], textarea) {
  cursor: auto;
}

body input::selection,
body textarea::selection,
main ::selection {
  background: rgba(56, 189, 248, .24);
}

.m-footer.is-minimal {
  background: transparent;
}

.m-footer.is-minimal .m-footer__content {
  color: rgba(15, 23, 42, .56);
  padding: 18px 20px 32px;
  text-align: center;
}

@media (min-width: 1280px) {
  .l-wrapper:not(.in-submenu) {
    max-width: min(1600px, calc(100% - 88px));
  }

  .m-hero__content {
    max-width: 880px;
  }
}

@media (min-width: 1440px) {
  main .m-article-card {
    width: calc(25% - 40px);
  }
}

@media (min-width: 1600px) {
  .l-wrapper:not(.in-submenu) {
    max-width: min(1760px, calc(100% - 96px));
  }

  main .m-article-card {
    width: calc(25% - 48px);
  }
}

@media (min-width: 1280px) {
  .l-wrapper.in-post {
    max-width: min(1120px, calc(100% - 96px));
  }

  .l-wrapper.in-comments {
    max-width: min(960px, calc(100% - 96px));
  }
}

.m-footer.is-minimal .m-footer-copyright {
  font-size: 12px;
  letter-spacing: .06em;
  line-height: 1.4;
  margin: 0;
  opacity: 1;
}

[data-theme="dark"] .m-footer.is-minimal .m-footer__content {
  color: rgba(226, 232, 240, .58);
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -3;
  display: block;
  background:
    radial-gradient(circle at 12% 14%, rgba(56, 189, 248, .26), transparent 34%),
    radial-gradient(circle at 78% 8%, rgba(59, 130, 246, .22), transparent 38%),
    radial-gradient(circle at 62% 82%, rgba(167, 139, 250, .22), transparent 39%),
    radial-gradient(circle at 22% 76%, rgba(14, 165, 233, .18), transparent 34%);
  filter: blur(44px);
  animation: ansel-aurora 22s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
  background-image:
    linear-gradient(rgba(37, 99, 235, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
  animation: ansel-grid-move 28s linear infinite;
}

[data-theme="dark"] body::before,
body[data-theme="dark"]::before {
  opacity: .68;
}

[data-theme="dark"] body::after,
body[data-theme="dark"]::after {
  background-image:
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px);
}

.ansel-fx-canvas,
.ansel-fx-cursor,
.ansel-fx-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ansel-fx-canvas {
  z-index: 999999;
}

.ansel-fx-cursor {
  display: none;
  z-index: 999998;
}

.ansel-fx-spotlight {
  z-index: 999996;
  background:
    radial-gradient(circle 320px at var(--ansel-fx-x, 50%) var(--ansel-fx-y, 50%),
      rgba(37, 99, 235, .08),
      rgba(37, 99, 235, .03) 43%,
      transparent 68%);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity .35s ease;
}

.ansel-fx-cursor::before,
.ansel-fx-cursor::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  transform: translate3d(var(--ansel-fx-x, 50vw), var(--ansel-fx-y, 50vh), 0) translate(-50%, -50%);
}

.ansel-fx-cursor::before {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(37, 99, 235, .85);
  background:
    radial-gradient(circle, rgba(56, 189, 248, .12), transparent 62%),
    conic-gradient(from 0deg, rgba(56, 189, 248, .95), rgba(139, 92, 246, .68), transparent 40%);
  box-shadow:
    0 0 22px rgba(56, 189, 248, .38),
    inset 0 0 12px rgba(56, 189, 248, .16);
  mask-image: radial-gradient(circle, transparent 50%, black 53%);
  transition:
    transform .18s cubic-bezier(.2, .8, .2, 1),
    border-color .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
  animation: ansel-cursor-spin 3.2s linear infinite;
}

.ansel-fx-cursor::after {
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow:
    0 0 10px rgba(56, 189, 248, .95),
    0 0 24px rgba(99, 102, 241, .5);
}

.ansel-fx-cursor.ansel-cursor-hover::before {
  transform:
    translate3d(var(--ansel-fx-x, 50vw), var(--ansel-fx-y, 50vh), 0) translate(-50%, -50%)
    scale(1.65);
  border-color: rgba(139, 92, 246, .95);
  box-shadow:
    0 0 30px rgba(56, 189, 248, .55),
    inset 0 0 18px rgba(139, 92, 246, .2);
}

.ansel-fx-cursor.ansel-cursor-hover::after {
  transform: scale(.68);
}

.ansel-fx-cursor.ansel-cursor-press::before {
  transform:
    translate3d(var(--ansel-fx-x, 50vw), var(--ansel-fx-y, 50vh), 0) translate(-50%, -50%)
    scale(.76);
}

.ansel-fx-cursor.ansel-cursor-press::after {
  transform: scale(.58);
}

.ansel-fx-cursor.ansel-cursor-hidden {
  opacity: 0;
}

main .m-hero-title,
main .m-article-card__title,
main .m-featured-article__title {
  transition: filter .25s ease;
}

main .m-hero-title {
  background: linear-gradient(105deg, #0f172a 18%, #2563eb 38%, #06b6d4 52%, #8b5cf6 64%, #0f172a 84%);
  background-size: 260% 100%;
  color: transparent !important;
  -webkit-background-clip: text;
  background-clip: text;
  animation: ansel-title-flow 8s ease infinite;
}

main .m-article-card:hover .m-article-card__title,
main .m-featured-article:hover .m-featured-article__title {
  filter: drop-shadow(0 8px 22px rgba(37, 99, 235, .25));
}

main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: perspective(900px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) translateY(var(--fx-lift, 0px));
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), box-shadow .38s ease;
  will-change: transform;
}

main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card)::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle 340px at var(--fx-x, 50%) var(--fx-y, 50%),
      rgba(37, 99, 235, .18),
      rgba(56, 189, 248, .08) 45%,
      transparent 72%);
  opacity: 0;
  transition: opacity .35s ease;
}

main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card):hover {
  --fx-lift: -9px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .16), 0 0 0 1px rgba(37, 99, 235, .12);
}

main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card):hover::after {
  opacity: 1;
}

main :is(.m-button, .m-icon-button) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
  will-change: transform;
}

main :is(.m-button, .m-icon-button)::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -80%;
  width: 42%;
  height: 220%;
  z-index: 1;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .62), transparent);
  transform: rotate(18deg) translateX(-110%);
  pointer-events: none;
}

main :is(.m-button, .m-icon-button):hover::after {
  transform: rotate(18deg) translateX(430%);
  transition: transform .75s cubic-bezier(.22, 1, .36, 1);
}

main :is(.m-button, .m-icon-button):hover {
  box-shadow: 0 14px 36px rgba(37, 99, 235, .24);
}

main a:not([class]) {
  position: relative;
  text-decoration-thickness: 1px;
}

main a:not([class])::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #8b5cf6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

main a:not([class]):hover::after {
  transform: scaleX(1);
}

main .ansel-reveal {
  opacity: 0;
  transform: translateY(34px) scale(.985);
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1);
}

main .ansel-reveal.ansel-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

main img {
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

main :is(.m-article-card, .m-featured-article):hover img {
  transform: scale(1.055);
  filter: saturate(1.08) contrast(1.05);
}

.ansel-click-ring {
  position: fixed;
  z-index: 999997;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, .82);
  box-shadow: 0 0 28px rgba(56, 189, 248, .38), inset 0 0 16px rgba(37, 99, 235, .2);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.12);
  animation: ansel-ring .72s cubic-bezier(.16, .84, .3, 1) forwards;
}

@keyframes ansel-aurora {
  0% { transform: translate3d(-4%, -3%, 0) scale(1); }
  50% { transform: translate3d(5%, 3%, 0) scale(1.13) rotate(2deg); }
  100% { transform: translate3d(-3%, 5%, 0) scale(1.05) rotate(-2deg); }
}

@keyframes ansel-grid-move {
  to { background-position: 108px 54px, 54px 108px; }
}

@keyframes ansel-title-flow {
  to { background-position: 260% 0; }
}

@keyframes ansel-cursor-spin {
  to { filter: hue-rotate(360deg); }
}

@keyframes ansel-ring {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card) {
    transform: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .ansel-fx-canvas,
  .ansel-fx-cursor,
  .ansel-fx-spotlight,
  .ansel-click-ring {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ansel-fx-cursor::before {
    animation: none !important;
  }

  body,
  body :is(a, button, input, textarea, select, label, summary, [role="button"]) {
    cursor: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  main .m-hero-title,
  main .ansel-reveal,
  main :is(.m-article-card, .m-featured-article, .m-post-card, .m-tag-card) {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  main .ansel-reveal {
    opacity: 1 !important;
  }
}
