/* ======================================================================
   IVY-F.ORG — site styles
   Premium re-work of ivy-f's surfaces: textured white body, defined
   day-cycle arc, Apple liquid-glass panels/buttons, category row + lens.
   ====================================================================== */

:root {
  --ink: #1d1d1f;
  --ink-soft: rgba(29, 29, 31, 0.72);
  --ink-quiet: #6e6e73;
  --hairline: rgba(17, 17, 17, 0.08);

  /* liquid glass recipe */
  --lg-bg-a: rgba(255, 255, 255, 0.52);
  --lg-bg-b: rgba(255, 255, 255, 0.20);
  --lg-blur: 32px;
  --lg-sat: 1.65;
  --lg-edge: rgba(255, 255, 255, 0.92);
  --lg-ring: rgba(17, 17, 17, 0.06);
  --lg-shadow: 0 24px 70px rgba(17, 17, 17, 0.13), 0 2px 10px rgba(17, 17, 17, 0.05);

  --dot: rgba(17, 17, 17, 0.18);
  --dot-active: #1d1d1f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  /* warm premium white, not flat #fff */
  background:
    radial-gradient(120vmax 80vmax at 50% -10%, #ffffff 0%, #fbfbfa 55%, #f4f4f2 100%);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", "HelveticaNeue",
    "Neue Haas Grotesk Text Pro", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ── Body texture: barely-there paper grain ─────────────────────────── */
.body-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: multiply;
}

/* ── Ivy vines: slow-growing imprint on the white (subtle, embossed) ── */
.ivy-vines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.ivy-vines path.vine-stem {
  fill: none;
  stroke: rgba(38, 56, 40, 0.045);
  stroke-width: 2;
  stroke-linecap: round;
}
.ivy-vines path.vine-stem--light {
  stroke: rgba(255, 255, 255, 0.6);   /* deboss highlight, offset 1px */
  stroke-width: 1;
}
.ivy-vines .vine-leaf {
  fill: rgba(38, 56, 40, 0.04);
  opacity: 0;
  transition: opacity 14s ease;
}
.ivy-vines .vine-leaf.is-grown { opacity: 1; }

/* ── Day-cycle arc: premium definition upgrades ─────────────────────── */
.day-cycle-arc__svg {
  /* soft physical depth under the whole band */
  filter: drop-shadow(0 14px 30px rgba(12, 14, 28, 0.20));
}
.day-cycle-arc__settings-gear { display: none !important; } /* no settings panel on the site */

/* premium rim + shadow paths injected by site.js */
.arc-premium-shadow {
  mix-blend-mode: multiply;
  opacity: 0.16;
  filter: blur(16px);
}
.arc-premium-rim {
  mix-blend-mode: screen;
  opacity: 0.65;
  filter: blur(0.4px);
}
.arc-premium-gloss {
  mix-blend-mode: screen;
  opacity: 0.10;
  filter: blur(22px);
}

/* ======================================================================
   LIQUID GLASS CORE — shared by the panel, the row and buttons
   ====================================================================== */
.liquid-glass,
.glass-panel,
.category-row {
  background: linear-gradient(135deg, var(--lg-bg-a) 0%, var(--lg-bg-b) 100%);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  border: 1px solid var(--lg-edge);
  box-shadow:
    0 0 0 1px var(--lg-ring),
    var(--lg-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -18px 34px -22px rgba(17, 17, 17, 0.18),
    inset 0 0 22px 6px rgba(255, 255, 255, 0.28);
}

/* ======================================================================
   THE GLASS PANEL — ivy-f's .glass-panel, re-worked to Apple liquid glass
   ====================================================================== */
.glass-panel {
  position: fixed;
  top: calc(8vh + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 94vw);
  height: min(calc(28vh + 480px), calc(100vh - (8vh + 16px) - 130px));
  display: flex;
  flex-direction: column;
  border-radius: 34px;
  overflow: hidden;
  z-index: 10;
  transition:
    background 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease,
    -webkit-backdrop-filter 0.5s ease,
    backdrop-filter 0.5s ease;
}

/* corner glints + top specular streak (screen blend, like polished glass) */
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.55), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(255, 255, 255, 0.38), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0.04) 26%, rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}
/* 1px inner rim — the "thick glass" edge */
.glass-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 32px;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35),
    inset 1px 0 0 rgba(255, 255, 255, 0.45),
    inset -1px 0 0 rgba(255, 255, 255, 0.45);
  z-index: 0;
}

/* slow internal sheen drifting across the glass — "moves like liquid" */
.glass-panel__sheen {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(255, 255, 255, 0.10) 40deg,
    transparent 90deg,
    transparent 200deg,
    rgba(255, 255, 255, 0.07) 250deg,
    transparent 300deg
  );
  animation: lg-sheen-drift 26s linear infinite;
  mix-blend-mode: screen;
}
@keyframes lg-sheen-drift {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.glass-panel__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 30px 14px;
  flex: 0 0 auto;
}
.glass-panel__title {
  margin: 0;
  font-size: clamp(1.3rem, 1.2vw + 1rem, 1.9rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.035em;
  text-transform: lowercase;
  color: var(--ink);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.glass-panel__title.is-switching {
  opacity: 0;
  transform: translateY(4px);
}
.glass-panel__page {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-quiet);
  font-variant-numeric: tabular-nums;
  text-transform: lowercase;
  transition: opacity 0.25s ease;
}
.glass-panel__page.is-switching { opacity: 0; }

/* thin horizontal divider between header and content */
.glass-panel__divider {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  height: 1px;
  margin: 0 30px;
  background: linear-gradient(90deg,
    rgba(17, 17, 17, 0) 0%,
    rgba(17, 17, 17, 0.14) 12%,
    rgba(17, 17, 17, 0.14) 88%,
    rgba(17, 17, 17, 0) 100%);
}

/* ── Content / pages ────────────────────────────────────────────────── */
.glass-panel__content {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.page {
  position: absolute;
  inset: 0;
  padding: 26px 38px 18px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.995);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(17,17,17,0.18) transparent;
}
.page.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.page-prose {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.page-prose--center { text-align: center; }
.page-h {
  margin: 4px 0 14px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-byline {
  margin: -8px 0 16px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
}
.page-quiet {
  color: var(--ink-quiet);
  font-size: 0.86rem;
}
.page-link {
  color: #2f6fde;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-prose code {
  background: rgba(17, 17, 17, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.85em;
}
.error-quote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 2px solid rgba(17, 17, 17, 0.25);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 14px 14px 0;
  font-style: italic;
  color: var(--ink);
}
.remake-highlights {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px var(--hairline), 0 10px 24px rgba(17,17,17,0.05);
}
.remake-highlights__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.remake-highlights ul {
  margin: 0;
  padding-left: 18px;
}
.remake-highlights li {
  margin: 4px 0;
  font-size: 0.92rem;
}

/* ── Pagination dots — copied from ivy-f, tinted for the light panel ── */
.settings-pagination-dots {
  display: none;
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 16px;
  pointer-events: auto;
}
.settings-pagination-dots.is-visible { display: flex; }
.settings-pagination-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 200ms ease;
}
.settings-pagination-dot:hover {
  background: rgba(17, 17, 17, 0.4);
  transform: scale(1.15);
}
.settings-pagination-dot.is-active {
  background: var(--dot-active);
  box-shadow: 0 0 6px rgba(17, 17, 17, 0.45);
}

/* ======================================================================
   THE ROW — liquid-glass dock + sliding spyglass lens
   ====================================================================== */
.category-row {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
}
.row-btn {
  position: relative;
  z-index: 2;
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.row-btn:hover { color: var(--ink); }
.row-btn:active { transform: scale(0.94); }
.row-btn.is-active { color: var(--ink); }

/* liquid specular highlight that follows the pointer (--mx/--my from JS) */
.row-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    60px 40px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.65),
    rgba(255, 255, 255, 0) 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}
.row-btn:hover::before { opacity: 1; }

/* the perfectly circular credits button in the very middle */
.row-btn--circle {
  width: 54px;
  height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(255,255,255,0.35));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px var(--lg-ring),
    0 10px 22px rgba(17, 17, 17, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -8px 14px -8px rgba(17, 17, 17, 0.18);
}
.row-btn__leaf {
  width: 26px;
  height: 26px;
  color: #355238;
}

/* the spyglass lens that slides between categories */
.category-row__lens {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  pointer-events: none;
  /* glass of the lens — slight magnify/brighten so it reads as an optic */
  -webkit-backdrop-filter: blur(1px) saturate(1.5) brightness(1.07) contrast(1.04);
  backdrop-filter: blur(1px) saturate(1.5) brightness(1.07) contrast(1.04);
  background:
    radial-gradient(120% 120% at 30% 22%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0) 70%);
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.95),
    0 0 0 2.5px rgba(17, 17, 17, 0.18),
    0 8px 18px rgba(17, 17, 17, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -6px 12px -6px rgba(17, 17, 17, 0.22),
    inset 0 0 14px 2px rgba(255, 255, 255, 0.35);
  transition:
    left 0.55s cubic-bezier(0.34, 1.3, 0.5, 1),
    top 0.55s cubic-bezier(0.34, 1.3, 0.5, 1),
    width 0.55s cubic-bezier(0.34, 1.3, 0.5, 1),
    height 0.55s cubic-bezier(0.34, 1.3, 0.5, 1);
}
.category-row__lens::after {
  /* tiny specular dot, like light caught in the optic */
  content: "";
  position: absolute;
  top: 12%;
  left: 16%;
  width: 22%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,255,255,0));
  filter: blur(1px);
}
.category-row__lens.is-settling {
  animation: lens-settle 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lens-settle {
  0%   { transform: scale(1.0); }
  40%  { transform: scale(1.07); }
  70%  { transform: scale(0.985); }
  100% { transform: scale(1.0); }
}

/* ======================================================================
   SUPPORT — comment-creator injection box (from ivy-f, light-adapted)
   ====================================================================== */
.comment-creator {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px var(--hairline), 0 12px 28px rgba(17, 17, 17, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.comment-creator--site {
  max-width: 430px;
  margin: 22px auto 0;
}
.comment-creator__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.comment-creator__alias {
  flex: 1;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  color: inherit;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
.comment-creator__alias:focus { border-color: rgba(17, 17, 17, 0.3); }
.comment-creator__alias::placeholder { color: rgba(17, 17, 17, 0.35); }
.comment-creator__tnc {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--hairline);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: help;
  user-select: none;
  color: var(--ink-soft);
}
.comment-creator__tnc-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 74vw);
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 22, 28, 0.96);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  display: none;
  z-index: 80;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  text-align: left;
  letter-spacing: normal;
}
.comment-creator__tnc.is-hover .comment-creator__tnc-tip,
.comment-creator__tnc:hover .comment-creator__tnc-tip { display: block; }
.comment-creator__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-creator__input {
  resize: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: inherit;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, height 0.12s;
  min-height: 48px;
  max-height: 240px;
  overflow: auto;
}
.comment-creator__input::placeholder { color: rgba(17, 17, 17, 0.3); }
.comment-creator__input:focus { border-color: rgba(17, 17, 17, 0.3); }
.comment-creator__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comment-creator__hint {
  font-size: 0.72rem;
  color: var(--ink-quiet);
}
.comment-creator__send {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 22px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.45));
  box-shadow: 0 0 0 1px var(--hairline), 0 8px 18px rgba(17, 17, 17, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.comment-creator__send:hover {
  box-shadow: 0 0 0 1px var(--hairline), 0 12px 24px rgba(17, 17, 17, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.comment-creator__send:active { transform: scale(0.95); }

/* ======================================================================
   TOAST
   ====================================================================== */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(16px);
  z-index: 60;
  max-width: min(480px, 86vw);
  padding: 12px 20px;
  border-radius: 16px;
  background: rgba(20, 22, 28, 0.92);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.site-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ======================================================================
   INSTALLMENTS — subscription cards injected from ivy-f
   (same classes + animation language; staged inline instead of overlay)
   ====================================================================== */
.installments-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  max-width: 920px;
  margin: 0 auto;
  height: 100%;
}
.installments-copy { flex: 1 1 360px; max-width: 460px; }
.installments-stage {
  position: relative;
  flex: 0 0 auto;
  width: 324px;   /* stack 224 + select offset 30 + shuffle room */
  height: 440px;
  margin-top: 36px;
}

.subscription-cards-stack {
  position: relative;
  width: 224px;
  height: 432px;
}

.subscription-card {
  position: absolute;
  top: -40px;
  left: 0;
  width: 224px;
  height: 432px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  background:
    linear-gradient(
      135deg,
      rgb(175, 174, 174) 0%,
      rgb(140, 140, 140) 50%,
      rgb(100, 100, 100) 100%
    );
  isolation: isolate;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset -2px -2px 8px rgba(255, 255, 255, 0.05),
    inset 2px 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(-120%) translateY(20%);
  opacity: 0;
  transition:
    transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}

.subscription-card__bg-video {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  width: auto !important;
  height: auto !important;
  transform: translate(-50%, -50%) !important;
  object-fit: cover !important;
  z-index: 0 !important;
  pointer-events: none !important;
  border-radius: inherit;
  display: block !important;
}

.subscription-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.30) 55%,
      rgba(0, 0, 0, 0.62) 100%
    ),
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0) 38%
    );
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.subscription-card > * {
  position: relative;
  z-index: 10;
}

/* entrance — mirrors ivy-f's overlay.is-open state */
.subscription-cards-stack.is-live .subscription-card {
  transform: translateX(0) translateY(0);
  opacity: 1;
}

/* stacking — PRO on top by default */
.subscription-card--pro {
  z-index: 2;
  left: 0;
}
.subscription-card--select {
  z-index: 1;
  left: 30px;
}

.subscription-cards-stack.is-shuffled .subscription-card--pro {
  z-index: 1;
  left: 30px;
  animation: shuffle-to-back 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.subscription-cards-stack.is-shuffled .subscription-card--select {
  z-index: 2;
  left: 0;
  animation: shuffle-to-front 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.subscription-cards-stack.is-live:not(.is-shuffled) .subscription-card--pro {
  animation: shuffle-back-to-front 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.subscription-cards-stack.is-live:not(.is-shuffled) .subscription-card--select {
  animation: shuffle-front-to-back 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes shuffle-to-back {
  0%   { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
  50%  { transform: translateX(20px) translateY(-15px) scale(0.95) rotate(5deg); }
  100% { transform: translateX(30px) translateY(0) scale(1) rotate(0deg); }
}
@keyframes shuffle-to-front {
  0%   { transform: translateX(30px) translateY(0) scale(1) rotate(0deg); }
  50%  { transform: translateX(15px) translateY(-15px) scale(1.05) rotate(-5deg); }
  100% { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
}
@keyframes shuffle-back-to-front {
  0%   { transform: translateX(30px) translateY(0) scale(1) rotate(0deg); }
  50%  { transform: translateX(15px) translateY(-15px) scale(1.05) rotate(-5deg); }
  100% { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
}
@keyframes shuffle-front-to-back {
  0%   { transform: translateX(0) translateY(0) scale(1) rotate(0deg); }
  50%  { transform: translateX(20px) translateY(-15px) scale(0.95) rotate(5deg); }
  100% { transform: translateX(30px) translateY(0) scale(1) rotate(0deg); }
}

/* shuffle button */
.subscription-card__shuffle-btn {
  position: absolute;
  top: 50%;
  left: 120%;
  transform: translateY(-50%) translateX(-120%);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(180, 180, 180, 0.4) 0%,
    rgba(140, 140, 140, 0.35) 50%,
    rgba(100, 100, 100, 0.3) 100%
  );
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition:
    transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 600ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background 300ms ease,
    box-shadow 300ms ease;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset -2px -2px 8px rgba(255, 255, 255, 0.05),
    inset 2px 2px 8px rgba(0, 0, 0, 0.1);
}
.subscription-cards-stack.is-live .subscription-card__shuffle-btn {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}
.subscription-card__shuffle-btn svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.8);
  transition: all 300ms ease;
}
.subscription-card__shuffle-btn:hover {
  transform: translateY(-50%) scale(1.05);
  background: linear-gradient(
    135deg,
    rgba(200, 200, 200, 0.5) 0%,
    rgba(160, 160, 160, 0.45) 50%,
    rgba(120, 120, 120, 0.4) 100%
  );
}
.subscription-card__shuffle-btn:hover svg {
  stroke: rgba(255, 255, 255, 1);
  transform: rotate(180deg);
}
.subscription-card__shuffle-btn:active { transform: translateY(-50%) scale(0.95); }

/* title / tagline / features — from ivy-f */
.subscription-card__title {
  margin: 0;
  margin-top: 5px;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
  background: linear-gradient(
    145deg,
    #ffffff 0%, #e0e0e0 20%, #ffffff 40%, #f5f5f5 60%, #ffffff 80%, #e8e8e8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}
.subscription-card__tagline {
  width: 100%;
  margin: 8px 0 2px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.subscription-card__description {
  width: 100%;
  margin-top: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.subscription-card__section { margin-bottom: 8px; }
.subscription-card__section-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  display: inline-block;
}
.subscription-card__section-line {
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  margin-top: 4px;
  margin-bottom: 10px;
  border-radius: 1px;
}
.subscription-card__features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.subscription-card__features li {
  position: relative;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.005em;
  padding-left: 15px;
  margin-bottom: 7px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}
.subscription-card__features li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* install buttons — frosted pill + sweep shine, from ivy-f */
.subscription-card__install-btn {
  position: relative;
  width: 100%;
  height: 46px;
  margin-top: auto;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.07) 52%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -8px 18px rgba(0, 0, 0, 0.10);
  transition:
    transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 260ms ease,
    background 260ms ease;
}
.subscription-card__install-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -65%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 620ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.subscription-card__install-btn:hover::after { left: 125%; }
.subscription-card--pro .subscription-card__install-btn {
  background: linear-gradient(
    180deg,
    rgba(124, 172, 255, 0.42) 0%,
    rgba(70, 120, 222, 0.30) 100%
  );
  border-color: rgba(168, 204, 255, 0.55);
  box-shadow:
    0 8px 24px rgba(44, 92, 200, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -8px 18px rgba(0, 0, 0, 0.12);
}
.subscription-card__install-text {
  position: relative;
  z-index: 1;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

/* SELECT gating — exact ivy-f behavior: locked until Pro */
.subscription-card__pro-required {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  pointer-events: none;
  z-index: 12;
  opacity: 1;
  transition: opacity 300ms ease;
}
.subscription-card__install-btn--select {
  position: relative;
  pointer-events: none;
}
.subscription-card__install-btn--select::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 11;
  pointer-events: none;
  border-radius: inherit;
}
.subscription-card__install-btn--select .subscription-card__install-text {
  filter: grayscale(100%);
  position: relative;
  z-index: 10;
}
.subscription-card__install-btn--select.is-unlocked { pointer-events: all; }
.subscription-card__install-btn--select.is-unlocked::before { display: none; }
.subscription-card__install-btn--select.is-unlocked .subscription-card__install-text { filter: none; }
.subscription-card__install-btn--select.is-unlocked .subscription-card__pro-required { opacity: 0; }

/* ======================================================================
   RESPONSIVE
   ====================================================================== */
@media (max-width: 980px) {
  .installments-layout {
    flex-direction: column;
    gap: 14px;
    height: auto;
  }
  .installments-stage {
    transform: scale(0.86);
    transform-origin: top center;
    margin-top: 10px;
  }
}
@media (max-width: 640px) {
  .glass-panel {
    top: calc(6vh + 12px);
    width: 94vw;
    height: calc(100vh - (6vh + 12px) - 112px);
    border-radius: 28px;
  }
  .glass-panel__header { padding: 16px 20px 10px; }
  .glass-panel__divider { margin: 0 20px; }
  .page { padding: 18px 20px 14px; }
  .category-row {
    gap: 4px;
    padding: 8px 10px;
    bottom: 16px;
    max-width: 96vw;
  }
  .row-btn { padding: 9px 10px; font-size: 0.78rem; }
  .row-btn--circle { width: 46px; height: 46px; }
  .row-btn__leaf { width: 22px; height: 22px; }
}

/* reduced motion: keep it premium, kill the drift */
@media (prefers-reduced-motion: reduce) {
  .glass-panel__sheen { animation: none; }
  .ivy-vines path.vine-stem { transition: none; }
}
