/* A collection's landing page (collection.php). The layout works for any collection; a collection's
   'theme' dresses it. .theme-halloween is a moonlit night (the shared scene, tokens and slime are
   components/night.css): the designs stand in the hero sky as candle-lit arched windows, and the
   sections below glow by candlelight. Every animation stops under reduced motion. */

.collection { padding-bottom: clamp(72px, 9vw, 120px); }

/* ============ Hero ============ */
.col-hero { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(28px, 4.5vw, 60px) clamp(80px, 10vw, 136px); border-bottom: 1px solid var(--line); }
.col-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.col-hero-copy { display: grid; gap: 20px; align-content: start; }
.col-hero-copy .crumbs ol { margin: 0; }
.col-hero h1 { font-size: clamp(40px, 5.2vw, 68px); line-height: 1.02; }
.col-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.col-ctas .btn-lime .ico { transition: translate .2s var(--ease); }
.col-ctas .btn-lime:hover .ico { translate: 0 2px; }
.col-proof { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--ink-2); }
.col-proof li { display: inline-flex; align-items: center; gap: 8px; }
.col-proof .ico { width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--lime); color: #141519; }

/* the designs as arched windows, the middle column set lower like a skyline */
.col-windows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.3vw, 18px); margin: 0; padding: 0 0 28px; list-style: none; }
.win-wrap { position: relative; }
.win-wrap:nth-child(3n + 2) { translate: 0 28px; }
.win-glow { position: absolute; inset: 22% -10% -14%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 116, 30, .42), transparent); filter: blur(16px); opacity: .5; }
.win {
  position: relative; display: block; aspect-ratio: 9 / 10; overflow: hidden; color: inherit; text-decoration: none;
  border-radius: 50% 50% 10px 10px / 38% 38% 10px 10px; background: #12141B;
  box-shadow: 0 0 0 1px rgba(255, 236, 200, .16), 0 26px 40px -26px rgba(0, 0, 0, .9);
  transition: translate .35s var(--ease), box-shadow .35s var(--ease);
}
.win img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.9) saturate(1.05); transition: filter .4s var(--ease), scale .7s var(--ease); }
.win::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(255, 236, 200, .28); border-radius: 50% 50% 6px 6px / 38% 38% 6px 6px; pointer-events: none; }
.win-name {
  position: absolute; inset: auto 0 0; padding: 30px 10px 13px; text-align: center;
  background: linear-gradient(rgba(6, 7, 10, 0), rgba(6, 7, 10, .9)); color: #F3F2ED; font-size: 12.5px; font-weight: 650; line-height: 1.25; text-wrap: balance;
}
.win:hover { translate: 0 -4px; box-shadow: 0 0 0 1px rgba(255, 196, 130, .5), 0 30px 50px -22px rgba(242, 116, 30, .6); }
.win:hover img { filter: brightness(1.05) saturate(1.1); scale: 1.045; }
.win:focus-visible { outline: none; box-shadow: var(--focus); }

/* ============ Sections ============ */
.col-sec { position: relative; padding-top: clamp(56px, 8vw, 104px); }
.col-sec-head { display: grid; gap: 12px; max-width: 760px; margin-bottom: clamp(24px, 3vw, 36px); }
.col-sec-head h2 { font-size: clamp(30px, 3.6vw, 46px); }
.col-sec-head p { max-width: 62ch; font-size: 17px; line-height: 1.55; color: var(--ink-2); }

/* the designs */
.col-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.col-cards li { display: flex; }
.col-card {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--paper); color: inherit; text-decoration: none;
  box-shadow: 0 0 0 1px var(--line); transition: translate .3s var(--ease), box-shadow .3s var(--ease);
}
.col-card:hover { translate: 0 -4px; box-shadow: 0 0 0 1px #D2CEC3, var(--shadow); }
.col-card:focus-visible { outline: none; box-shadow: var(--focus); }
.col-card-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--graphite); }
.col-card-img img { width: 100%; height: 100%; object-fit: cover; transition: scale .6s var(--ease), filter .4s var(--ease); }
.col-card:hover .col-card-img img { scale: 1.04; }
.col-free { position: absolute; left: 12px; top: 12px; padding: 3px 8px; border-radius: 6px; background: var(--lime); color: #141519; font: 600 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.col-price { position: absolute; left: 12px; top: 12px; padding: 3px 8px; border-radius: 6px; background: #FFFFFF; color: #141519; font: 600 12px/1.4 var(--font-mono); letter-spacing: .02em; box-shadow: 0 1px 2px rgba(20, 21, 25, .18); }
.col-card-body { display: grid; gap: 6px; flex: 1; align-content: start; padding: 18px 20px 20px; }
.col-card-kind { font: 500 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.col-card-name { font-size: 21px; line-height: 1.15; }
.col-card-line { font-size: 15.5px; line-height: 1.45; color: var(--ink-2); }
.col-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.col-card-fmt { font: 500 12px/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); }
.col-card-go { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; }
.col-card-go .ico { width: 16px; height: 16px; transition: translate .2s var(--ease); }
.col-card:hover .col-card-go .ico { translate: 3px 0; }

/* how it works: four steps on a dotted path */
.col-steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.col-steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 13px); }
.col-steps li { position: relative; display: grid; gap: 8px; align-content: start; }
.col-step-n { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font: 600 13px/1 var(--font-mono); color: var(--lime-deep); }
.col-steps h3 { font-size: 19px; }
.col-steps p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* why it's free */
.col-why { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 14px; padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 64px); border-radius: var(--r-xl); text-align: center; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.col-why-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--bone-2); color: var(--ink); }
.col-why-ic .ico { width: 26px; height: 26px; }
.col-why h2 { font-size: clamp(30px, 3.6vw, 44px); }
.col-why p { max-width: 60ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.col-why .btn { margin-top: 8px; }

/* coming next */
.col-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); background: var(--graphite); color: var(--on-dark); }
.col-next > div:first-child { display: grid; gap: 10px; max-width: 640px; }
.col-next h2 { font-size: clamp(26px, 2.8vw, 34px); color: var(--on-dark); }
.col-next p { font-size: 17px; line-height: 1.55; color: var(--on-dark-2); }
.col-next .eyebrow { color: var(--on-dark-2); }
.col-next-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.col-next .btn-ghost { color: var(--on-dark); border-color: var(--line-dark); background: transparent; }
.col-next .btn-ghost:hover { background: var(--graphite-2); border-color: rgba(243, 242, 237, .2); }
.col-next .textlink { color: var(--on-dark); }
.col-next .textlink:hover { color: #141519; }

/* ============ Theme: Halloween, a moonlit night (components/night.css) ============ */
.theme-halloween { background: #0C0E13; }
.theme-halloween .site-header { background: rgba(8, 9, 13, .74); }
.theme-halloween .site-header.is-open { background: #0C0E13; }
.theme-halloween .acct-avatar { background: var(--lime); color: #141519; }
.theme-halloween .crumbs li + li::before { color: rgba(243, 242, 237, .3); }
.theme-halloween .crumbs a:hover { color: var(--ink); }
.theme-halloween .col-hero {
  border-bottom: 0; background: linear-gradient(180deg, #07080C 0%, #0A0B10 55%, var(--night-1) 100%);
  --moon-top: clamp(28px, 4.4vw, 64px); --moon-right: max(3vw, calc((100vw - var(--maxw)) / 2 - 24px)); --moon-size: clamp(180px, 25vw, 340px);
}
.theme-halloween .col-hero h1 { padding-bottom: .36em; }

/* the windows by candlelight */
.theme-halloween .win-glow { animation: flicker 3.6s linear calc(var(--i) * -.9s) infinite; }

/* entrances */
.col-in { animation: col-in .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
.win-wrap { animation: col-in .9s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 300ms); }
@keyframes col-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* night sections */
.theme-halloween .col-card { box-shadow: 0 0 0 1px var(--line-2); }
.theme-halloween .col-card:hover { box-shadow: 0 0 0 1px rgba(242, 116, 30, .5), 0 34px 60px -30px rgba(242, 116, 30, .5); }
.theme-halloween .col-card-img { background: var(--night-3); }
.theme-halloween .col-card-img img { filter: brightness(.94); }
.theme-halloween .col-card:hover .col-card-img img { filter: brightness(1.05); }
.theme-halloween .col-card-kind { color: var(--candle); }
.theme-halloween .col-steps::before { background: repeating-linear-gradient(90deg, rgba(200, 240, 60, .4) 0 6px, transparent 6px 13px); }
.theme-halloween .col-step-n { background: var(--night-1); box-shadow: 0 0 0 1px rgba(200, 240, 60, .5), 0 0 24px rgba(200, 240, 60, .22); animation: wisp 3.2s ease-in-out calc(var(--i, 0) * .5s) infinite alternate; }
@keyframes wisp { from { box-shadow: 0 0 0 1px rgba(200, 240, 60, .45), 0 0 14px rgba(200, 240, 60, .14); } to { box-shadow: 0 0 0 1px rgba(200, 240, 60, .6), 0 0 30px rgba(200, 240, 60, .3); } }
.theme-halloween .col-why { background: radial-gradient(70% 90% at 50% 125%, rgba(242, 116, 30, .24), transparent 70%), var(--night-2); box-shadow: 0 0 0 1px var(--line-2); }
.theme-halloween .col-why-ic { background: rgba(242, 116, 30, .12); color: var(--candle); box-shadow: 0 0 0 1px rgba(242, 116, 30, .32), 0 0 30px rgba(242, 116, 30, .18); }
.theme-halloween .col-next { background: radial-gradient(60% 120% at 100% 0%, rgba(140, 203, 234, .13), transparent 70%), var(--night-2); box-shadow: 0 0 0 1px var(--line-2); }
.theme-halloween .col-next .eyebrow::before { background: var(--f-frost); box-shadow: 0 0 12px rgba(140, 203, 234, .55); }

/* ============ Theme: Christmas, a snowy winter night (components/snow.css) ============ */
.theme-christmas { background: #08111C; }
.theme-christmas .site-header { background: rgba(6, 11, 19, .76); }
.theme-christmas .site-header.is-open { background: #08111C; }
.theme-christmas .acct-avatar { background: var(--lime); color: #141519; }
.theme-christmas .crumbs li + li::before { color: rgba(243, 242, 237, .3); }
.theme-christmas .crumbs a:hover { color: var(--ink); }
.theme-christmas .col-hero {
  border-bottom: 0; background: linear-gradient(180deg, #050A12 0%, #07101B 55%, var(--winter-1) 100%);
  --snow-inset: 0 0 0 50%;
}
.theme-christmas .col-hero h1 { padding-top: .14em; }

/* the designs as warm windows on a winter night: square-cornered, frosted at the corners, snow on top */
.theme-christmas .win { border-radius: 10px; box-shadow: 0 0 0 1px rgba(207, 228, 243, .2), 0 26px 40px -26px rgba(0, 0, 0, .9); }
.theme-christmas .win::after {
  inset: 0; border: 0; border-radius: inherit;
  background:
    radial-gradient(circle at 0 0, rgba(228, 240, 250, .5), transparent 20%), radial-gradient(circle at 100% 0, rgba(228, 240, 250, .45), transparent 18%),
    radial-gradient(circle at 0 100%, rgba(228, 240, 250, .3), transparent 16%), radial-gradient(circle at 100% 100%, rgba(228, 240, 250, .35), transparent 18%);
}
.theme-christmas .win-wrap::before {
  content: ""; position: absolute; z-index: 2; left: -6px; right: -6px; top: -7px; height: 13px; pointer-events: none;
  border-radius: 10px 10px 5px 5px; background: linear-gradient(#FFFFFF 45%, #D6E5F1); box-shadow: 0 3px 6px rgba(0, 0, 0, .4);
}
.theme-christmas .win:hover { box-shadow: 0 0 0 1px rgba(242, 169, 59, .55), 0 30px 50px -22px rgba(242, 169, 59, .55); }
.theme-christmas .win-glow { background: radial-gradient(closest-side, rgba(242, 169, 59, .42), transparent); animation: warm 4.4s ease-in-out calc(var(--i) * -.8s) infinite alternate; }
@keyframes warm { from { opacity: .38; } to { opacity: .62; } }

/* winter sections */
.theme-christmas .col-card { box-shadow: 0 0 0 1px var(--line-2); }
.theme-christmas .col-card:hover { box-shadow: 0 0 0 1px rgba(242, 169, 59, .5), 0 34px 60px -30px rgba(242, 169, 59, .45); }
.theme-christmas .col-card-img { background: var(--winter-3); }
.theme-christmas .col-card-img img { filter: brightness(.95); }
.theme-christmas .col-card:hover .col-card-img img { filter: brightness(1.05); }
.theme-christmas .col-card-kind { color: var(--frost); }
.theme-christmas .col-steps::before { background: repeating-linear-gradient(90deg, rgba(207, 228, 243, .4) 0 6px, transparent 6px 13px); }
.theme-christmas .col-step-n { background: var(--winter-1); box-shadow: 0 0 0 1px rgba(207, 228, 243, .45), 0 0 24px rgba(207, 228, 243, .16); }
.theme-christmas .col-next { background: radial-gradient(60% 120% at 100% 0%, rgba(242, 169, 59, .14), transparent 70%), var(--winter-2); box-shadow: 0 0 0 1px var(--line-2); }
.theme-christmas .col-next .eyebrow::before { background: var(--ember); box-shadow: 0 0 12px rgba(242, 169, 59, .55); }
.theme-christmas .bundle { background: radial-gradient(70% 120% at 100% 0%, rgba(242, 169, 59, .12), transparent 70%), var(--winter-2); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lg); }
.theme-christmas .bundle-buy { background: var(--winter-1); box-shadow: 0 0 0 1px var(--line-2) inset; }
.theme-christmas .have-tag { background: rgba(200, 240, 60, .12); color: var(--lime); box-shadow: 0 0 0 1px rgba(200, 240, 60, .3) inset; }
.theme-christmas .bundle-thumbs li { box-shadow: 0 0 0 1px var(--line); }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .col-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .col-windows { max-width: 600px; }
  .col-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .col-steps::before { display: none; }
  .col-hero .night-moon { top: auto; bottom: 34%; right: -40px; }
  .col-hero { --stars-inset: 52% 0 8% 40%; }
  .theme-christmas .col-hero { --snow-inset: 48% 0 0 0; }
  /* stacked, the words fill the top of the hero: the snow falls only around the windows below them */
  .theme-christmas .col-hero .snowfall { display: none; }
  .theme-christmas .col-windows { position: relative; }
  .theme-christmas .col-windows::before {
    content: ""; position: absolute; inset: -36px -16px 0; z-index: -1; pointer-events: none;
    background-size: 220px 220px; opacity: .8; animation: snow-1 16s linear infinite;
    background-image:
      radial-gradient(2.2px 2.2px at 22px 34px, #fff 50%, transparent 56%), radial-gradient(1.6px 1.6px at 92px 118px, #fff 50%, transparent 56%),
      radial-gradient(2.6px 2.6px at 160px 62px, #fff 50%, transparent 56%), radial-gradient(1.4px 1.4px at 58px 188px, #fff 50%, transparent 56%),
      radial-gradient(2px 2px at 198px 168px, #fff 50%, transparent 56%), radial-gradient(1.3px 1.3px at 132px 12px, #fff 50%, transparent 56%);
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 80%, transparent);
  }
}
@media (max-width: 600px) {
  .col-hero { padding-bottom: 96px; }
  .col-windows { gap: 9px; padding-bottom: 18px; }
  .win-wrap:nth-child(3n + 2) { translate: 0 18px; }
  .win::after { inset: 5px; }
  .win-name { padding: 22px 6px 9px; font-size: 11px; }
  .col-hero .night-moon { width: 170px; bottom: 30%; right: -36px; }
  /* the designs become a list: picture left, words right */
  .col-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .col-card { flex-direction: row; }
  .col-card-img { flex: none; width: 132px; aspect-ratio: auto; }
  .col-card-body { gap: 4px; padding: 14px 14px 14px 16px; }
  .col-card-name { font-size: 17px; }
  .col-card-line { font-size: 14.5px; }
  .col-card-foot { margin-top: 6px; padding-top: 10px; }
  .col-card-go { display: none; }
  .col-free { left: 8px; top: 8px; padding: 2px 6px; font-size: 10px; }
  .col-steps { grid-template-columns: minmax(0, 1fr); row-gap: 22px; padding-left: 0; }
  .col-steps li { grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; }
  .col-step-n { grid-row: span 2; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .col-in, .win-wrap, .theme-halloween .win-glow, .theme-halloween .col-step-n, .theme-christmas .win-glow, .theme-christmas .col-windows::before { animation: none; }
}
