/* ==========================================================================
   sales.css — the home page ladder and the five product sales pages.
   Loaded per page via @section Head, after dea.css, so plain class selectors
   here win ties over the component layer. Colour and type come from tokens;
   no hex values, same rule as dea.css.
   ========================================================================== */

/* --------------------------------------------------- photographic hero */
/* A page hero with a picture behind it. The scrim is directional: heaviest
   where the words are, lightest where the photograph is allowed to be a
   photograph. Any image dropped in here has to keep the headline above 7:1. */
.home-hero--film,
.sale-hero--film,
.page-hero--film { position: relative; isolation: isolate; overflow: hidden; }

.home-hero__bg,
.page-hero__bg {
  position: absolute; inset: 0; z-index: -2;
}
.home-hero__bg img,
.page-hero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 58%;
  display: block;
}
.home-hero__scrim,
.page-hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  /* Anchored on the text, like .sale-hero__scrim and for the same reason.
     The horizontal ramp this replaces dropped to 62% sand at the 60% stop, and
     the headline runs to 60.5% — so its last few characters fell off the shelf
     and sat on bare photograph. Measured 6.35:1 there against a 7:1 house
     floor, and the failing pixel was at 60.3% of the width, which is the shelf
     edge to within a character. A ramp cannot follow a block of text that is
     wide at the top and narrow at the bottom; an ellipse over it can. */
  background:
    radial-gradient(130% 108% at 28% 54%,
      color-mix(in srgb, var(--color-sand) 94%, transparent) 0%,
      color-mix(in srgb, var(--color-sand) 84%, transparent) 46%,
      color-mix(in srgb, var(--color-sand) 28%, transparent) 76%,
      color-mix(in srgb, var(--color-sand) 4%, transparent) 100%),
    linear-gradient(to bottom,
      transparent 46%,
      color-mix(in srgb, var(--color-sand) 38%, transparent) 100%);
}
/* Stacked layouts put the copy over the middle of the picture, so the scrim
   has to become vertical or the headline lands on a mountain. */
@media (max-width: 62rem) {
  .home-hero__scrim,
  .page-hero__scrim {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--color-sand) 95%, transparent) 0%,
      color-mix(in srgb, var(--color-sand) 88%, transparent) 55%,
      color-mix(in srgb, var(--color-sand) 55%, transparent) 100%);
  }
  .home-hero__bg img,
  .page-hero__bg img { object-position: center 70%; }
}

/* A compact version for the interior pages, where the hero is a band rather
   than a full screen. */
.page-hero--film {
  padding-block: clamp(2.5rem, 7vw, 5rem);
  border-bottom: 1px solid var(--color-haze);
}

/* ------------------------------------------------------------ home hero */
.home-hero {
  position: relative;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 7vw, 5rem);
  border-bottom: 1px solid var(--color-haze);
  background:
    radial-gradient(115% 85% at 82% -10%, color-mix(in srgb, var(--color-bolt) 10%, transparent), transparent 58%),
    radial-gradient(80% 60% at -10% 110%, color-mix(in srgb, var(--color-bolt) 8%, transparent), transparent 60%);
}
.home-hero__grid {
  display: grid;
  align-items: center;
  gap: clamp(2.5rem, 6vw, var(--space-8));
  grid-template-columns: minmax(0, 1fr);
}
.home-hero h1 { max-width: 15ch; }
/* The single crimson bolt in the composition. Everything else is gold. */
.home-hero__mark .bolt svg,
.sale-hero__mark .bolt svg {
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--color-bolt) 55%, transparent));
}
.home-hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.home-hero__where {
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  /* Ink on a sand plate of its own. In dusk, straight over the photograph, this
     measured 1.9-2.0:1 at phone widths and 4.4:1 on desktop — and it is the one
     line in the hero that names the three towns, at 10px, with no size to fall
     back on. A plate makes the ground a known colour wherever the picture lands. */
  color: var(--color-ink);
  width: fit-content; max-width: 100%;
  background: color-mix(in srgb, var(--color-sand) 86%, transparent);
  padding: .3rem .55rem; border-radius: 2px;
}
@media (max-width: 62rem) {
  .home-hero__grid { grid-template-columns: 1fr; }
  .home-hero h1 { max-width: none; }

  /* Once the hero stacks, the cover card is orphaned: a full screen of height
     below the call to action, delivering nothing the ladder does not show
     better a moment later — every cover appears there anyway. On a phone it is
     pure scroll cost between the headline and the first real thing. Hidden
     rather than shrunk, because a shrunken decorative card is still a card. */
  .home-hero .frame { display: none; }
  .home-hero { padding-block: clamp(2.25rem, 8vw, 4rem) clamp(2rem, 6vw, 3.5rem); }
}


/* Offset-outline treatment for the one hero image. */
.frame { position: relative; display: block; margin: 0; max-width: 23rem; margin-inline: auto; }
.frame::before {
  content: ""; position: absolute; inset: 1rem -1rem -1rem 1rem;
  border: 1px solid var(--color-sun); border-radius: var(--radius-md); opacity: .55;
}
.frame img {
  position: relative; display: block; width: 100%; height: auto;
  border: 1px solid var(--color-haze); border-radius: var(--radius-md);
  box-shadow: 0 2.5rem 4rem -1.5rem var(--color-sand);
}
.frame__caption {
  position: relative; display: flex; justify-content: space-between;
  gap: var(--space-3); margin-top: var(--space-4); text-decoration: none;
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-dusk);
}
.frame__caption:hover { color: var(--color-ink); }
.frame__caption b { color: var(--color-bolt); font-weight: var(--weight-mono-medium); }

/* The awkward middle: wide enough for two columns, not wide enough for the card
   to hold full size without squeezing the headline measure.
   NOTE the position — this must sit AFTER the .frame declarations above. Placed
   before them it loses the cascade on equal specificity and silently does
   nothing, which is exactly what happened the first time. */
@media (min-width: 62.01rem) and (max-width: 78rem) {
  .home-hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); }
  .home-hero .frame { max-width: 17rem; }
  .home-hero .frame::before { inset: .75rem -.75rem -.75rem .75rem; }
}

/* ---------------------------------------------------------------- creed */
.creed { border-bottom: 1px solid var(--color-haze); }
.creed__grid {
  display: grid; align-items: start;
  gap: var(--space-6);
  grid-template-columns: minmax(0, .68fr) repeat(3, minmax(0, 1fr));
}
.creed__grid > .eyebrow { line-height: 1.7; }
.creed__item {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding-left: var(--space-5); border-left: 1px solid var(--color-haze);
}
.creed__word {
  font-family: var(--font-display); font-weight: var(--weight-display-semi);
  font-size: var(--scale-step-2); line-height: 1; color: var(--color-bolt);
}
.creed__item p { font-size: .95rem; }
@media (max-width: 64rem) { .creed__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) {
  .creed__grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .creed__item { padding-left: var(--space-4); }
}

/* --------------------------------------------------------------- ladder */
.ladder { position: relative; list-style: none; margin: 0; padding: 0; }
/* The rail the rungs hang off. Hidden once the rungs reflow. */
.ladder::before {
  content: ""; position: absolute; left: 1.6rem; top: 2.5rem; bottom: 2.5rem; width: 1px;
  background: linear-gradient(var(--color-haze), var(--color-sun) 30%,
                              var(--color-sun) 70%, var(--color-haze));
}
.ladder__rung { border-top: 1px solid var(--color-haze); }
.ladder__rung:last-child { border-bottom: 1px solid var(--color-haze); }
.ladder__link {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 3.2rem 6.75rem minmax(0, 1fr) auto;
  grid-template-areas: "index cover body price";
  gap: clamp(1rem, 2.5vw, var(--space-6));
  padding-block: clamp(1.25rem, 3vw, var(--space-6));
  padding-inline: var(--space-3);
  margin-inline: calc(var(--space-3) * -1);
  color: inherit; text-decoration: none;
  transition: background-color .18s ease;
}
.ladder__link:hover, .ladder__link:focus-visible {
  background: color-mix(in srgb, var(--color-dune) 75%, transparent);
}
.ladder__index {
  grid-area: index; display: grid; place-items: center;
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  border: 1px solid var(--color-haze); background: var(--color-sand);
  font-size: .72rem; letter-spacing: .08em; color: var(--color-sun-ink);
}
.ladder__link:hover .ladder__index { border-color: var(--color-sun); color: var(--color-bolt); }
.ladder__cover {
  grid-area: cover; display: block; width: 100%; height: auto;
  border: 1px solid var(--color-haze); border-radius: var(--radius-sm);
}
.ladder__body { grid-area: body; display: flex; flex-direction: column; gap: .4rem; }
.ladder__name {
  font-family: var(--font-display); font-weight: var(--weight-display-semi);
  font-size: var(--scale-step-3); line-height: 1.05; color: var(--color-ink);
  letter-spacing: var(--tracking-display);
}
.ladder__link:hover .ladder__name { color: var(--color-bolt); }
.ladder__line { max-width: 44ch; font-size: .95rem; color: var(--color-ink); }
.ladder__price {
  grid-area: price; display: flex; flex-direction: column;
  align-items: flex-end; gap: .3rem; text-align: right;
}
.ladder__amount {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; font-weight: var(--weight-display-black);
  font-size: var(--scale-step-2); line-height: 1; color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.ladder__go {
  font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
  color: var(--color-sun-ink); white-space: nowrap;
}
@media (max-width: 52rem) {
  .ladder::before { display: none; }
  .ladder__link {
    grid-template-columns: 2.75rem 4.5rem minmax(0, 1fr);
    grid-template-areas: "index cover body" "price price price";
    row-gap: var(--space-4);
  }
  .ladder__index { width: 2.75rem; height: 2.75rem; }
  .ladder__price {
    flex-direction: row; flex-wrap: wrap; align-items: baseline;
    justify-content: flex-start; text-align: left; gap: var(--space-3);
  }
}
/* Below ~416px the three columns leave the name about 132px, and "Manifestation"
   alone is 196px at step-3 — it ran off the right edge of a 320px screen. The
   name is a display face, so breaking the word is worse than setting it a step
   smaller; buying back a little from the cover keeps all four rungs intact. */
@media (max-width: 26rem) {
  .ladder__link { grid-template-columns: 2.75rem 3.25rem minmax(0, 1fr); }
  .ladder__name { font-size: var(--scale-step-2); }
}

/* ---------------------------------------------------- free chart reading */
.freeread__panel {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(1.5rem, 4vw, var(--space-7));
  padding: clamp(1.5rem, 4vw, var(--space-7));
}
.freeread__panel h2 { max-width: 18ch; }
@media (max-width: 56rem) { .freeread__panel { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- valley */
.valley__grid {
  display: grid; align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
  gap: clamp(1.5rem, 4vw, var(--space-7));
}
.valley__links {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: var(--tracking-mono-label); text-transform: uppercase;
}
.valley__links a {
  text-decoration: none; padding-bottom: .15rem;
  border-bottom: 1px solid var(--color-haze);
}
.valley__links a:hover { border-bottom-color: var(--color-bolt); }
@media (max-width: 56rem) { .valley__grid { grid-template-columns: 1fr; align-items: start; } }

/* =============================================== product sales page ==== */
.sale-hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--color-haze);
  background: radial-gradient(100% 80% at 88% -20%,
              color-mix(in srgb, var(--color-bolt) 9%, transparent), transparent 60%);
}
.sale-hero__grid {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, .55fr);
  gap: clamp(2rem, 5vw, var(--space-8));
}
.sale-hero h1 { max-width: 14ch; }
.sale-facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.sale-cover { margin: 0; }
.sale-cover img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--color-haze); border-radius: var(--radius-md);
  box-shadow: 0 2rem 3.5rem -1.5rem var(--color-sand);
}
/* ------------------------------ optional photographic sale hero ------- */
/* Same idea as the page hero, retuned for this grid: the copy sits left and
   the cover card sits right, so the scrim is heaviest on the left and thins
   out under the card, where the photograph is allowed to be a photograph.
   The cover is an opaque sand plate, so it reads over any of these. */
.sale-hero--film { background: none; }
/* The quiet jump-link to the price options, on all three paid pages. In dusk it
   measured 3.4-4.2:1 on desktop over the grey haze where the radial scrim meets
   the photograph — worst on the $11.11 Reset. Ink measured 8.4:1 or better at the
   same pixels. The dusk token itself stays: it is right on flat sand. Ink is also
   the default hover colour, so hover needs a cue of its own. */
.sale-hero--film .btn--quiet { color: var(--color-ink); }
.sale-hero--film .btn--quiet:hover { text-decoration: underline; }
.sale-hero__bg { position: absolute; inset: 0; z-index: -2; }
.sale-hero__bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 55%;
  display: block;
}
.sale-hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  /* Anchored where the words are, not across the whole width.
     The previous version was a horizontal ramp that sat at 100% sand to the
     52% mark, which is past the end of the headline: the photograph was
     completely painted out over half the hero and washed to nothing over most
     of the rest, so the band read as an empty sand rectangle.
     The text block measures x 4-60%, y 25-52%. An ellipse centred on it keeps
     the cover behind the words and lets the picture come through above it,
     below it, and to its right — which is the only reason a photograph is
     here. Headline contrast is measured, not assumed; see ops/hero-contrast. */
  background:
    radial-gradient(125% 95% at 26% 38%,
      color-mix(in srgb, var(--color-sand) 93%, transparent) 0%,
      color-mix(in srgb, var(--color-sand) 85%, transparent) 40%,
      color-mix(in srgb, var(--color-sand) 34%, transparent) 70%,
      color-mix(in srgb, var(--color-sand) 5%, transparent) 100%),
    linear-gradient(to bottom,
      transparent 44%,
      color-mix(in srgb, var(--color-sand) 34%, transparent) 100%);
}

/* The dark treatment, for a photograph that has no business being lightened
   into a pastel. Pairs with .on-deep, which does the h1/eyebrow/link colours;
   what is left here is the scrim, the rule hairlines and the two colours
   .on-deep does not reach. */
.sale-hero--deep { background: var(--color-deep); }
.sale-hero--deep .sale-hero__scrim {
  background:
    linear-gradient(100deg,
      color-mix(in srgb, var(--color-deep) 94%, transparent) 0%,
      color-mix(in srgb, var(--color-deep) 90%, transparent) 42%,
      color-mix(in srgb, var(--color-deep) 72%, transparent) 68%,
      color-mix(in srgb, var(--color-deep) 46%, transparent) 100%),
    linear-gradient(to bottom,
      transparent 55%,
      color-mix(in srgb, var(--color-deep) 78%, transparent) 100%);
}
.sale-hero--deep { border-bottom-color: color-mix(in srgb, var(--color-deep-ink) 18%, transparent); }
.sale-hero--deep .lede { color: var(--color-deep-ink); }
.sale-hero--deep .rule::before,
.sale-hero--deep .rule::after { background: color-mix(in srgb, var(--color-deep-ink) 24%, transparent); }
.sale-hero--deep .sale-cover img { border-color: color-mix(in srgb, var(--color-deep-ink) 22%, transparent); }
.sale-hero--deep .sale-cover img { box-shadow: 0 2rem 3.5rem -1.5rem var(--color-deep); }

@media (max-width: 60rem) {
  .sale-hero__grid { grid-template-columns: 1fr; }
  .sale-hero h1 { max-width: none; }
  .sale-cover { max-width: 19rem; }

  /* Stacked, the copy lands over the middle of the picture, so the scrim has
     to run top-to-bottom or the headline ends up on a mountain. */
  .sale-hero__scrim {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--color-sand) 100%, transparent) 0%,
      color-mix(in srgb, var(--color-sand) 99%, transparent) 62%,
      color-mix(in srgb, var(--color-sand) 52%, transparent) 100%);
  }
  .sale-hero--deep .sale-hero__scrim {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--color-deep) 96%, transparent) 0%,
      color-mix(in srgb, var(--color-deep) 92%, transparent) 62%,
      color-mix(in srgb, var(--color-deep) 58%, transparent) 100%);
  }
  .sale-hero__bg img { object-position: center 68%; }
}

.sale-body {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 21.5rem);
  gap: clamp(2rem, 5vw, var(--space-8));
  padding-block: clamp(2.5rem, 7vw, var(--space-8)) clamp(3rem, 8vw, var(--space-9));
}
.sale-buy {
  position: sticky; top: calc(var(--masthead-h, 4.25rem) + 1.25rem);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.sale-buy .prices { grid-template-columns: 1fr; }
.sale-buy form { margin: 0; }
.sale-buy .price .btn { margin-top: .35rem; }
.sale-small { font-size: .82rem; line-height: 1.55; color: var(--color-dusk); }
.sale-small a { color: var(--color-ink); }
.sale-small a:hover { color: var(--color-ink); }
@media (max-width: 60rem) {
  .sale-body { grid-template-columns: 1fr; }
  .sale-buy { position: static; }
}

/* The monthly CTA missed fitting by 0.2px.
   "Join the Association — $77 a month" needs 244.2px in the 244px content box a
   294px rail leaves after 24px of padding each side, so the word "month" wrapped
   alone onto a second line and the button stood 63px tall against the 48px of the
   annual button directly below it — two identically-styled controls, visibly
   different heights, in one viewport.
   Scoped to the buy rail rather than loosening .btn globally, because .btn--block
   is used site-wide and nothing else needs the change. The copy is not the problem:
   "Join the Association" is the right label and shortening it to win a fifth of a
   pixel would be the wrong trade. */
.price .btn--block { padding-inline: 1.35rem; }
