/* ==========================================================
   RKM VAULT · Membership plans — 1a "The Ledger"
   Load after homepage-style.css (uses its tokens, .container,
   .eyebrow, .section-title, .lead, .btn, .btn-ghost, .reveal,
   .delay-*, .sr-only). Replaces the old .plans-section block.
   ========================================================== */
.ldg {
  --ldg-rule: rgba(184, 147, 109, 0.36);
  --ldg-gold-ink: #7F6345; /* gold deepened for small text on cream (4.9:1) */
  --ldg-pad: 28px;
  --ldg-ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  border-top: 1px solid rgba(184, 147, 109, 0.32);
}
.ldg h3, .ldg p, .ldg li { font-variant-numeric: lining-nums; }

/* Head */
.ldg-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px 80px; align-items: end; margin-bottom: 72px; }
.ldg-head .eyebrow { margin-bottom: 28px; }
.ldg-head .section-title { margin-bottom: 0; }
.ldg-head .section-title em { font-style: italic; color: var(--gold-dark); }
.ldg-head .lead { color: var(--espresso); }
.ldg-legend { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 28px; list-style: none; font: 500 10.5px/1.3 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--espresso); }
.ldg-legend li { display: flex; align-items: center; gap: 12px; }
.ldg-key { flex: none; width: 28px; height: 14px; }
.ldg-key.is-paid { border: 1px solid rgba(154, 122, 88, 0.75); background: rgba(255, 255, 255, 0.55); }
.ldg-key.is-gift { background: var(--gold); }

/* The book */
.ldg-book { border-block: 3px double rgba(184, 147, 109, 0.55); }
.ldg-cols, .ldg-row { display: grid; grid-template-columns: 236px minmax(0, 1fr) 224px; column-gap: clamp(32px, 3.6vw, 56px); padding-inline: var(--ldg-pad); }
.ldg-cols { align-items: end; padding-block: 20px 14px; border-bottom: 1px solid var(--ldg-rule); font: 500 10px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--espresso); }
.ldg-cols > :last-child { text-align: right; }
.ldg-ruler { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 4px; letter-spacing: 0; text-align: center; font-variant-numeric: lining-nums tabular-nums; }
.ldg-ruler span { position: relative; padding-bottom: 11px; }
.ldg-ruler span::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 5px; background: rgba(154, 122, 88, 0.6); }

.ldg-rows { list-style: none; }
.ldg-row { position: relative; grid-template-areas: "term time price" "term time cta"; row-gap: 14px; align-items: center; padding-block: 30px; border-bottom: 1px solid var(--ldg-rule); }
.ldg-row:last-child { border-bottom: 0; }

.ldg-term { grid-area: term; }
.ldg-no { display: block; margin-bottom: 12px; font: italic 400 15px/1 var(--serif); letter-spacing: 0.16em; color: var(--gold-dark); }
.ldg-name { font-size: clamp(28px, 2.6vw, 36px); line-height: 1; letter-spacing: 0; }
.ldg-deal { margin-top: 10px; font: italic 400 21px/1.2 var(--serif); color: var(--ldg-gold-ink); }

/* Month track: 24 half-month columns, shared by every row */
.ldg-time { grid-area: time; min-width: 0; }
.ldg-track { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-template-rows: 22px 30px; column-gap: 4px; }
.ldg-onus { grid-row: 1; justify-self: start; position: relative; padding-left: 9px; font: 600 10px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ldg-gold-ink); white-space: nowrap; }
.ldg-onus::before { content: ""; position: absolute; left: 0; top: 0; bottom: -12px; width: 1px; background: var(--gold); }
.ldg-onus.is-end { justify-self: end; padding: 0 9px 0 0; }
.ldg-onus.is-end::before { left: auto; right: 0; }
.ldg-m { grid-row: 2; grid-column: span 2; position: relative; overflow: hidden; border: 1px solid rgba(154, 122, 88, 0.6); background: rgba(255, 255, 255, 0.5); transform-origin: left center; }
.ldg-m.is-half { grid-column: span 1; }
.ldg-m.is-ghost { border: 1px dashed rgba(154, 122, 88, 0.3); background: transparent; }
.ldg-m.is-gift { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(61, 48, 36, 0.14); }
.ldg-m.is-gift::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 250, 240, 0.75) 50%, transparent 70%); transform: translateX(-130%); }
.ldg-detail { margin-top: 14px; font: 400 13px/1.55 var(--sans); color: var(--espresso); text-wrap: pretty; }

/* Price + action */
.ldg-price { grid-area: price; align-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 12px; font-family: var(--sans); color: var(--espresso-deep); font-variant-numeric: lining-nums tabular-nums; }
.ldg-was { font-size: 15px; font-weight: 400; color: var(--espresso); text-decoration: line-through; text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; }
.ldg-amt { font-size: clamp(36px, 3.2vw, 46px); font-weight: 300; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.ldg-per { margin-left: 4px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--espresso); }
.ldg-cta { grid-area: cta; align-self: start; justify-self: end; padding: 15px 22px; font-size: 11px; letter-spacing: 0.18em; }
.ldg-cta:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }

/* Featured — 12 months */
.ldg-row.is-featured { margin-inline: -16px; padding: 46px calc(var(--ldg-pad) + 16px); background: var(--espresso-deep); border-bottom: 0; box-shadow: 0 40px 80px -40px rgba(42, 32, 24, 0.6); }
.ldg-row.is-featured::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184, 147, 109, 0.42); pointer-events: none; }
.ldg-flag { position: absolute; top: 10px; left: calc(var(--ldg-pad) + 16px); transform: translateY(-50%); padding: 7px 12px; background: var(--gold); color: var(--ink); font: 600 9.5px/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; }
.is-featured .ldg-no, .is-featured .ldg-deal, .is-featured .ldg-onus { color: var(--gold); }
.is-featured .ldg-name, .is-featured .ldg-price { color: var(--cream); }
.is-featured .ldg-was, .is-featured .ldg-per, .is-featured .ldg-detail { color: var(--tan); }
.is-featured .ldg-m { border-color: rgba(201, 181, 154, 0.5); background: rgba(245, 241, 232, 0.06); }
.is-featured .ldg-m.is-gift { border-color: var(--gold); background: var(--gold); }
.ldg-cta-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.ldg-cta-gold:hover { background: var(--cream); border-color: var(--cream); color: var(--ink); transform: translateY(-2px); }
.ldg-cta-gold:focus-visible { outline-color: var(--cream); }

/* Every plan includes + trial note */
.ldg-foot { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px 80px; align-items: start; margin-top: 64px; }
.ldg-foot-title { margin-bottom: 24px; font: 600 10.5px/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ldg-gold-ink); }
.ldg-incl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; list-style: none; }
.ldg-incl li, .ldg-trial { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; font: 400 14px/1.55 var(--sans); color: var(--espresso-deep); }
.ldg-incl svg, .ldg-trial svg { width: 20px; height: 20px; color: var(--gold-dark); }
.ldg-trial { padding-top: 24px; border-top: 1px solid var(--ldg-rule); font-size: 13px; color: var(--espresso); }
.ldg-trial strong { display: block; margin-bottom: 6px; font: 400 23px/1.2 var(--serif); color: var(--espresso-deep); font-variant-numeric: lining-nums; }

/* Motion — rows use the site's .reveal; months fill in, gold glints */
.ldg-row.reveal .ldg-m { transform: scaleX(0); transition: transform 0.5s var(--ldg-ease) calc(0.35s + var(--i, 0) * 0.045s); }
.ldg-row.reveal.in .ldg-m { transform: none; }
.ldg-row.reveal .ldg-onus { opacity: 0; transition: opacity 0.6s ease 1.1s; }
.ldg-row.reveal.in .ldg-onus { opacity: 1; }
.ldg-row.in .ldg-m.is-gift::after { animation: ldg-glint 1.2s ease-out calc(0.95s + var(--i, 0) * 0.045s) forwards; }
.ldg-row.in:hover .ldg-m.is-gift::after { animation: ldg-glint-again 1s ease-out forwards; }
@keyframes ldg-glint { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes ldg-glint-again { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

/* Tablet */
@media (max-width: 1100px) {
  .ldg-cols { display: none; }
  .ldg-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "term price" "term cta" "time time"; row-gap: 12px; }
  .ldg-time { margin-top: 18px; }
}
@media (max-width: 960px) {
  .ldg-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 56px; }
  .ldg-foot { grid-template-columns: minmax(0, 1fr); }
}
/* Phone */
@media (max-width: 640px) {
  .ldg { --ldg-pad: 20px; }
  .ldg-head { margin-bottom: 44px; }
  .ldg-row { grid-template-areas: "term price" "time time" "cta cta"; row-gap: 0; padding-block: 26px; }
  .ldg-price { align-self: start; flex-direction: column; align-items: flex-end; gap: 6px; }
  .ldg-time { margin-top: 22px; }
  .ldg-track { grid-template-rows: 20px 22px; column-gap: 3px; }
  .ldg-cta { justify-self: stretch; justify-content: center; margin-top: 22px; }
  .ldg-row.is-featured { margin-inline: -12px; padding: 40px calc(var(--ldg-pad) + 12px) 32px; }
  .ldg-flag { left: calc(var(--ldg-pad) + 12px); }
  .ldg-incl { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ldg .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ldg .ldg-m, .ldg .ldg-onus { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ldg .ldg-m.is-gift::after { animation: none !important; }
  .ldg-cta-gold:hover { transform: none; }
}
.ldg-incl svg.brass, .ldg-trial svg.brass { width: 24px; height: 24px; filter: drop-shadow(0 1px .5px rgba(42,32,24,.25)); }
