/* Pricing page: white, black and the ticker green, with the Figma
   "see plans" pill buttons. Shares the top bar and logo with styles.css.

   Fits one screen with no scrolling: everything below the nav is sized in
   --p, one design pixel scaled so the 1440 × 845 content area (a little
   more than 900 tall minus the 106px nav) fits whichever of width or height is tighter.
   The cards then stretch to fill whatever height is left. */
:root {
  --p: min(100vw / 1440, (100vh - var(--nav-h)) / 845);
  --border: calc(6 * var(--p));
}

.plans-page {
  position: relative;
  /* At least one screen tall; grows when the cards need more room, so the
     line under them never gets covered. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--nav-h) var(--pad) calc(28 * var(--p));
}

.nav__link[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: calc(4 * var(--u));
  text-underline-offset: calc(8 * var(--u));
}

/* Heading row: big serif "plans" left; lede and billing toggle right. */
.plans-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: calc(4 * var(--p)) 0 calc(42 * var(--p));
}
.plans-title {
  font-family: 'Gambarino', serif;
  font-weight: 400;
  font-size: calc(160 * var(--p));
  letter-spacing: -.05em;
  line-height: 0.8;
}
.plans-intro__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(20 * var(--p));
}
.plans-lede {
  font-family: 'Gambarino', serif;
  font-size: calc(36 * var(--p));
  letter-spacing: calc(-1.6 * var(--p));
  line-height: 1.05;
  text-align: right;
}

/* Monthly / yearly segmented toggle. */
.billing {
  display: flex;
  border: calc(4 * var(--p)) solid var(--black);
  border-radius: 999px;
  padding: calc(4 * var(--p));
}
.billing input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.billing label {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--p));
  padding: calc(8 * var(--p)) calc(22 * var(--p));
  border-radius: 999px;
  font-family: 'Gambarino', serif;
  font-size: calc(24 * var(--p));
  letter-spacing: calc(-0.6 * var(--p));
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.billing input:checked + label {
  background: var(--black);
  color: var(--white);
}
.billing input:focus-visible + label {
  outline: calc(3 * var(--p)) solid var(--green);
  outline-offset: calc(2 * var(--p));
}
.billing__save {
  padding: calc(2 * var(--p)) calc(10 * var(--p));
  border-radius: 999px;
  background: var(--green);
  color: var(--black);
  font-size: calc(18 * var(--p));
}

/* Plan cards: stretch to fill the rest of the screen. */
.plan-list {
  flex: 1;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(24 * var(--p));
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: calc(24 * var(--p)) calc(34 * var(--p));
  border: var(--border) solid var(--black);
  border-radius: calc(44 * var(--p));
  background: var(--white);
}
.plan--featured { background: var(--green); }

.plan__badge {
  position: absolute;
  top: calc(-24 * var(--p));
  right: calc(30 * var(--p));
  padding: calc(5 * var(--p)) calc(18 * var(--p));
  border: calc(4 * var(--p)) solid var(--black);
  border-radius: 999px;
  background: var(--white);
  font-family: 'Gambarino', serif;
  font-size: calc(24 * var(--p));
  letter-spacing: calc(-0.5 * var(--p));
}
.plan__badge--green { background: var(--green); }

.plan__name {
  font-family: 'Gambarino', serif;
  font-weight: 400;
  font-size: calc(64 * var(--p));
  letter-spacing: calc(-3 * var(--p));
  line-height: 0.9;
}

/* Name on the left, input limit on the right, faint black. */
.plan__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(16 * var(--p));
}
.plan__limit {
  font-family: 'Gambarino', serif;
  font-size: calc(22 * var(--p));
  letter-spacing: calc(-0.5 * var(--p));
  color: var(--black);
  opacity: 0.6;
  white-space: nowrap;
}

.plan__price { margin-top: calc(18 * var(--p)); }
.price {
  display: flex;
  align-items: baseline;
  gap: calc(12 * var(--p));
}
/* Prices follow the billing toggle. */
.price.price--yearly { display: none; }
.plans-page:has(#billing-yearly:checked) .price.price--monthly { display: none; }
.plans-page:has(#billing-yearly:checked) .price.price--yearly { display: flex; }

.plan__amount {
  font-family: 'Vina Sans', sans-serif;
  font-size: calc(124 * var(--p));
  letter-spacing: calc(-3 * var(--p));
  line-height: 0.8;
}
.plan__per {
  font-family: 'Gambarino', serif;
  font-size: calc(26 * var(--p));
  letter-spacing: calc(-1 * var(--p));
}


/* Two thin black lines, echoing the landing page ticker band. */
.plan__rule {
  height: calc(14 * var(--p));
  margin: calc(16 * var(--p)) 0 calc(14 * var(--p));
  border: 0;
  border-top: calc(3 * var(--p)) solid var(--black);
  border-bottom: calc(3 * var(--p)) solid var(--black);
}

.plan__features {
  list-style: none;
  display: grid;
  gap: calc(5 * var(--p));
  margin-bottom: calc(20 * var(--p));
  font-family: 'Gambarino', serif;
  font-size: calc(26 * var(--p));
  letter-spacing: calc(-0.8 * var(--p));
  line-height: 1.15;
}
.plan__features li {
  display: flex;
  gap: calc(12 * var(--p));
}
.plan__features li::before {
  content: '•';
  color: var(--green);
}
.plan--featured .plan__features li::before { color: var(--black); }
.plan__features .plan__feature--fwd { color: var(--purple); align-items: center; }
.plan__features .plan__feature--deep { align-items: center; }

/* Info icon (Lucide "info") with a tooltip explaining fwd mode, on hover or keyboard focus. */
.info {
  position: relative;
  display: inline-flex;
}
.info__icon {
  display: grid;
  place-items: center;
  width: 0.85em;
  height: 0.85em;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit; /* buttons don't inherit font-size; the em sizes need it */
  cursor: help;
}
.info__icon svg {
  width: 100%;
  height: 100%;
}
.info__tip {
  position: absolute;
  right: calc(-12 * var(--p));
  bottom: calc(100% + 12 * var(--p));
  z-index: 3;
  width: calc(340 * var(--p));
  padding: calc(14 * var(--p)) calc(18 * var(--p));
  border-radius: calc(18 * var(--p));
  background: var(--black);
  color: var(--white);
  font-size: calc(19 * var(--p));
  letter-spacing: calc(-0.3 * var(--p));
  line-height: 1.3;
  opacity: 0;
  transform: translateY(calc(6 * var(--p)));
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.info.is-open .info__tip, .info__icon:focus-visible + .info__tip {
  opacity: 1;
  transform: none;
}
@media (min-width: 701px) {
  .info:hover .info__tip {
    opacity: 1;
    transform: none;
  }
}

/* Pill buttons use the shared .pill-button (styles.css), sized in --p. */
.plans-page .pill-button { --pill-u: var(--p); }

/* Mobile: the page scrolls and the plans stack, at a readable fixed size. */
@media (max-width: 700px) {
  :root { --p: 0.72px; }

  .plans-page {
    height: auto;
    overflow: visible;
    padding: 0 var(--pad) 40px;
  }
  .plans-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin: 18px 0 44px;
  }
  .plans-title { font-size: 64px; line-height: .9; }
  .plans-intro__side { align-items: flex-start; gap: 16px; }
  .plans-lede { text-align: left; }

  .plan-list {
    flex: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .plan { padding: 24px 22px; }
  .plan__features { margin-bottom: 24px; }

  /* The tooltip spans the card, so it can't run off the screen. */
  .info { position: static; }
  .plan__feature--fwd, .plan__feature--deep { position: relative; }
  .info__tip {
    left: 0;
    right: 0;
    width: auto;
    bottom: calc(100% + 10px);
    font-size: 16px;
    letter-spacing: -0.2px;
    padding: 12px 14px;
    border-radius: 14px;
  }
  /* A larger tap target around the small icon. */
  .info__icon { position: relative; }
  .info__icon::after {
    content: '';
    position: absolute;
    inset: -12px;
  }
}

/* Prices: a curved, hand-drawn marker stroke (added and sized by plans.js) is drawn
   behind the number, overshoots slightly and settles at a jaunty angle. */
.plan__amount {
  --hl: rgba(31, 191, 92, .6);
  position: relative;
  isolation: isolate;
  display: inline-block;
}
.plan--featured .plan__amount { --hl: rgba(255, 255, 255, .85); }
.swoosh {
  position: absolute;
  z-index: -1;
  top: .016em;
  left: -.06em;
  height: .85em;
  overflow: visible;
  pointer-events: none;
  transform: rotate(-3deg);
  transition: transform 520ms cubic-bezier(.3, 1.9, .5, 1);
}
.swoosh path {
  fill: none;
  stroke: var(--hl);
  stroke-width: 36;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 520ms cubic-bezier(.6, 0, .2, 1);
}
.motion .plan__amount:not(.is-lit) .swoosh { transform: rotate(3deg) scale(.92); }
.motion .plan__amount:not(.is-lit) .swoosh path { stroke-dashoffset: 1; }

/* Only fwd mode gets a feature highlight. */
.plan__key {
  --hl: rgba(122, 63, 224, .18);
  padding: 0 .18em;
  margin-left: -.18em;
  border-radius: 2px;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat left 72% / 100% 56%;
  transition: background-size 460ms cubic-bezier(.6, 0, .2, 1);
}
.motion .plan__key:not(.is-lit) { background-size: 0% 56%; }

/* Choosing a plan (plans.js): the button turns orange, then that shape spreads
   across the screen, revealing the payment page on the layer beneath the clip. */
.plan .pill-button.is-chosen { background: var(--orange); }
.plan .pill-button > * { transition: opacity 110ms ease; }
.plan .pill-button.is-chosen > * { opacity: 0; }
.flood {
  position: fixed;
  inset: 0;
  z-index: 1001;
  overflow: hidden;
  background: var(--orange);
  pointer-events: none;
  will-change: clip-path;
}

/* Under all three plans. */
.plans-more {
  flex: none;
  margin: calc(20 * var(--p)) 0 calc(10 * var(--p));
  font-family: 'Gambarino', serif;
  font-size: calc(26 * var(--p));
  letter-spacing: calc(-.8 * var(--p));
  line-height: 1.15;
  text-align: center;
}
.plans-more a {
  color: inherit;
}

/* ── Logged in: current plan, disabled button, confirm panel ───────────── */
.plan--current { box-shadow: 0 calc(10 * var(--p)) 0 var(--black); }
.plan__badge[hidden] { display: none; }
.plan--current .plan__badge { background: var(--orange); }
.plans-page .pill-button.is-disabled,
.plans-page .pill-button.is-disabled:hover {
  width: 80%;
  background: transparent;
  opacity: .6;
  cursor: default;
}
.plans-page .pill-button.is-disabled:hover .pill-button__arrow { transform: none; }

.confirm {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .8);
  padding: 20px;
}
.confirm__card {
  --p: min(100vw / 1440, 100vh / 900);
  width: min(calc(760 * var(--p)), 100%);
  padding: calc(40 * var(--p)) calc(48 * var(--p));
  border: calc(6 * var(--p)) solid var(--black);
  border-radius: calc(44 * var(--p));
  background: var(--green);
  box-shadow: 0 calc(10 * var(--p)) 0 var(--black);
  font-family: 'Gambarino', serif;
  font-size: max(16px, calc(28 * var(--p)));
  letter-spacing: -.02em;
  line-height: 1.2;
}
.confirm__title { font-weight: 400; font-size: calc(72 * var(--p)); letter-spacing: -.04em; line-height: 1; margin-bottom: .3em; }
.confirm__list { margin: .6em 0 .8em 1.2em; }
.confirm__warn { font-size: 1.05em; }
.confirm__warn { box-shadow: inset 0 -.4em 0 rgba(255, 255, 255, .6); display: inline; }
.confirm__actions { display: flex; align-items: center; gap: calc(30 * var(--p)); margin-top: calc(28 * var(--p)); }
.confirm .pill-button { --pill-u: var(--p); width: auto; margin-top: 0; background: var(--white); cursor: pointer; }
.confirm .pill-button:focus-visible, .confirm .pill-button:hover { width: auto; background: var(--orange); }
.confirm__back { border: 0; background: none; font: inherit; letter-spacing: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .16em; }
.confirm__back:hover, .confirm__back:focus-visible { text-decoration-thickness: .13em; }
.plans-page .pill-button.is-disabled .pill-button__arrow { visibility: hidden; }

/* The plan a locked card or sign-in sent you to. */
.plan--target { box-shadow: 0 0 0 calc(8 * var(--p)) var(--orange); }

/* Footer on this page: the link block sits a touch lower, so it is evenly
   spaced between the plans text above and the bottom of the screen. */
.site-footer--plans .site-footer__links { top: calc(88 * var(--u)); }

@media (max-width: 700px) {
  .site-footer--plans .site-footer__links { top: 32px; }   /* phone footer position unchanged */
}
