/* ═══════════════════════════════════════════════════════════════════════════════
   Landing · pricing (#pricing)
   The section head, the three plan cards with their ambient worlds, the Comet aura,
   and the plan cursors (Evergloom frog, Comet particle canvas, Bloodmoon bat).
   Shared rules for .section/.container/.head/.eyebrow/h2/.dn live in base.css; the
   rules here only add what the pricing section changes on top of them.
   html.gpu-lite stills for the worlds live in motion.css.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Section and head ── */
#pricing {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The id keeps the head centred over the phone rule that left-aligns every section head. */
#pricing > .head {
  justify-content: center;
  text-align: center;
}

#pricing > .head > div {
  width: 100%;
}

#pricing .eyebrow {
  font-family: var(--font-ui);
  font-size: clamp(28px, 2.4vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}

#pricing .pricing-title {
  max-width: 1100px;
  margin-inline: auto;
  font-size: clamp(34px, 4.6vw, 76px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .035em;
  -webkit-text-stroke: .35px currentColor;
}

#pricing .pricing-title span,
#pricing .pricing-title em {
  display: block;
  white-space: normal;
}

/* The subtitle is plain: no inherited stroke, no tilt, underline or glow. */
#pricing .pricing-title em {
  margin-top: 14px;
  transform: none;
  font-family: var(--font-serif);
  font-size: clamp(21px, 1.8vw, 30px);
  font-style: normal;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  color: #aaa9ad;
  -webkit-text-stroke: 0;
  text-decoration: none;
  text-shadow: none;
}

/* ── Plan grid and cards ── */
.landing-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  width: 100%;
  max-width: 1380px;
  margin-inline: auto;
}

.landing-plan {
  --plan-ink: #e8efde;
  --plan-muted: #c4d1b8;
  --plan-accent: #b6cf97;
  --plan-border: #cfdfa43d;
  --plan-button: #bdd5a222;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--plan-border);
  border-radius: 20px;
  color: var(--plan-ink);
  background: #0b1812;
  box-shadow: var(--plan-glow, 0 14px 40px #0003), inset 0 1px 0 #fff1;
  transition: translate .35s cubic-bezier(.2, .7, .2, 1), border-color .35s, box-shadow .35s;
}

.landing-plan--bloodmoon {
  --plan-ink: #efdee2;
  --plan-muted: #d2a9b3;
  --plan-accent: #d99caa;
  --plan-border: #c894a347;
  --plan-button: #b660762a;
  background: radial-gradient(ellipse at 82% 10%, #481723aa, transparent 58%), linear-gradient(150deg, #190b13, #08060b 70%);
}

/* Comet stays overflow:visible so its aura can spill below the card. */
.landing-plan--comet {
  --plan-ink: #e8e3f2;
  --plan-muted: #c3b9d5;
  --plan-accent: #c6b5e1;
  --plan-border: #b8a9ce47;
  --plan-button: #a89db324;
  --plan-glow: 0 24px 60px -28px #477de850, 0 44px 100px -40px #6954c936;
  overflow: visible;
  background: #0b0716;
}

/* Outside the fine-pointer block on purpose: a tap's sticky :hover brightens the glow too. */
.landing-plan--comet:hover {
  --plan-glow: 0 24px 70px -28px #477de862, 0 44px 110px -40px #6954c945;
}

/* ── Worlds (the artwork behind each card) ── */
.landing-plan__world {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

/* A soft light sweep across the card on hover; transform/opacity only, clipped by the world. */
.landing-plan__world::before {
  content: "";
  position: absolute;
  inset: -30% -70%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-45%);
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .085) 50%, transparent 58%);
  transition: opacity .3s;
}

.landing-plan__world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #07120d18, #06110bc7 43%, #07130bbd 80%, #07110bc9);
}

.landing-plan--bloodmoon .landing-plan__world::after {
  background: linear-gradient(180deg, transparent, #10070d4d 30%, #0b060b70 78%);
}

.landing-plan--comet .landing-plan__world::after {
  background: linear-gradient(180deg, #0a05132b, #0a0614b0 40%, #0a061499);
}

.landing-plan__landscape,
.landing-plan__galaxy {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-plan__landscape {
  object-position: 65% center;
}

.landing-plan__galaxy {
  object-position: center;
  opacity: .72;
}

.landing-plan__willow {
  position: absolute;
  width: 85%;
  max-width: none;
  right: -10%;
  top: -2%;
  opacity: .65;
  transform-origin: 94% 4%;
  animation: landing-plan-canopy 6s ease-in-out infinite;
}

.landing-plan__moon {
  position: absolute;
  width: 118px;
  top: 18px;
  right: 18px;
  opacity: .65;
  filter: drop-shadow(0 0 30px #ac263936);
}

.landing-plan__cloud {
  position: absolute;
  width: 180%;
  max-width: none;
  opacity: .3;
  animation: landing-plan-cloud 46s ease-in-out -12s infinite;
}

.landing-plan__cloud--top {
  top: 8%;
  right: -35%;
}

.landing-plan__cloud--bottom {
  bottom: 2%;
  left: -55%;
  opacity: .24;
  animation-duration: 59s;
  animation-delay: -29s;
}

.landing-plan__firefly,
.landing-plan__star {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--plan-accent);
  box-shadow: 0 0 9px 2px var(--plan-accent);
  animation: landing-plan-firefly 6s ease-in-out var(--delay) infinite;
}

.landing-plan__star {
  width: 2px;
  height: 2px;
  box-shadow: 0 0 6px var(--plan-accent);
  animation: landing-plan-twinkle 7s ease-in-out var(--delay) infinite;
}

/* The sprite carries its own glow and an additive-looking alpha, so no blend or filter surface is needed per comet. */
.landing-plan__comet {
  position: absolute;
  z-index: 1;
  top: var(--top);
  left: var(--left);
  width: var(--size);
  max-width: none;
  opacity: 0;
  transform-origin: 17% 50%;
  animation: landing-plan-comet var(--duration) linear var(--delay) infinite;
}

/* ── Card content ── */
.landing-plan__content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
  padding: 76px clamp(20px, 2.3vw, 38px) 32px;
  text-shadow: 0 1px 6px #030807bb;
  background: linear-gradient(155deg, #ffffff0b, transparent 38%);
}

.landing-plan__content h3 {
  font: 400 clamp(30px, 3vw, 46px)/1.16 var(--font-serif);
  letter-spacing: -.035em;
  text-align: center;
  overflow-wrap: break-word;
  color: var(--plan-ink);
}

.landing-plan--bloodmoon h3 {
  color: #edc2cb;
}

.landing-plan__price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin: 15px 0 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
}

.landing-plan__term {
  font-size: 14px;
  font-weight: 400;
  color: var(--plan-muted);
}

.landing-plan__features {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 0;
  margin: 32px 0 34px;
  list-style: none;
}

.landing-plan__features li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--plan-ink);
}

.landing-plan__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--plan-accent);
}

.landing-plan__upgrade {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  margin-top: auto;
  padding: 12px 20px;
  border: 1px solid var(--plan-border);
  border-radius: 9px;
  background: linear-gradient(115deg, var(--plan-button), #ffffff08);
  color: var(--plan-ink);
  font-size: 15px;
  font-weight: 500;
  text-shadow: none;
  transition: background .3s, border-color .3s;
}

.landing-plan__upgrade span {
  font-size: 20px;
  line-height: 1;
  transition: translate .3s;
}

.landing-plan__upgrade:hover {
  background: var(--plan-button);
  border-color: var(--plan-accent);
}

.landing-plan__upgrade:hover span {
  translate: 2px -2px;
}

.landing-plan__upgrade:focus-visible {
  outline-color: var(--plan-accent);
  outline-offset: 4px;
}

.landing-plan__popular {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  padding: 6px 18px;
  border: 1px solid #c2788a55;
  border-radius: 10px;
  background: linear-gradient(145deg, #49222ede, #22111be8);
  color: #edb5c2;
  font: italic 400 16px/1.4 var(--font-serif);
  box-shadow: 0 7px 22px #08030944, inset 0 1px 0 #f7c6d217;
  animation: landing-plan-badge 5.5s ease-in-out infinite;
}

/* ── Comet aura: a feathered galaxy beneath the card, no hard edge, no masks ── */
.comet-aura {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -145px;
  height: 240px;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 37%, #7499ef32 0%, #54479920 35%, transparent 70%);
}

.comet-aura::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("/assets/landing-plans/galaxy-aura.webp") center / 100% 100% no-repeat;
  border-radius: 50%;
  opacity: .65;
  transform: rotate(-9deg) scaleY(.65);
  animation: comet-nebula-drift 10s ease-in-out infinite alternate;
}

.comet-aura::after {
  content: "";
  position: absolute;
  inset: 15% 9%;
  pointer-events: none;
  border-radius: 50%;
  opacity: .38;
  background: radial-gradient(ellipse at center, #91bfff38, transparent 70%);
}

/* The markup still carries the old dot sprinkles; the aura image replaced them. */
.comet-aura i {
  display: none;
}

/* ── Ambient gating: decorations run only while their card is visible and its entrance is complete ── */
.landing-plan__world *,
.landing-plan__popular,
.comet-aura::before {
  animation-play-state: paused;
}

.is-ambient-active .landing-plan__world *,
.is-ambient-active .landing-plan__popular,
.is-ambient-active .comet-aura::before {
  animation-play-state: running;
}

/* ── Ambient keyframes (transform/opacity only) ── */
@keyframes landing-plan-sheen {
  from { transform: translateX(-45%); }
  to { transform: translateX(45%); }
}

@keyframes landing-plan-canopy {
  0%, 100% { transform: rotate(-4deg) translateX(-5px); }
  35% { transform: rotate(6deg) translateX(9px); }
  65% { transform: rotate(2deg) translateX(3px); }
}

@keyframes landing-plan-cloud {
  0%, 100% { transform: translate3d(-6%, 0, 0) scale(1.04); }
  50% { transform: translate3d(9%, 8px, 0) scale(1.07); }
}

@keyframes landing-plan-firefly {
  0%, 100% { transform: translate(0, 0); opacity: .35; }
  25% { transform: translate(20px, -14px); opacity: .9; }
  50% { transform: translate(34px, -32px); opacity: .5; }
  75% { transform: translate(-8px, -19px); opacity: .85; }
}

@keyframes landing-plan-twinkle {
  0%, 100% { opacity: .2; }
  50% { opacity: .85; }
}

@keyframes landing-plan-comet {
  0% { transform: translate3d(60px, -92px, 0) rotate(-57deg); opacity: 0; }
  10% { opacity: .85; }
  58% { opacity: .7; }
  78%, 100% { transform: translate3d(-260px, 400px, 0) rotate(-57deg); opacity: 0; }
}

@keyframes landing-plan-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes comet-nebula-drift {
  from { transform: translate3d(-6%, -8px, 0) rotate(-15deg) scale(1.12, .65); opacity: .55; }
  to { transform: translate3d(6%, 8px, 0) rotate(4deg) scale(1.24, .82); opacity: .8; }
}

/* ── Evergloom cursor: a frog that hops after the lily-pad pointer ── */
.misa-eg-frog {
  position: fixed;
  top: 0;
  left: 0;
  width: 54px;
  height: 54px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.misa-eg-frog[data-visible="true"] {
  opacity: 1;
}

.misa-eg-frog[data-facing="right"] .misa-eg-frog-sprite {
  scale: -1 1;
}

/* A stepped sprite sheet: background-position only ever jumps between frames, never tweens. */
.misa-eg-frog-sprite {
  display: block;
  width: 54px;
  height: 54px;
  background: url("/assets/evergloom/frog-sprite.webp") 0 0 / 486px 54px no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px #03120755);
  animation: misa-eg-frog-idle 3.8s steps(1, end) infinite !important;
}

.misa-eg-frog[data-jumping="true"] .misa-eg-frog-sprite {
  animation: misa-eg-frog-jump var(--frog-hop-duration, .56s) steps(1, end) 1 !important;
}

@keyframes misa-eg-frog-idle {
  0%, 78%, 100% { background-position: 0 0; }
  36%, 72% { background-position: -54px 0; }
  80%, 86% { background-position: -108px 0; }
  83% { background-position: -162px 0; }
  90% { background-position: 0 0; }
}

@keyframes misa-eg-frog-jump {
  0% { background-position: -108px 0; transform: translateY(2px); }
  13% { background-position: -216px 0; transform: translateY(-9px); }
  40% { background-position: -270px 0; transform: translateY(-15px); }
  57% { background-position: -324px 0; transform: translateY(-9px); }
  72% { background-position: -378px 0; transform: translateY(-3px); }
  86% { background-position: -432px 0; transform: translateY(1px); }
  100% { background-position: 0 0; transform: translateY(0); }
}

/* ── Comet cursor: a particle canvas that exists only while the pointer is over the card ── */
.misa-cm-cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  will-change: transform;
}

/* ── Bloodmoon cursor: a bat that banks with the pointer; the GIF is keyed live by an SVG filter ── */
.misa-bm-bat-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 134px;
  height: 75.375px;
  margin: 0;
  padding: 0;
  pointer-events: none !important;
  z-index: 2147483647;
  opacity: 0;
  transform: translate(-50%, -56%) rotate(var(--bat-bank, 0deg));
  transition: transform .16s ease-out, opacity .12s ease;
  filter: none;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
}

.misa-bm-bat-cursor.is-visible {
  opacity: 1;
}

.misa-bm-bat-cursor > svg {
  position: absolute;
}

.misa-bm-bat-cursor > img {
  display: block;
  width: 134px;
  height: 75.375px;
  max-width: none;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  filter: url(#misa-bat-alpha) drop-shadow(0 0 2px #d94e6299) drop-shadow(0 0 6px #b124485c);
  clip-path: inset(2px);
  user-select: none;
}

.misa-bm-bat-cursor.is-clicking > img {
  animation: misa-bat-click .32s ease-out;
}

/* The bat replaces the system pointer while it flies over the card. */
.misa-bm-bat-active,
.misa-bm-bat-active * {
  cursor: none !important;
}

@keyframes misa-bat-click {
  0%, 100% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-6px) scale(1.12); }
  70% { transform: translateY(-1px) scale(.98); }
}

/* ── Cursor images (fine pointers) ── */
@media (pointer: fine) {
  .landing-plan--evergloom,
  .landing-plan--evergloom * {
    cursor: url("/assets/evergloom/lily-pad-cursor.svg") 12 12, auto !important;
  }
}

@media (any-pointer: fine) {
  .landing-plan--comet,
  .landing-plan--comet * {
    cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cdefs%3E%3CradialGradient%20id%3D%22g%22%3E%3Cstop%20stop-color%3D%22%23e4e9ff%22%20stop-opacity%3D%22.5%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%239ba7ec%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22s%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.5%22%20stop-color%3D%22%23e7edff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23a898dd%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2214%22%20fill%3D%22url%28%23g%29%22%2F%3E%3Cpath%20d%3D%22M16%204%2018.7%2013.3%2028%2016%2018.7%2018.7%2016%2028%2013.3%2018.7%204%2016%2013.3%2013.3Z%22%20fill%3D%22url%28%23s%29%22%20stroke%3D%22%2374759d%22%20stroke-width%3D%22.65%22%2F%3E%3Cpath%20d%3D%22M16%209%2017.3%2014.7%2023%2016%2017.3%2017.3%2016%2023%2014.7%2017.3%209%2016%2014.7%2014.7Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E") 16 16, auto !important;
  }
}

/* ── Desktop section rhythm ── */
@media (min-width: 901px) {
  #pricing {
    padding-block: 64px;
  }
}

/* ── Narrow three-column layout ── */
@media (max-width: 1000px) and (min-width: 761px) {
  .landing-plan__features li {
    font-size: 14px;
    padding-left: 22px;
  }
}

/* ── Tablet: one column ── */
@media (max-width: 850px) {
  .landing-plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 500px;
    gap: 28px;
  }

  .landing-plan:last-child {
    margin-bottom: 60px;
  }

  .landing-plan__content {
    min-height: 460px;
    padding: 30px;
  }

  .landing-plan__content h3 {
    font-size: 40px;
  }
}

@media (max-width: 760px) {
  #pricing .pricing-title {
    font-size: clamp(32px, 7.8vw, 52px);
  }
}

/* ── Phone: left-aligned title, compact cards that keep their worlds ── */
@media (max-width: 700px) {
  #pricing > .head {
    margin-bottom: 28px;
  }

  #pricing .eyebrow {
    text-align: left;
    font: 500 22px/1.2 var(--font-hand);
  }

  #pricing .pricing-title {
    text-align: left;
    font-family: Inter, system-ui, sans-serif;
  }

  #pricing .pricing-title span {
    font-size: clamp(30px, 8vw, 40px);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.15;
  }

  #pricing .pricing-title em {
    font: 400 14px/1.65 Inter, system-ui, sans-serif;
    letter-spacing: 0;
    color: #aaa1a8;
    margin-top: 14px;
  }

  .landing-plans {
    max-width: 480px;
    gap: 22px;
  }

  /* The id keeps the flat phone shadow above the fine-pointer hover glow. */
  #pricing .landing-plan {
    border-radius: 24px;
    box-shadow: 0 12px 32px #0003;
  }

  .landing-plan:last-child {
    margin-bottom: 18px;
  }

  .landing-plan__content {
    min-height: 0;
    padding: 28px 24px;
    align-items: stretch;
    text-align: left;
  }

  .landing-plan--bloodmoon .landing-plan__content {
    padding-top: 52px;
  }

  .landing-plan__content h3 {
    font-size: 35px;
    margin-top: 0;
    text-align: left;
  }

  .landing-plan__price {
    font-size: 26px;
    justify-content: flex-start;
    margin-top: 8px;
  }

  /* Sizes the list box only; each item keeps its own 15px/1.55 from the base rule. */
  .landing-plan__features {
    gap: 13px;
    margin: 24px 0 28px;
    font-size: 13px;
    line-height: 1.5;
  }

  .landing-plan__upgrade {
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
  }

  /* Pinned right, but it keeps the base translate:-50% 0, so it sits half its width further left. */
  .landing-plan__popular {
    right: 18px;
    left: auto;
    font: 600 10px/1.2 Inter, system-ui, sans-serif;
    padding: 7px 9px;
    border-radius: 8px;
  }

  .landing-plan__moon {
    width: 110px;
    right: 8px;
    top: 42px;
    opacity: .6;
  }

  .comet-aura {
    height: 120px;
    bottom: -64px;
    opacity: .4;
  }
}

/* ── Hover lift and sheen (fine pointers that allow motion) ── */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .landing-plans > .landing-plan:hover {
    z-index: 3;
    translate: 0 -4px;
    border-color: var(--plan-accent);
    box-shadow: var(--plan-glow, 0 22px 45px #0005), inset 0 1px 0 #fff1;
  }

  .landing-plans > .landing-plan:hover .landing-plan__world::before {
    opacity: 1;
    animation: landing-plan-sheen 1.1s cubic-bezier(.22, .61, .36, 1) forwards;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .landing-plan,
  .landing-plan * {
    animation: none !important;
    transition: none !important;
  }

  .landing-plan__comet {
    opacity: .3;
    transform: rotate(-57deg);
  }

  /* `.landing-plan *` cannot reach the aura's pseudo-elements. */
  .comet-aura::before,
  .comet-aura::after {
    animation: none;
  }

  .misa-eg-frog-sprite {
    animation: none !important;
  }

  .misa-bm-bat-cursor {
    transition: none;
  }

  .misa-bm-bat-cursor.is-clicking > img {
    animation: none;
  }
}

/* ── Forced colours ── */
@media (forced-colors: active) {
  .landing-plan__world,
  .comet-aura {
    display: none;
  }

  .landing-plan,
  .landing-plan__popular,
  .landing-plan__upgrade {
    background: Canvas;
    color: CanvasText;
    border-color: CanvasText;
  }

  .landing-plan__content h3,
  .landing-plan__features li,
  .landing-plan__term {
    color: CanvasText;
  }
}
