/* ============================================================================
   37-membership.css — the member's own column inside the home hero card
   ----------------------------------------------------------------------------
   Paints .mem-show (built by js/modules/core/28-membership.js) into the grid
   cell the Get-Premium pitch normally occupies, and hides that pitch. Only a
   logged-in member with an active grant ever gets here.

   The palette is one variable, --mem, set per tone class on the root:
     .is-ok    lime    — plenty of time, nothing to do
     .is-warn  amber   — inside the last 14 days
     .is-hot   rose    — inside the last 3; the only state that shouts, quietly
     .is-life  violet  — lifetime, no countdown at all
   --mem-ink is the same hue pushed darker for light mode, where the neon
   dark-theme accents fail contrast on a pale card.

   NOTE on transforms: 02-homepage.css:106 sets `transform:translateZ(0)` on
   every direct child of .checker at specificity (0,3,0), which no sane selector
   here can outrank (it already silently overrides .prem-show's own translateZ).
   So nothing below sets a base transform — the entrance keyframe wins for its
   own duration because animations outrank normal declarations, then hands the
   element back. Don't "fix" this by bumping specificity; the 3D lift is not
   worth a selector arms race.
   ============================================================================ */

/* ---- a member is not a sales target ------------------------------------
   The two site-wide Get Premium buttons — header and mobile drawer — are gone
   for anyone who already holds premium, and come back only inside the last
   three days, relabelled "Extend premium" by 28-membership.js. Written as
   "member AND NOT ending" rather than hide-then-show on purpose: in the ending
   state no rule here applies at all, so the button reverts to its normal styling
   AND keeps 13-responsive.css's <=560px hide (where the drawer carries the CTA
   instead). Re-showing it with an explicit display would have overridden that
   and pushed the burger off a 375px screen again. */
body.bd-member:not(.bd-member-ending) > header .actions .btn-primary,
body.bd-member:not(.bd-member-ending) .mobile-menu .mm-premium,
/* Once a member is logged in the drawer's Log in button is hidden too, so the
   whole footer rail would be an empty bordered strip. Take it with them. */
body.bd-member:not(.bd-member-ending) .mobile-menu .mm-foot{ display:none; }

/* the member's column takes the pitch's place, never sits beside it */
.checker.has-member .prem-show{ display:none; }
/* …and the free-tier scarcity meter in the other column ("your account right
   now: 67 / 1,931 — everything past the line is waiting") goes with it. For an
   account that holds all 1,931 it is not just noise, it is wrong. */
.checker.has-member .pv-meter{ display:none; }

.mem-show{
  --mem:     #c6f24e;
  --mem-ink: #c6f24e;
  display:flex; flex-direction:column; height:100%;
  min-width:0;                       /* a grid item's floor is min-content, not 0 */
}
.mem-show.is-warn{ --mem:#f59e0b; --mem-ink:#f59e0b; }
.mem-show.is-hot { --mem:#fb7185; --mem-ink:#fb7185; }
.mem-show.is-life{ --mem:#a78bfa; --mem-ink:#a78bfa; }

:root[data-theme="light"] .mem-show      { --mem:#65a30d; --mem-ink:#4d7c0f; }
:root[data-theme="light"] .mem-show.is-warn{ --mem:#d97706; --mem-ink:#b45309; }
:root[data-theme="light"] .mem-show.is-hot { --mem:#f43f5e; --mem-ink:#be123c; }
:root[data-theme="light"] .mem-show.is-life{ --mem:#7c3aed; --mem-ink:#6d28d9; }

/* ---- header ------------------------------------------------------------- */
.mem-eyebrow{
  display:inline-flex; align-items:center; gap:7px; align-self:flex-start;
  font-size:11px; font-weight:800; letter-spacing:1.3px; text-transform:uppercase;
  color:var(--mem-ink); margin-bottom:13px;
  padding:5px 12px 5px 10px; border-radius:99px;
  background:color-mix(in oklab, var(--mem) 13%, transparent);
  border:1px solid color-mix(in oklab, var(--mem) 38%, transparent);
}
.mem-eyebrow-ic{ font-size:13px; line-height:1; }

.mem-title{
  font-family:'Bricolage Grotesque', 'Native Emoji', sans-serif;
  font-size:25px; line-height:1.14; letter-spacing:-.5px; margin:0 0 6px;
  color:var(--text);
}
.mem-hint{ font-size:13px; line-height:1.5; color:var(--muted); margin:0 0 16px; }

/* ---- the status block: dial on the left, dates on the right -------------- */
.mem-stat{
  position:relative; overflow:hidden;
  display:flex; align-items:center; gap:20px;
  padding:18px 20px; border-radius:18px; margin-bottom:18px;
  background:
    radial-gradient(140px 110px at 13% 50%, color-mix(in oklab, var(--mem) 15%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in oklab, var(--text) 5%, transparent), transparent 60%),
    var(--chip-bg, rgba(255,255,255,.04));
  border:1px solid color-mix(in oklab, var(--mem) 26%, var(--glass-line));
  box-shadow:
    0 18px 44px -30px color-mix(in oklab, var(--mem) 70%, transparent),
    inset 0 1px 0 color-mix(in oklab, #fff 8%, transparent);
}
/* one light sweep as the panel arrives, then never again — the card should feel
   alive on entry, not restless while it is being read */
.mem-stat::after{
  content:''; position:absolute; inset:0; pointer-events:none; opacity:0;
  background:linear-gradient(105deg, transparent 34%,
             color-mix(in oklab, #fff 22%, transparent) 50%, transparent 66%);
}

.mem-ring{ position:relative; flex:0 0 auto; width:104px; height:104px; }
.mem-ring svg{ position:relative; z-index:1; width:100%; height:100%; display:block; overflow:visible; }
/* the bloom behind the dial — bigger and warmer as the days run out */
.mem-ring-aura{
  position:absolute; inset:-14%; border-radius:50%; pointer-events:none;
  background:radial-gradient(circle at 50% 50%,
             color-mix(in oklab, var(--mem) 26%, transparent), transparent 68%);
  filter:blur(9px);
}
.is-hot .mem-ring-aura{ inset:-20%; background:radial-gradient(circle at 50% 50%,
             color-mix(in oklab, var(--mem) 38%, transparent), transparent 66%); }

.mem-g0{ stop-color:color-mix(in oklab, var(--mem) 42%, #ffffff); }
.mem-g1{ stop-color:var(--mem); }

.mem-ring-tr{ fill:none; stroke:color-mix(in oklab, var(--text) 11%, transparent); stroke-width:7.5; }
.mem-ring-arc,
.mem-ring-bloom{
  fill:none; stroke:url(#memArcGrad); stroke-width:7.5;
  transition:stroke-dashoffset 1s cubic-bezier(.2,.7,.2,1);
}
/* a blurred twin under the crisp arc: a drop-shadow filter alone reads flat at
   this stroke width, and blurring the copy keeps the real edge sharp */
.mem-ring-bloom{ filter:blur(5px); opacity:.55; }
.mem-ring-tip{
  fill:#fff; transition:cx .9s cubic-bezier(.2,.7,.2,1), cy .9s cubic-bezier(.2,.7,.2,1);
  filter:drop-shadow(0 0 5px color-mix(in oklab, var(--mem) 90%, transparent));
}
.mem-ring-mid{
  position:absolute; inset:0; z-index:2; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:2px; text-align:center;
}
.mem-ring-mid b{
  font-family:'Bricolage Grotesque', 'Native Emoji', sans-serif;
  font-size:31px; font-weight:800; line-height:1; letter-spacing:-1.4px;
  color:var(--mem-ink); font-variant-numeric:tabular-nums;
  text-shadow:0 0 22px color-mix(in oklab, var(--mem) 45%, transparent);
}
.mem-ring-mid i{
  font-style:normal; font-size:9px; font-weight:800; letter-spacing:.9px;
  text-transform:uppercase; color:var(--muted);
}

.mem-facts{ min-width:0; flex:1; }
.mem-when{
  font-family:'Bricolage Grotesque', 'Native Emoji', sans-serif;
  font-size:16.5px; font-weight:700; letter-spacing:-.2px; color:var(--text);
}
.mem-since{ margin-top:7px; font-size:12.5px; font-weight:600; color:var(--muted); }
/* Stacked, not inline: the bar spans the full width of the card so the term
   reads as a measure of the whole membership rather than a detail beside a date. */
.mem-term{ display:flex; flex-direction:column; align-items:stretch; gap:7px; margin-top:11px; }
/* `display:flex` on a class outranks the UA's `[hidden]{display:none}`, so the
   attribute alone leaves an empty progress bar under a lifetime membership.
   Say it explicitly. */
.mem-term[hidden], .mem-since[hidden]{ display:none; }
.mem-term-bar{
  position:relative; width:100%; height:6px; border-radius:99px; overflow:hidden;
  background:color-mix(in oklab, var(--text) 12%, transparent);
  box-shadow:inset 0 1px 2px rgba(0,0,0,.25);
}
.mem-term-bar i{
  display:block; height:100%; border-radius:99px; width:0;
  background:linear-gradient(90deg, color-mix(in oklab, var(--mem) 40%, transparent), var(--mem));
  box-shadow:0 0 10px color-mix(in oklab, var(--mem) 55%, transparent);
  transition:width 1s cubic-bezier(.2,.7,.2,1);
}
.mem-term-lbl{
  font-size:11.5px; font-weight:700; letter-spacing:.2px; color:var(--muted);
  font-variant-numeric:tabular-nums;
}

/* ---- what stays unlocked ------------------------------------------------ */
.mem-perks{ list-style:none; margin:0 0 18px; padding:0; display:flex; flex-direction:column; gap:6px; }
.mem-perks li{
  display:flex; align-items:center; gap:11px;
  padding:8px 12px 8px 8px; border-radius:13px;
  font-size:13px; font-weight:600; color:var(--text);
  background:color-mix(in oklab, var(--text) 3.5%, transparent);
  border:1px solid transparent;
  transition:background .25s ease, border-color .25s ease, transform .25s cubic-bezier(.2,.7,.2,1);
}
.mem-perks li:hover{
  background:color-mix(in oklab, var(--mem) 9%, transparent);
  border-color:color-mix(in oklab, var(--mem) 26%, transparent);
  transform:translateX(3px);
}
.mem-ic{
  flex:0 0 auto; width:28px; height:28px; border-radius:9px; font-size:15.5px;
  display:inline-flex; align-items:center; justify-content:center;
  background:color-mix(in oklab, var(--mem) 14%, transparent);
  border:1px solid color-mix(in oklab, var(--mem) 24%, transparent);
}
.mem-pk{ flex:1; min-width:0; }
.mem-ok{
  flex:0 0 auto; font-size:11px; font-weight:900; line-height:1;
  color:var(--mem-ink); opacity:.85;
}

/* ---- footer: a link when there's time, a button when there isn't -------- */
.mem-foot{ margin-top:auto; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.mem-link{
  font-size:12.5px; font-weight:700; color:var(--muted); text-decoration:none;
  border-bottom:1px solid transparent; padding-bottom:1px;
  transition:color .2s ease, border-color .2s ease;
}
.mem-link:hover{ color:var(--text); border-bottom-color:color-mix(in oklab, var(--text) 35%, transparent); }

.mem-cta{
  display:inline-flex; align-items:center; gap:8px; text-decoration:none;
  font-size:14px; font-weight:800; padding:11px 20px; border-radius:13px;
  color:var(--mem-ink);
  background:color-mix(in oklab, var(--mem) 14%, transparent);
  border:1px solid color-mix(in oklab, var(--mem) 45%, transparent);
  transition:transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease, background .2s ease;
}
.mem-cta:hover{
  background:color-mix(in oklab, var(--mem) 22%, transparent);
  box-shadow:0 14px 30px -16px color-mix(in oklab, var(--mem) 85%, transparent);
  transform:translateY(-2px);
}
.mem-cta:active{ transform:translateY(0); }
/* Inside the last three days the button stops being a hint and becomes the
   thing you came for — filled, but still no pulsing and no red. */
.mem-cta.is-hot{
  color:#20060d; background:linear-gradient(135deg, #fda4af, var(--mem));
  border-color:transparent;
  box-shadow:0 14px 32px -16px color-mix(in oklab, var(--mem) 90%, transparent);
}
:root[data-theme="light"] .mem-cta.is-hot{ color:#fff; }

/* ---- entrance -----------------------------------------------------------
   Everything arrives once and then holds still. Nothing here loops: a status a
   member reads in passing must not keep moving in the corner of their eye. */
@media (prefers-reduced-motion: no-preference){
  .mem-show.is-in{ animation:memIn .42s cubic-bezier(.2,.7,.2,1) both; }
  .mem-show.is-in .mem-eyebrow{ animation:memIn .5s cubic-bezier(.2,.7,.2,1) .04s both; }
  .mem-show.is-in .mem-stat{ animation:memPop .62s cubic-bezier(.34,1.4,.5,1) .1s both; }
  .mem-show.is-in .mem-stat::after{ animation:memSheen 1.5s cubic-bezier(.3,.1,.3,1) .5s 1; }
  .mem-show.is-in .mem-perks li{ animation:memRow .5s cubic-bezier(.2,.7,.2,1) both;
                                 animation-delay:calc(.3s + var(--i) * .07s); }
  .mem-show.is-in .mem-foot{ animation:memIn .5s ease .58s both; }
  /* the dial fills from empty on arrival — the transition on stroke-dashoffset
     handles every later change on its own */
  .mem-show.is-in .mem-ring-arc,
  .mem-show.is-in .mem-ring-bloom{ animation:memArc 1.15s cubic-bezier(.2,.7,.2,1) .12s both; }
  .mem-show.is-in .mem-ring-tip{ animation:memIn .4s ease .95s both; }

  @keyframes memIn{ from{ opacity:0; transform:translateY(9px); } }
  @keyframes memPop{ from{ opacity:0; transform:translateY(12px) scale(.975); } }
  @keyframes memRow{ from{ opacity:0; transform:translateX(-10px); } }
  @keyframes memArc{ from{ stroke-dashoffset:251.3; } }
  @keyframes memSheen{ from{ opacity:.9; transform:translateX(-115%); }
                       to  { opacity:0;  transform:translateX(115%); } }
}

/* ---- narrow ------------------------------------------------------------- */
@media (max-width:920px){
  /* single-column .checker — the panel now leads the card, so let it breathe */
  .mem-show{ height:auto; }
  .mem-perks{ margin-bottom:16px; }
}
@media (max-width:560px){
  .mem-title{ font-size:22px; }
  .mem-stat{ gap:14px; padding:15px 14px; }
  .mem-ring{ width:84px; height:84px; }
  .mem-ring-mid b{ font-size:25px; letter-spacing:-1px; }
  /* the smaller ring leaves a ~58px chord where the label sits — trim it so it
     never crowds the stroke */
  .mem-ring-mid i{ font-size:8.5px; letter-spacing:.4px; }
  .mem-when{ font-size:13.5px; }
  .mem-foot{ gap:12px; }
  .mem-cta{ padding:10px 16px; font-size:13.5px; }
}
