/*
 * Zoey Made — homepage.
 *
 * The production structure of `/`, rebuilt by SL-012 to the approved direction: hero, the four
 * things to try, products, something to try together, made by Zoey. The locked rule this file is
 * still written against is STORE-002's, and D5's amendment did not change it:
 *
 *   playful details surrounded by calm white space.
 *
 * What changed is where the words come from. Until SL-012 every sentence on this page was in
 * `front-page.html`; now each region is a dynamic block reading post meta from the Home page, so
 * this file styles markup it does not contain. Nothing about the band convention moved, and that is
 * deliberate — see the next comment for why a server-rendered section cannot use core's alignment.
 *
 *   templates/front-page.html   the bands, in order, and the one anchor target
 *   inc/home/landing.php        what is inside them
 *   this file                   appearance
 *
 * It loads on the front page and nowhere else. See docs/CSS-AND-ASSETS.md.
 */

.zoey-home {
  /* The site's block gap sits between the header and whatever follows it, which is right for a
     page of content and wrong for a page that opens on artwork: it left a strip of the body's own
     background under the sticky header. The hero starts where the header ends. */
  margin-block-start: 0;
}

/*
 * The section bands.
 *
 * Every section is full-bleed and sets its own inline padding; every section's inner wrapper holds
 * the content to a readable width. That is deliberate rather than incidental: these sections are
 * rendered by PHP rather than written into the template, and WordPress's own alignment CSS is keyed
 * to layout classes it generates per container, with a hash in the name. A server-rendered section
 * cannot join in without copying that hash, so nothing here asks it to — the homepage owns its own
 * bands, and they behave identically whatever rendered them.
 *
 * **No width is declared here.** `--wp--style--global--wide-size` is the shared page layout's, and
 * SPL-001's rule that a feature stylesheet does not get to decide how wide the page is holds for
 * this one too. The reading measure below is applied to prose and never to a column.
 *
 * Vertical rhythm is the sections' own padding — <main> sets no block gap — so a section that is
 * not rendered leaves no gap behind it. That is what lets the products region disappear entirely,
 * when nothing is Featured, without the page needing to know it was ever there.
 */
.zoey-home-hero,
.zoey-home-paths,
.zoey-home-products,
.zoey-home-project,
.zoey-home-made-by,
.zoey-home-newsletter {
  padding-block: var(--wp--preset--spacing--80);
  padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}

.zoey-home-hero__inner,
.zoey-home-paths__inner,
.zoey-home-products__inner,
.zoey-home-project__inner,
.zoey-home-made-by__inner {
  max-inline-size: var(--wp--style--global--wide-size);
  margin-inline: auto;
}

/* The newsletter band has no `__inner` of its own — SL-014.
 *
 * Every other band wraps its content in a div this file can constrain. The signup panel is a
 * `zoey_made_surface()` composition that arrives whole from `inc/home/email-signup.php`, and
 * putting a wrapper around it here would mean the homepage owning part of a component it did not
 * build. So the band constrains the surface directly, to the same wide-size and the same centred
 * margin the other four use.
 *
 * **Measured before and after**: without this the panel rendered 1440px wide at `left: 0` while
 * its neighbours sat in a 1240px column — the lavender paper ran edge to edge and the composition
 * stretched, leaving the content column stranded beside a large empty field. The panel's own
 * stylesheet is deliberately untouched: `email-signup.css` is the approved component and is shared
 * with the proof surface, where the panel is already correct. */
.zoey-home-newsletter > .zoey-surface {
  max-inline-size: var(--wp--style--global--wide-size);
  margin-inline: auto;
}

/* The bands alternate so each region reads as its own stage. The hero carries artwork rather than
   a ground, so it declares none and the backdrop paints it. */
.zoey-home-paths,
.zoey-home-project {
  background-color: var(--wp--preset--color--surface-soft);
}

.zoey-home-products,
.zoey-home-made-by {
  background-color: var(--wp--preset--color--surface);
}

/* Last band, and it alternates like the rest: `made-by` above it is `surface`, so this is
   `surface-soft`. The lavender paper is the panel's own ground and sits on top of this one. */
.zoey-home-newsletter {
  background-color: var(--wp--preset--color--surface-soft);
}

/* A section heading, centred over whatever the section holds, capped at the measure so it never
   runs the full width of a wide screen. */
.zoey-home-section__title {
  max-inline-size: var(--wp--custom--measure);
  margin-block: 0 var(--wp--preset--spacing--60);
  margin-inline: auto;
  font-size: var(--wp--preset--font-size--section-title);
  text-align: center;
  text-wrap: balance;
}

/* --- The hero --------------------------------------------------------------------- */

/*
 * The one composition this story owns.
 *
 * `COMPONENT-MAP.md` allowed an *"own art-directed homepage composition only if supported slots
 * cannot express approved layering"*, and this is that case: `page-intro.css`'s illustrated variant
 * has one media slot and no concept of a layer, while the approved hero is a full-bleed backdrop
 * with three independently placed things over it, two of which are interactive controls owned by
 * the discovery system. So the *arrangement* is here and every *part* of it is a shared component.
 *
 * `isolation` rather than a z-index ladder: the backdrop is the only thing that needs to sit behind,
 * and a stacking context means the rest of the page cannot be reached by anything in here.
 */
.zoey-home-hero {
  position: relative;
  isolation: isolate;
  padding-block-start: var(--wp--preset--spacing--70);
  background-color: var(--wp--preset--color--surface-soft);
}

/*
 * The backdrop.
 *
 * `cover` and centred, which is what the approved proofs' own `preserveAspectRatio="…slice"` does,
 * so the crop the composition was reviewed at is the crop the page paints. Measured against the
 * delivered masters: at a 1440x800 slot the landscape master loses 16.7% of its height, and at
 * 390x850 the portrait master loses 31.2% of its width. Both were authored for that.
 *
 * It is a real `<img>` inside a `<picture>` rather than a background-image, for the reason
 * `docs/CSS-AND-ASSETS.md` gives: a background is not there under forced colors. Scenery surviving
 * or not surviving is less important than the words over it, which is why the scrim below does not
 * depend on the picture being painted.
 */
.zoey-home-hero__backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: block;
}

.zoey-home-hero__backdrop-image {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center;
}

/*
 * The scrim, and why it is not optional.
 *
 * The copy is Ink over a photographic illustration whose local lightness this stylesheet cannot
 * know. A gradient in the section's own ground colour, strongest where the words are and clear
 * where the artwork is, is what keeps the text contrast a property of the page rather than a
 * property of whichever crop a viewport happened to take. It is a token colour at varying alpha, so
 * it introduces no second palette.
 *
 * Under forced colors the scrim is removed entirely: the canvas colour is already opaque behind the
 * text there, and a translucent layer over it would only mute the system's own contrast.
 */
.zoey-home-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background-image: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--wp--preset--color--surface-soft) 92%, transparent) 0%,
    color-mix(in srgb, var(--wp--preset--color--surface-soft) 72%, transparent) 55%,
    color-mix(in srgb, var(--wp--preset--color--surface-soft) 38%, transparent) 100%
  );
}

@media (min-width: 900px) {
  .zoey-home-hero::before {
    background-image: linear-gradient(
      to right,
      color-mix(in srgb, var(--wp--preset--color--surface-soft) 94%, transparent) 0%,
      color-mix(in srgb, var(--wp--preset--color--surface-soft) 80%, transparent) 46%,
      color-mix(in srgb, var(--wp--preset--color--surface-soft) 20%, transparent) 100%
    );
  }
}

.zoey-home-hero__inner {
  position: relative;
  display: grid;
  gap: var(--wp--preset--spacing--50);
  align-items: center;
}

/*
 * Desktop: quiet copy left, art right. Phone: copy above art.
 *
 * `minmax(0, …)` on both tracks because the art column holds an image with intrinsic dimensions,
 * and a `1fr` track whose content has a natural width will not shrink below it — which is how a
 * two-column hero becomes a horizontally scrolling page at 900px exactly.
 */
@media (min-width: 900px) {
  .zoey-home-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--wp--preset--spacing--60);
    min-block-size: 32rem;
  }
}

.zoey-home-hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--30);
  /* Prose, not a column: the measure constrains the sentences and the grid track decides the
     layout. SPL-001's distinction, applied where it matters most on the page. */
  max-inline-size: var(--wp--custom--measure);
}

.zoey-home-hero__station {
  margin: 0;
  color: var(--wp--preset--color--ink-soft);
  font-family: var(--wp--preset--font-family--accent);
  font-size: var(--wp--preset--font-size--section-small);
  line-height: 1.2;
}

.zoey-home-hero__title {
  margin: 0;
  font-size: var(--wp--preset--font-size--page-title);
  line-height: 1.1;
  text-wrap: balance;
}

.zoey-home-hero__lede {
  margin: 0;
  color: var(--wp--preset--color--ink-soft);
  font-size: var(--wp--preset--font-size--section-small);
}

.zoey-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--30);
  margin-block-start: var(--wp--preset--spacing--20);
}

/*
 * The hint. Quieter than the lede and deliberately not a control: it says that secrets exist and
 * never says where one is, which is DISCOVERY-005 §26's rule about clues applied to the page that
 * carries four of them.
 */
.zoey-home-hero__hint {
  margin: 0;
  color: var(--wp--preset--color--ink-soft);
  font-family: var(--wp--preset--font-family--accent);
  font-size: var(--wp--preset--font-size--body);
}

/*
 * The art column.
 *
 * `position: relative` is the hero's two secrets' containing block. They are placed against this
 * box rather than against the viewport, so nothing here is a screenshot coordinate: the box grows
 * and shrinks with the artwork, and the controls travel with it.
 */
.zoey-home-hero__art {
  position: relative;
  display: flex;
  justify-content: center;
  /*
   * **The predecessor's fix, kept.** A grid item's automatic minimum size is its content's, so a
   * column holding an image with intrinsic dimensions refuses to shrink below that image — which
   * is how a two-column hero becomes a horizontally scrolling page. The hero this one replaced
   * carried the same declaration on `__visual`, and `content.mjs` asserts it; the assertion found
   * its absence here, which is exactly what an inherited assertion is for.
   *
   * `minmax( 0, 1fr )` on the track above and `max-inline-size: 100%` on the artwork both help,
   * but neither releases the *item's* own automatic minimum. This does.
   */
  min-inline-size: 0;
}

@media (min-width: 900px) {
  .zoey-home-hero__art {
    justify-content: flex-end;
  }
}

.zoey-home-hero__bubbles {
  inline-size: auto;
  max-inline-size: 100%;
  /* The height cap is the `arrival` step in components/character.css — 22rem, then 35rem from
     900px. It is not repeated here, because one length declared twice is two owners. */
  block-size: auto;
}

/*
 * The star and the door, as independent layers.
 *
 * SL-013 owns their artwork and their final positions; this is the interim placement that keeps
 * them working, which `AC-09` requires and the assignment asked for explicitly. They sit at the
 * trailing edge of the art box, clear of Bubbles' face and clear of every word — §80's rule that a
 * placement which only works at one text size is not a placement is why they are anchored to the
 * artwork rather than to the copy, which is the thing that reflows.
 *
 * The DOM order is **star then door**, which is the order DISCOVERY-005 introduces them in — the
 * star is its first production discovery (§9) and the door its last and deepest (§40) — and so the
 * order the keyboard meets them in. The paint order is the same, which puts the quieter, deeper
 * secret lower: the difficulty-from-position argument §50 makes.
 */
.zoey-home-hero__secrets {
  position: absolute;
  z-index: 1;
  /*
   * A layer over the **whole hero**, not over the character column.
   *
   * The first build nested this inside `__art` and anchored both secrets to fractions of the
   * Bubbles box. On a phone that box *is* Bubbles — 350px of a 390px viewport — so every fraction
   * of it landed on her, and the door read as something stuck to her head. `hero-mobile.svg` is
   * explicit that it is not: it puts the door at x 272 of 390, outside a Bubbles box that ends at
   * 350, sitting in the workshop behind her.
   *
   * So the anchors below are fractions of the **hero**, taken from each proof at its own
   * breakpoint, and the layer places nothing itself.
   *
   * `pointer-events: none` here and `auto` on each secret, so a transparent sheet over the
   * artwork never swallows a press meant for the page — the trade `discovery-reveal.css` already
   * makes for its own frame.
   */
  inset: 0;
  pointer-events: none;
}

.zoey-home-hero__secret {
  position: absolute;
  pointer-events: auto;
}

/*
 * **The phone anchors measure from the bottom, and that is the fix for enlarged text.**
 *
 * They were `inset-block-start: 56%` and `69%` of the hero, which is where the proof puts them —
 * and at a doubled root the hero grows from 809px to 1606px because the *copy* grows, while the
 * artwork stays the same size at the foot of it. A fraction measured from the top therefore walks
 * up into the sentences: measured, both secrets landed on the text at 390 and at 320.
 *
 * Measured from the **bottom** they track the artwork instead, because on a phone the artwork is
 * always the last thing in the hero. The same two numbers hold at 16px and at 32px.
 *
 * The two anchors, and why they are **not** the proofs' coordinates exactly.
 *
 * `hero-mobile.svg` puts the door at x 272 of 390 with Bubbles at x 0-350. Her painted alpha
 * bounds are 12.1%-86.0% of that square, so her paint ends at x 301 — and the proof's door spans
 * 272-388, overlapping about 29px of her. The desktop proof is close to her shoulder for the same
 * reason. Product's instruction is **clear separation from the character and text**, which is a
 * refinement on the boards rather than a reading of them, so these anchors are solved against the
 * measured painted bounds and the measured text boxes at every breakpoint instead.
 *
 * What is kept from the proofs is the *reading*: both secrets live in the workshop scenery on the
 * trailing side — the shelf, the pencil pot and the cork board behind her — with the star above
 * and the smaller, deeper door below it. The exact live placement is still Product's to review at
 * actual size, which `D4` says in as many words.
 */
/*
 * ## 48px of artwork, which is not the same as a 48px box
 *
 * Product asked for the hero secrets at 48px of **visible** artwork. The derived squares are not
 * fully painted — `scripts/dev/sl-013-artwork.py` crops each master to its content and then pads
 * the square by 6% a side so a mark in the corner does not crowd the drawing — so the painted
 * part measures 89% of the box:
 *
 *     star              171 x 158 of 192   ->  89.1%
 *     door composited   154 x 172 of 192   ->  89.6%
 *
 * A 48px slot would therefore have painted about 43px, which is the error the instruction names.
 * The slot is 54px, and the artwork measures **48.1px (star)** and **48.4px (door)**.
 *
 * The target matches the slot rather than staying at the family's 44px minimum: an object may not
 * be larger than the thing you press to get it.
 */
.zoey-home-hero__secret .zoey-discovery-object {
  --zoey-discovery-object-size: 3.375rem;

  /*
   * The star draws itself from its own variable rather than the family's — its artwork predates
   * the family — so both are set. Setting only the family's left the star at its old size and,
   * because the shared mark is sized as a fraction of the object it sits on, left its mark at
   * 10px beside the door's 18.
   */
  --zoey-easter-egg-star-size: 3.375rem;
}

.zoey-home-hero__secret .zoey-discovery-trigger {
  --zoey-discovery-target: 3.375rem;
}

/*
 * The anchors move with the size. Both secrets grew by 30px, and an anchor solved against the
 * old box would have pushed that growth straight into the character and the copy — the thing
 * `D4` asks to be kept clear of. These are solved against the measured painted bounds again, at
 * the new size, and `sl-013.mjs` tests the result against every heading, paragraph, link and
 * button on the page at five widths and two text sizes.
 */
/*
 * ## The door is a miniature doorway (SL-013, amended 2026-10-19)
 *
 * A **door-specific exception**, and deliberately not a new size for the family. The star keeps
 * what the correction pass gave it; the plane, the pencil, the gear and the key are untouched.
 *
 * The amendment asks for 120-160px of visible door on desktop and 80-110px on mobile, measured
 * against the painted artwork. Because the door's viewBox is now cropped to that artwork
 * (inc/discovery/objects.php), the box *is* the door — so the height below is the visible height
 * with nothing to convert, and the width follows from the artwork's own 0.8971:1.
 *
 *     desktop   140px tall  ->  125.6px wide
 *     mobile     96px tall  ->   86.1px wide
 *
 * The target follows the doorway for the same reason: there is no padded square left to press.
 */
.zoey-home-hero__secret--door {
  /*
   * In **pixels**, and this is the one place in this stylesheet that is deliberate about it.
   *
   * Everything else here is in `rem` so it grows with the reader's text, and that is right for
   * anything made of words or sized against them. The door is neither: it is a scenic object
   * standing on a photographed ledge, and the photograph does not grow with the text. In `rem` it
   * doubled to 280px at a 32px root while the ledge stayed exactly where it was — the door
   * floating a hundred pixels above its own shadow, and its cue pushed off the hero at 320.
   *
   * It is 140px, which is nobody's minimum target: the control is 126 x 140 against a 44px floor,
   * so nothing a visitor needs to press gets smaller by holding this still.
   */
  --zoey-door-height: 96px;
  --zoey-door-ratio: 0.8971;

  /*
   * `flex` here as well as on the trigger below: the block's own inline-block slot reserves the
   * same descender space one level up, so fixing only the inner one moved the 9px rather than
   * removing it. The wrapper's bottom is what the ledge anchors, so it has to be the door's.
   */
  display: flex;
}

/*
 * The doorway does not answer a cursor by growing either.
 *
 * The family scales `__art` by 1.05 on hover and on a found hover, which is the same whole-object
 * transform the 2026-10-19 amendment took the door out of for its activation — and on a pointer
 * activation the cursor is still sitting on it, so the frame was measurably growing *during* the
 * peek: four distinct frame widths, 160.2 through 164.4, while the amendment asks for the frame
 * to stay stationary throughout. The keyboard path, with no cursor on it, never moved.
 *
 * A hover response is not removed, it is relocated: the leaf alone eases open a few degrees, so
 * the door still notices a cursor and still does it as a door.
 */
.zoey-home-hero__secret--door .zoey-discovery-object__art {
  --zoey-discovery-object-scale: 1;
  --zoey-discovery-object-lift: 0;
  --zoey-discovery-object-angle: 0deg;
}

.zoey-home-hero__secret--door .zoey-discovery-trigger:hover .zoey-discovery-object__leaf,
.zoey-home-hero__secret--door .zoey-discovery-trigger:focus-visible .zoey-discovery-object__leaf {
  transform: perspective(40px) rotateY(-7deg);
  transition: transform 180ms ease;
}

.zoey-home-hero__secret--door .zoey-discovery-object__art,
.zoey-home-hero__secret--door .zoey-discovery-object,
.zoey-home-hero__secret--door .zoey-discovery-trigger {
  inline-size: calc(var(--zoey-door-height) * var(--zoey-door-ratio));
  block-size: var(--zoey-door-height);
}

/*
 * ## The contact shadow
 *
 * Separate from the artwork, which is the amendment's word and the right call twice over: the
 * master is a flat cut-out with no ground of its own, and a shadow baked into the derivative
 * would have to be re-derived every time the placement moved.
 *
 * A soft ellipse under the threshold, wider than the door is and barely there. What it is for is
 * the difference between *standing on* the desk and *floating in front of* it — at 24px nobody
 * asked, and at 140px the eye asks immediately.
 */
/*
 * `flex` rather than the family's `inline-block`, and it is not a style preference.
 *
 * An inline-block wrapper reserves descender space under the inline-flex button inside it, so the
 * wrapper measured 149px around a 140px door — and since the wrapper's bottom is what is anchored
 * to the ledge, the door floated exactly those 9px above it. Visible, and the kind of thing that
 * reads as "nearly right" rather than as a bug.
 */
.zoey-home-hero__secret--door .zoey-discovery__trigger {
  position: relative;
  display: flex;
}

.zoey-home-hero__secret--door .zoey-discovery__trigger::after {
  position: absolute;
  inset-block-end: -3%;
  inset-inline-start: -8%;
  inline-size: 116%;
  block-size: 9%;
  border-radius: 50%;
  content: "";
  background: radial-gradient(
    closest-side,
    rgb(51 47 61 / 26%),
    rgb(51 47 61 / 12%) 62%,
    transparent
  );
  pointer-events: none;
}

@media (min-width: 900px) {
}

@media (forced-colors: active) {
  /* A shadow is not a thing a forced palette can render, and a grey ellipse there is a smudge. */
  .zoey-home-hero__secret--door .zoey-discovery__trigger::after {
    display: none;
  }
}

/*
 * The trailing inset is a **length**, not a percentage, and that is the badge's doing.
 *
 * The shared mark overhangs its object's corner by 8% to sit *on* it rather than beside it, which
 * at 3.375rem is 0.27rem of overhang — and on a phone 1% of the viewport was less than that, so
 * the mark poked past the page edge and took the document's scroll width with it. Measured: 0.4px
 * over at 320, and 4.7px at 390 with a doubled root, because the overhang grows with the text and
 * a percentage of the viewport does not.
 *
 * `0.5rem` clears the overhang at both text sizes and keeps both secrets in the scenery.
 */
.zoey-home-hero__secret--star {
  /*
   * 16% and not 19%. At 320 with a doubled root the supporting line wraps to two tall lines and
   * ends at y1531, while the star at 19% began at y1529 — a two-pixel box overlap, which §80 does
   * not allow however small it is. 16% puts 53px of clear space there and still leaves 114px
   * between the star and the door below it.
   */
  inset-block-end: 16%;
  inset-inline-end: 0.5rem;
}

/*
 * ## Standing the door on the scenery
 *
 * The backdrop is `object-fit: cover`, so the scenery slides under the hero as the viewport
 * changes shape and a fixed percentage grounds the door at exactly one width. The ledge it stands
 * on — the speckled block's top face, measured at master (1355-1493, 608) in the 1536x1024
 * desktop artwork — therefore has to be *derived* rather than guessed.
 *
 * For the desktop master the arithmetic collapses to something CSS can say directly. Above about
 * 1000px the cover scale is width-driven, `s = 100vw / 1536`, so the horizontal offset is zero and
 *
 *     ledge y        = 608s - (1024s - H)/2  =  H/2 + 96s  =  50% + 6.25vw
 *     ledge right x  = 1493s                 =  97.2% of the width
 *
 * which is exact at 1024, 1200, 1440, 1600 and 1920 — checked against the rendered backdrop at
 * each. Below ~1000px the scale becomes height-driven and the form drifts; at 900 it is 3px out,
 * which is within the shadow.
 *
 * The phone backdrop is a different master and has no hard ledge in reach — the lower third is
 * open desk. So the door stands on the desk below and to the trailing side of Bubbles, and the
 * contact shadow does the grounding work a ledge line would otherwise do.
 */
.zoey-home-hero__secret--door {
  inset-block-end: 2.5%;
  inset-inline-end: 2.5%;
}

@media (min-width: 900px) {
  .zoey-home-hero__secret--star {
    inset-block-start: 22%;
    inset-inline-end: 3%;
  }

  /*
   * The block's top face, derived above. `inset-block-end` so the threshold is what is anchored.
   *
   * 84px and a tight inset through the tablet range, because the ledge and Bubbles compete there:
   * what she leaves to her trailing side is 90px at 900 and 113px at 1200, and the mark overhangs
   * the door's corner by another 7. 84px of door is 75px wide, which clears her by 7px at the
   * worst width and keeps its mark on the page.
   */
  .zoey-home-hero__secret--door {
    --zoey-door-height: 84px;

    inset-block-start: auto;
    inset-block-end: calc(50% - 6.25vw);
    inset-inline-end: 8px;
  }
}

/*
 * ## Why the 140px door starts at 1400 and not at 900
 *
 * Because that is where the room is. Bubbles' painted silhouette was measured against the
 * backdrop at each width — the hero captured with and without her, and the difference counted —
 * and what is left to the trailing side of her is:
 *
 *     1440   168px      1360   131px      1200   113px
 *     1024   102px       900    90px
 *
 * A 140px door is 126px wide. It fits at 1440 with 42px to spare and at 1360 with five; below
 * that it does not fit at all, and at 1024 it put 9% of its box over her. The tablet range keeps
 * the 96px door, which is inside the amendment's own 80-110 band and leaves 4px of clearance even
 * at 900. 1400 rather than 1360 so the margin is comfortable rather than exact.
 */
@media (min-width: 1400px) {
  .zoey-home-hero__secret--door {
    --zoey-door-height: 140px;

    inset-inline-end: 2.8%;
  }
}

/* The no-JavaScript path opens a panel in the flow under the control rather than a card over the
   page, so it needs somewhere to open into — the same allowance the other seams make. */
.zoey-home-hero__secrets .zoey-discovery-fallback__panel {
  margin-block-start: var(--wp--preset--spacing--20);
}

/* --- The four things to try -------------------------------------------------------- */

/*
 * Four illustrated cards: four columns on desktop, two on a phone, one when the reader's text size
 * or the viewport asks for it.
 *
 * `auto-fit` with a floor rather than fixed column counts, so the reflow is driven by the space a
 * card actually needs. STORE-008 §41 as amended by SL-012 asks for four across inside the wide
 * container; the floor is what honours *"enlarge/reflow to one when needed"* without a third
 * breakpoint, because a `minmax` floor in `rem` grows with the root font size.
 */
/*
 * The counts are **explicit**, and the first attempt at this was `auto-fit` with a `minmax` floor.
 * Two measurements killed it.
 *
 * `auto-fit` fits as many columns as the floor allows, so a floor small enough to give two columns
 * on a phone gave **five** at 768 — and §2 asks for four, then two, then one, not for whatever
 * arithmetic produces. And a `minmax` floor is a **hard minimum**: at a 32px root a 13rem floor is
 * 416px, which is wider than a 320px phone, so the grid overflowed and the page scrolled sideways.
 * Measured: `scrollWidth` 500 against a `clientWidth` of 320.
 *
 * So the counts are stated, and the reflow to one is a **container query** rather than a media
 * query — because the thing that makes a card too narrow to read is the reader's text size, which
 * no `px` media query can see. `rem` inside a container query resolves against the root font size,
 * so 12rem is 192px at a normal root and 384px at a doubled one: the container is about 288px wide
 * on a 320px phone, so the query is quiet normally and fires at doubled text. That is §2's
 * *"enlarge/reflow to one when needed"* expressed as the condition it actually describes.
 */
.zoey-home-paths {
  container-type: inline-size;
  container-name: zoey-home-paths;
}

.zoey-home-paths__grid {
  display: grid;
  /* Two across on a phone, which is §2's own number, and still two at 768. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--30);
  max-inline-size: var(--wp--style--global--wide-size);
  margin-inline: auto;
}

@media (min-width: 900px) {
  .zoey-home-paths__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--40);
  }
}

@container zoey-home-paths (max-width: 12rem) {
  .zoey-home-paths__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.zoey-home-paths__empty {
  margin: 0;
  color: var(--wp--preset--color--ink-soft);
  text-align: center;
}

/* --- Products --------------------------------------------------------------------- */

/*
 * Real WooCommerce products on the accepted Shop card variant.
 *
 * A list, because it is one — and `role="list"` is on the element in PHP because the grid removes
 * the implicit list semantics in some engines. The cards are `zoey_made_product_card()`'s own
 * markup; nothing here reaches inside one.
 */
.zoey-home-products__grid {
  display: grid;
  /*
   * `min( 15rem, 100% )` rather than a bare `15rem`, and this is the same defect the paths grid
   * above was measured with: a `minmax` floor is a hard minimum, so a 15rem floor is 480px at a
   * doubled root and overflows every phone. `min()` lets the floor collapse to the container when
   * the container is the smaller of the two, which is what makes one column the floor's own answer
   * rather than a breakpoint's.
   *
   * There is no approved column count here — unlike the four paths — so `auto-fit` is right: the
   * region shows between one and four Featured products and the row should suit however many.
   */
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: var(--wp--preset--spacing--40);
  margin: 0;
  padding: 0;
  list-style: none;
}

.zoey-home-products__more {
  margin-block: var(--wp--preset--spacing--60) 0;
  text-align: center;
}

/* --- Something to try together ----------------------------------------------------- */

/*
 * The note and the picture.
 *
 * Desktop: note left, picture right. Phone: **picture first visually**, which is
 * `DESIGN-CONTRACT.md` §4's requirement — and it is done with `order` rather than by moving the
 * markup, so the DOM order a screen reader and the keyboard follow stays the order the words make
 * sense in. A visual reorder that changes the reading order is not what §4 asked for.
 */
.zoey-home-project__heading {
  text-align: center;
}

.zoey-home-project__layout {
  display: grid;
  gap: var(--wp--preset--spacing--50);
  align-items: center;
}

@media (min-width: 900px) {
  .zoey-home-project__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--wp--preset--spacing--60);
  }
}

@media (max-width: 899px) {
  .zoey-home-project__figure {
    order: -1;
  }
}

.zoey-home-project__figure {
  margin: 0;
}

.zoey-home-project__image {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--wp--custom--radius--large);
}

.zoey-home-project__eyebrow {
  margin: 0 0 var(--wp--preset--spacing--20);
  color: var(--wp--preset--color--ink-soft);
  font-size: var(--wp--preset--font-size--body-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zoey-home-project__title {
  margin: 0 0 var(--wp--preset--spacing--30);
  font-size: var(--wp--preset--font-size--section-small);
  text-wrap: balance;
}

.zoey-home-project__body {
  margin: 0 0 var(--wp--preset--spacing--40);
  max-inline-size: var(--wp--custom--measure);
}

.zoey-home-project__cta {
  margin-block-start: var(--wp--preset--spacing--20);
}

/* --- Where the two quiet secrets live (SL-013) ------------------------------------- */

/*
 * The plane and the pencil each had a band to themselves, and both bands worked. They are gone
 * anyway, because a strip of empty page whose only occupant is a 44px control is an announcement
 * — which is the thing DISCOVERY-005 §33 and §15 were each trying to avoid. Both secrets are now
 * at the edge of the region they belong to, inside it.
 *
 * ## The constraint that decides all of this
 *
 * §80 does not allow a secret to sit on text, and the trap is that the reading measure **grows
 * with the reader's text size** while a viewport does not. A pencil parked in a wide screen's
 * empty margin is in clear space at 100% and on top of the words at 200%. The previous design
 * solved that by giving each secret a row where nothing else could ever be; this one solves it by
 * only moving a secret out of the flow when there is provably room, and the mechanism is the one
 * unit that moves when the text does: a breakpoint in `rem`.
 *
 * The first attempt here was a `56rem` media query, on the reasoning that a breakpoint in `rem`
 * moves when the text does. **It does not.** A media query's `rem` is resolved against the
 * *initial* font size, never the document's — so `56rem` is 896px at every text size, and at a
 * 32px root the pencil was placed beside an intro that by then filled the whole column. Measured:
 * it overlapped the "Made by Zoey" heading at both 1440 and 1024.
 *
 * There is no media feature for "the reader enlarged the text", and no way to ask CSS whether two
 * boxes would fit. So the pencil is simply **in the flow**, at the region's leading edge, where
 * overlap is not something to be avoided but something that cannot happen. It is inside the
 * section rather than in a band of its own, which was the part worth keeping.
 */

/* --- The paper airplane ------------------------------------------------------------ */

/*
 * At the project region's bottom leading corner, in the band's own `spacing--80` of bottom
 * padding — 72px at 100% and 144px at 200%, because the token is in `rem` and the control is not
 * growing with it. So this one needs no breakpoint: the room it sits in gets *larger* exactly
 * when the text that could crowd it does.
 *
 * `max()` puts it at the content column's leading edge where there is a column, and at the band's
 * own padding edge where the viewport is narrower than the column — which is the same expression
 * the band's own inner uses, written once as a position instead of twice as a margin.
 *
 * §33's other constraints hold by where this is: not over text, not over a Product Card, not over
 * Bubble, and a whole region away from any call to action.
 */
.zoey-home-project {
  position: relative;
}

.zoey-home-project__secret {
  position: absolute;
  inset-block-end: var(--wp--preset--spacing--40);
  inset-inline-start: max(
    var(--wp--style--root--padding-left),
    calc((100% - var(--wp--style--global--wide-size)) / 2)
  );
}

/* --- The pencil ------------------------------------------------------------------- */

/*
 * Bubble's pencil, beside Made by Zoey (DISCOVERY-005 §14, §15).
 *
 * ## Reserved room, not borrowed room
 *
 * The first attempt put the pencil in the margin beside the intro and guarded it with a `56rem`
 * media query, on the reasoning that a breakpoint in `rem` moves when the reader's text does. It
 * does not — a media query's `rem` resolves against the *initial* font size — so at a 32px root
 * the pencil landed on the "Made by Zoey" heading. The second attempt dropped it into the flow
 * underneath, which could not overlap but read as an afterthought a long way from the words.
 *
 * This one gives the pencil **a column of its own**. Three tracks, with an empty one of the same
 * width on the trailing side, so the intro stays exactly where SL-012 centred it: the page is
 * still symmetrical and the pencil is beside the content rather than under it. Overlap is not
 * avoided here, it is structurally impossible — grid tracks do not intersect, whatever the text
 * size does.
 *
 * Below 34rem the three tracks would leave the words a column too narrow to read, so the layout
 * becomes one column and the pencil sits above the heading at the leading edge. That is the
 * "compact stacked arrangement" rather than a fallback: it is what the narrow case should look
 * like. A media query is safe *here*, where the two outcomes are "beside" and "stacked" and
 * neither can collide, in a way it was not when the outcomes were "beside" and "on top of".
 *
 * `56px` is the slot the integration authority names. Worth knowing when looking at it: the
 * drawing fills about two thirds of its box, so a 56px slot paints roughly 37px of pencil.
 */
.zoey-home-made-by__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--wp--preset--spacing--40);
  align-items: center;
}

.zoey-home-made-by__secret {
  display: flex;
  justify-content: flex-start;
}

.zoey-home-made-by__secret .zoey-discovery-object {
  --zoey-discovery-object-size: 3.5rem;
}

/*
 * 56px means 56px of *target* as well as 56px of drawing. The family's default is a 24px drawing
 * centred in a 44px target, and raising only the drawing leaves it measured at 44 x 56 — a pencil
 * with its width clipped. Both move together, so the hit area is 56 square: larger than the 44
 * minimum rather than smaller, which is the right direction to be wrong in.
 */
.zoey-home-made-by__secret .zoey-discovery-trigger {
  --zoey-discovery-target: 3.5rem;
}

@media (min-width: 34rem) {
  .zoey-home-made-by__inner {
    /*
     * The three tracks hug the words rather than the band.
     *
     * Left at the content column's full 1240px, the middle track is far wider than the intro it
     * holds — the intro is centred prose capped at the measure — so the pencil ended up at the
     * column's edge with about 350px of nothing between it and the first word. Level with the
     * text, which was the complaint's first half, and nowhere near it, which was the second.
     *
     * Capping the grid at the measure plus its two gutters puts the pencil **beside** the words.
     * `min()` keeps the column as the ceiling, so at a doubled root — where the measure alone is
     * wider than the column — this gives back rather than overflowing.
     */
    max-inline-size: min(
      var(--wp--style--global--wide-size),
      calc(var(--wp--custom--measure) + 2 * (3.5rem + var(--wp--preset--spacing--50)))
    );
    grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
    gap: var(--wp--preset--spacing--50);
  }

  .zoey-home-made-by__secret {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  .zoey-home-made-by__inner > :not(.zoey-home-made-by__secret) {
    grid-column: 2;
    grid-row: 1;
  }
}

.zoey-home-project__secret .zoey-discovery-fallback__panel,
.zoey-home-made-by__secret .zoey-discovery-fallback__panel {
  margin-block-end: var(--wp--preset--spacing--20);
}

/* --- Forced colors ---------------------------------------------------------------- */

/*
 * What this page asks of a high-contrast scheme is mostly that it stop trying.
 *
 * The scrim is a translucent layer whose only job is contrast against artwork; the system already
 * guarantees that contrast, so the layer is removed rather than recoloured. The backdrop is left
 * alone: it is a real `<img>`, so it survives, and scenery behind an opaque canvas colour costs
 * nothing.
 */
@media (forced-colors: active) {
  .zoey-home-hero::before {
    display: none;
  }

  .zoey-home-hero {
    background-color: Canvas;
  }
}
