/**
 * Hello Home — "Choose Your Plan".
 *
 * Two cards over a shared feature list. The annual card is the featured one:
 * a red ring and tinted shadow rather than a different fill, so both cards
 * read as the same object with one emphasised.
 */

.hello-plans {
  --hello-pad-x: clamp(20px, 5vw, 80px);
  --hello-pad-y: clamp(72px, 8vw, 128px);
  /**
   * The comp puts its 960px limit on a container INSIDE the padded section,
   * so 960px is the content width. --hello-width caps the padded box, so the
   * padding has to be added back or the cards come out ~160px narrower.
   */
  --hello-width: calc(960px + 2 * clamp(20px, 5vw, 80px));
  background: #fff;
  color: #0d0d0d;
}

.hello-plans .hello-widget__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 4.4vw, 56px);
}

.hello-plans__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  text-align: center;
}

.hello-plans__heading {
  margin: 0;
  font-size: clamp(40px, 4.6vw, 72px) !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  letter-spacing: -1.5px;
  text-wrap: balance;
}

.hello-plans__intro {
  margin: 0;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.55;
  color: #555;
  text-wrap: pretty;
}

/* ---- cards -------------------------------------------------------------- */

.hello-plans__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  align-items: stretch;
  width: 100%;
}

.hello-plans__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(32px, 3.4vw, 44px);
  border-radius: 20px;
  background: #f5f5f5;
  box-shadow: inset 0 0 0 1px #e6e6e6;
}

/* Ring, not a fill: the two cards stay the same object, one emphasised. */
.hello-plans__card.is-featured {
  background: #fff;
  box-shadow: 0 0 0 2px var(--hello-accent), 0 30px 70px rgba(220, 26, 64, 0.18);
}

.hello-plans__badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--hello-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hello-plans__plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hello-plans__plan-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--hello-accent);
}

.hello-plans__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.hello-plans__amount {
  font-size: clamp(56px, 5.6vw, 72px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -2px;
}

.hello-plans__suffix {
  font-size: 20px;
  font-weight: 700;
  color: #555;
}

/* ---- discount ----------------------------------------------------------
 * Not in the comp. The old price sits before the new one at roughly a third
 * the size, struck through and muted, so the eye lands on what is charged
 * today rather than on the number being crossed out.
 * ----------------------------------------------------------------------- */

.hello-plans__was {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  color: #9a9a9a;
  text-decoration-thickness: 2px;
}

.hello-plans__card.is-discounted .hello-plans__amount {
  color: var(--hello-accent);
}

/* ---- special (sale) mode -----------------------------------------------
 * Switched on by .hello-plans--special, which the PHP adds whenever a "was"
 * price is filled in. There is no separate toggle, so this treatment cannot
 * outlive the prices that justify it.
 * ----------------------------------------------------------------------- */

/**
 * The band keeps the page's white.
 *
 * It was inverted to near-black for a while, which did make the section read
 * as an event rather than a decorated price list -- but it is a big, loud
 * change to a block that sells things, and the quieter version turned out to
 * survive a second look better. Everything else here is designed to work on
 * white, so if the dark band is ever wanted back it is a background and a
 * handful of text colours, not a redesign.
 *
 * Gold survives from that pass, because gold is the only thing in the section
 * that means "this is temporary". It is used as FILL and RULE only, never as
 * text: #ffc634 on white is about 1.8:1, so a gold word is a gold-coloured
 * smudge. Gold pill with dark text, gold hairline -- both fine.
 */
.hello-plans--special {
  position: relative; /* anchors the gold top rule below */
}

/* A rule of gold across the top edge, so the band announces itself before any
   of its contents have been read. The one piece of the section visible from
   a scroll away. */
.hello-plans--special::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--hello-gold);
}

/**
 * The old price keeps its muted grey but the line through it goes accent, so
 * it reads as crossed out BY the sale rather than merely de-emphasised. The
 * number and the line carry different information and now look like it.
 */
.hello-plans--special .hello-plans__was {
  text-decoration-color: var(--hello-accent);
  text-decoration-thickness: 3px;
}

/**
 * In special mode the old price takes its own line above the new one.
 *
 * Side by side, "$24.92 $16.59 /mo" wants ~290px and the card has ~250 once
 * the flash's column is reserved, so the suffix wrapped alone and the price
 * read as "$16.59" over "/mo" -- the one number on the page that must not be
 * ambiguous. Stacking gives the headline figure the full width, and the old
 * price above it is the order the eye wants anyway: what it was, then what it
 * is. flex-basis rather than a block: the row is a wrapping flex container,
 * so a full-basis item IS the line break.
 */
.hello-plans--special .hello-plans__was {
  flex: 0 0 100%;
}

/**
 * The campaign name, above the kicker: the most time-limited thing first.
 *
 * Gold fill with dark text, which is the inverse of the flash on the cards.
 * Deliberately: gold cannot be TEXT on this white band (1.8:1), so the pill
 * is the only shape that can carry it at this size, and dark-on-gold is the
 * louder of the two treatments -- right way round, since the campaign is the
 * headline and the per-card percentages are the detail.
 */
.hello-plans--special .hello-plans__special {
  margin: 0;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--hello-gold);
  color: #0d0d0d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

/**
 * The kicker steps back on the sale band.
 *
 * Not a contrast problem here -- accent red on white is fine. It is a
 * hierarchy one: the head now opens with a gold pill, and a red line directly
 * under it makes two competing shouts before the heading gets a word in. Grey
 * lets the pill lead, which is the point of having it.
 */
.hello-plans--special .hello-widget__kicker {
  color: #777;
}

/**
 * The flash: gold on near-black, rotated, top-right of the card.
 *
 * A disc, not the rounded rectangle the badge uses. On the featured card both
 * are on screen together, and two pills half a card apart read as one broken
 * row; a disc is unmistakably a second object. Near-black rather than accent
 * because the featured card is already ringed in accent and a red-on-red
 * flash disappears into it.
 *
 * Gold on #0d0d0d is 9.4:1, so the percentage is legible at this size --
 * which is the whole point, and is where the live page's starburst fails.
 */
.hello-plans__flash {
  position: absolute;
  top: clamp(26px, 2.6vw, 36px);
  right: clamp(14px, 1.6vw, 22px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: #0d0d0d;
  color: var(--hello-gold);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
  transform: rotate(-12deg);
  line-height: 1;
  text-align: center;
}

.hello-plans__flash-pct {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: -1px;
}

.hello-plans__flash-word {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/**
 * The seal: the same disc with a notched edge, for a more retail look.
 *
 * 14 points at 50%/41% radius. The count is the whole design decision. More
 * points and shallower notches turn into texture at this size rather than a
 * shape -- which is the failure the live page's starburst already
 * demonstrates; many fewer and deeper and it stops being a seal and starts
 * being a cartoon explosion.
 *
 * The shadow has to move from box-shadow to filter. clip-path clips the
 * border box AND everything painted from it, so an outer box-shadow is
 * simply removed; drop-shadow() follows the clipped silhouette instead,
 * which is also the only version that looks right around the notches.
 */
.hello-plans__flash--seal {
  clip-path: polygon(
    50.00% 0.00%, 59.12% 10.03%, 71.69% 4.95%, 75.56% 17.94%,
    89.09% 18.83%, 86.94% 32.21%, 98.75% 38.87%, 91.00% 50.00%,
    98.75% 61.13%, 86.94% 67.79%, 89.09% 81.17%, 75.56% 82.06%,
    71.69% 95.05%, 59.12% 89.97%, 50.00% 100.00%, 40.88% 89.97%,
    28.31% 95.05%, 24.44% 82.06%, 10.91% 81.17%, 13.06% 67.79%,
    1.25% 61.13%, 9.00% 50.00%, 1.25% 38.87%, 13.06% 32.21%,
    10.91% 18.83%, 24.44% 17.94%, 28.31% 4.95%, 40.88% 10.03%
  );
  box-shadow: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.3));
}

/**
 * The saving, in money.
 *
 * A percentage is a ratio the reader has to apply to a number they have not
 * been told; "$100 a year" is the number itself. It sits low and small on
 * purpose -- the card already carries one percentage at the top, and the
 * point of this chip is to be the concrete restatement of it, not a second
 * claim competing for the same glance.
 */
.hello-plans__save {
  align-self: flex-start;
  margin: 4px 0 0;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(220, 26, 64, 0.09);
  color: var(--hello-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/**
 * Reserve the flash's column.
 *
 * The flash is positioned out of flow, so without this the price slides
 * underneath it. 90px rather than the flash's full 105: the disc is rotated
 * and its top-right corner sits above the price line, not beside it, so the
 * price only has to clear the lower part of the circle. Only on cards that
 * actually have a flash.
 */
.hello-plans__card.is-discounted .hello-plans__plan {
  padding-right: 90px;
}

.hello-plans__billed {
  font-size: 16px;
  font-weight: 500;
  color: #555;
}

.hello-plans__card .hello-btn.hello-plans__cta {
  width: 100%;
  height: 60px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
  margin-top: auto; /* notes align across cards of unequal copy length */
}

/**
 * The monthly card's button is outlined in near-black, not the shared ghost
 * variant's grey fill -- it has to read as the quieter of two choices while
 * still looking like a real button on a grey card.
 */
.hello-plans__card:not(.is-featured) .hello-btn.hello-plans__cta {
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 0 0 2px #0d0d0d;
  color: #0d0d0d;
}
.hello-plans__card:not(.is-featured) .hello-btn.hello-plans__cta:hover,
.hello-plans__card:not(.is-featured) .hello-btn.hello-plans__cta:focus-visible {
  background: #0d0d0d;
  color: #fff;
}

.hello-plans__note {
  margin: -8px 0 0;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* ---- shared feature list ------------------------------------------------ */

.hello-plans__features {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding-top: clamp(8px, 1vw, 16px);
}

.hello-plans__features-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #666;
}

.hello-plans__feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px 32px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hello-plans__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #0d0d0d;
}

/* Filled disc with a glyph, not the bare stroke the shared checklist uses. */
.hello-plans__feature-tick {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hello-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

/* ---- trust row ----------------------------------------------------------
 * Separated from the features by a hairline rule, and deliberately plain --
 * no ticks. These are reassurances, not features, and the comp keeps the
 * two treatments distinct.
 * ----------------------------------------------------------------------- */

.hello-plans__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  width: 100%;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid #e6e6e6;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

@media (max-width: 767px) {
  .hello-plans__cards {
    gap: 32px; /* room for the badge, which overhangs the card top */
  }
  .hello-plans__feature-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/**
 * On a phone the disc stops working: the card is ~300px of content and the
 * price alone wants most of it, so reserving 96px for a flash squeezes the
 * headline figure to the point of wrapping mid-number.
 *
 * So the flash stops being a corner object and becomes a flat tag in the
 * flow, above the plan name. position:static drops it into the card's own
 * flex column, which is why no ordering rule is needed -- it is the first
 * child after the badge.
 */
@media (max-width: 599px) {
  /**
   * The card centres on a phone.
   *
   * Left-aligned, a full-width card leaves the plan name, the price and the
   * billed line hanging off a rail on the left with a lot of empty card to
   * their right, while the button and the small print underneath are already
   * centred -- two alignments in one box. At desktop the cards sit side by
   * side and left alignment is what lets the eye compare two prices down a
   * column; stacked, there is no column to compare down, so that reason goes
   * away and the mixed alignment is all that is left.
   *
   * The button keeps its own width:100%, which still resolves against the
   * card rather than shrinking to its label, so centring the box does not
   * un-stretch it.
   */
  .hello-plans__card {
    align-items: center;
    text-align: center;
  }

  .hello-plans__plan {
    width: 100%;
    align-items: center;
  }

  .hello-plans__price {
    justify-content: center;
  }

  .hello-plans__flash {
    position: static;
    align-self: center;
    flex-direction: row;
    gap: 9px;
    width: auto;
    height: auto;
    padding: 9px 19px;
    border-radius: 999px;
    box-shadow: none;
    transform: none;
  }

  .hello-plans__flash-pct {
    font-size: 19px;
    letter-spacing: 0;
  }

  .hello-plans__flash-word {
    margin-top: 0;
    font-size: 16px;
  }

  /* The seal is a disc treatment. Here the flash is a flat pill, and a
     notched pill is just a damaged pill. */
  .hello-plans__flash--seal {
    clip-path: none;
    filter: none;
  }

  .hello-plans__save {
    align-self: center;
  }

  .hello-plans__card.is-discounted .hello-plans__plan {
    padding-right: 0;
  }
}
