/* The Horizon Living brand tokens.

   Mirrors src/lib/horizon-tokens.ts, which is the source of truth the shader
   and the contrast tests read. Keep the two in step: horizon-tokens.test.ts
   asserts the palette against the guidelines, and this file is what ships.

   Source: "The Horizon_brand guidelines_07.pdf" (section 02) and
   "The Horizon Brand Atlas_FINAL.pdf". */
:root {
  /* Typography, logo, key graphic elements. 10% of the composition. */
  --horizon-deep: #2f4a5a;

  /* Neutral grounds. 70% of the composition. */
  --horizon-sandstone: #f6f0e8;
  /* The evening end of the page gradient. HZN-274. Solved for, not picked:
     the most chromatic warm ground that holds Deep Horizon at 7.2. */
  --horizon-page-sunset: #ffdf9e;
  --horizon-sunlight: #fdf6ea;
  --horizon-sea-glass: #b7c7c6;
  /*
   * ALBIS navy, brand compliance Round 3 item A2. It exists for ONE job: the
   * Keep Exploring section's text, where Deep Horizon on Subtle Orange measures
   * 3.32 and fails AA at any size. This measures 5.01 on that ground and passes.
   *
   * NOT A SECOND PRIMARY INK. Lightening was checked first and goes the wrong
   * way, because Subtle Orange sits in a middle luminance range: Early Morning
   * Sunlight on it is 2.62 and white is 2.81, both worse than Deep Horizon. A
   * darker ink was the only direction that clears the bar.
   */
  --horizon-albis-navy: #1a2b4a;

  /* Warm accents. 20% of the composition, one dominant tone (Soft Ochre). */
  --horizon-marigold: #f6dfa6;
  --horizon-ochre: #e8bf7a;
  /*
   * SOFTENED 10 SEPTEMBER, Lisa: "use a lighter, more muted version of the
   * coral so it reads as part of the atmospheric progression rather than a
   * strong solid block of colour."
   *
   * #f4a78a mixed 35 per cent toward Early Morning Sunlight, which is the wash
   * the section sits in. Deep Horizon on it goes 4.78 to 5.94, so the softening
   * also moves the tightest of the six grounds off the AA floor and lands it
   * between Soft Ochre 5.41 and Pale Marigold 7.13, which is the progression it
   * is meant to belong to.
   */
  --horizon-coral: #f7c3ac;

  /* Highlights, icons and small graphic details only. NOT a CTA fill:
     white on it is 2.81:1 and Deep Horizon on it is 3.32:1, both under the
     4.5:1 floor, and as a border on Sandstone it is 2.49:1, under the 3:1
     floor for a UI boundary. See horizon-tokens.test.ts. */
  --horizon-highlight: #e67e4f;

  /* The call to action. Deep Horizon fill with white text measures 9.34:1,
     which clears AAA. The audience is 65+; this is not a marginal call. */
  --horizon-cta-fill: var(--horizon-deep);
  --horizon-cta-text: #ffffff;

  /* Type. Both faces are now served from this origin; see fonts.css. Avenir
     is here because Avenir Senior Living holds a web licence for it. Mulish
     stays in the stack as the fallback it used to be, so a font that fails
     to load degrades to the substitute rather than to system-ui. */
  --horizon-font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --horizon-font-body: 'Avenir Book', 'Mulish', system-ui, -apple-system, sans-serif;
  /* The family's real bold (85 Heavy). Round 3 A4. Addressed by name, never by
     weight: see the note in fonts.css. */
  --horizon-font-body-bold: 'Avenir Heavy', 'Mulish', system-ui, -apple-system, sans-serif;
  --horizon-font-subhead: 'Avenir Roman', 'Mulish', system-ui, -apple-system, sans-serif;
  /* Atlas: subheadings are "all caps and tracking spaced to 50". Fifty units
     of a 1000-unit em is 0.05em. Named once so every subhead matches. */
  --horizon-subhead-tracking: 0.05em;

  /* The horizon line sits below optical centre so the sky dominates. */
  --horizon-line-position: 62%;

  /* THE PUBLISHED CHROME HEIGHTS (HZN-199). Both are overwritten with a
     rendered pixel value on the document element by chrome-metrics.ts; these
     are the values that hold before that script runs and with scripting off.

     The nav falls back to the tallest value its own clamp can reach, so the
     fallback is never SHORTER than the bar and a consumer keyed to it never
     lands underneath. The notice falls back to zero, because with no script
     there is nothing to dismiss it and, more to the point, no script to have
     shown it in the first place. */
  --horizon-nav-height: 4.75rem;
  --horizon-bottom-inset: 0px;

  /* The gap a bottom-anchored control keeps between itself and whatever the
     chrome above it publishes. Named once so the hero cue, the foot assistant
     and anything added later share one number rather than three. */
  --horizon-bottom-gap: 1.5rem;

  /* Motion budget. Nothing in the hero exceeds roughly 2px/s of apparent
     motion, and the periods are incommensurate so no loop is perceptible. */
  --horizon-breathe-duration: 12s;
  --horizon-drift-duration: 47s;
}

/* globals.css paints the root dark (--color-neutral-950) and sets body text
   near-white, because pirouz.ai is a dark site whose fixed hero layer needs a
   transparent body. Both are wrong here: the dark ground showed as a black
   band below the hero, and any text not explicitly coloured would have been
   near-white on Sandstone. This stylesheet loads after globals.css, so these
   two rules are the whole correction. */
/* `:root` and `:root > body` rather than `html` and `body`: Astro inlines
   globals.css into a <style> that lands AFTER this <link>, so an
   equal-specificity rule loses on source order. `:root` scores (0,1,0) against
   `html`'s (0,0,1), and `:root > body` scores (0,1,1) against `body`'s (0,0,1),
   so both win wherever the stylesheet ends up. Verified in-browser. */
/*
 * THE PAGE IS ONE HORIZON, TOP TO BOTTOM. HZN-274, Jose's round one feedback
 * item 6: "the sky-to-water background gradient running down the page currently
 * changes in hard blocks between sections instead of blending smoothly. Please
 * smooth this into one continuous gradient."
 *
 * IT IS ON :root SO IT CANNOT BLOCK. A per-section background is a block by
 * construction: each band paints its own rectangle and the joins are edges. One
 * gradient on the root element is sized to the whole document, so there is
 * nothing to smooth between: continuity is the mechanism rather than the goal.
 * The three bands that used to paint their own Sandstone are transparent now.
 *
 * WHY IT IS NOT THE MOCKUP'S GRADIENT, WITH THE NUMBERS. The reference runs
 * cream to a saturated sunset coral to a dusk blue. Sampled down that file
 * against this project's 7.0 floor, its middle third fails for EVERY ink in the
 * palette: on its #fd965c, Deep Horizon is 4.31, Early Morning Sunlight 2.02,
 * Sea Glass 1.24 and white 2.17. Only pure black clears it, at 9.69, and black
 * is not in this palette. An ink there would need luminance at or below 0.019
 * or at or above 3.34, and 3.34 is brighter than white. So no type colour
 * rescues that band: the ground itself has to change.
 *
 * That is also why the feedback's own second sentence does not follow.
 * "Contrast should hold up once the gradient is smoothed" is not true:
 * smoothing moves where a transition happens, it does not change the luminance
 * of the band the words sit on. The FAQ heading being hard to read is the
 * colour, not the cut.
 *
 * SO THE SUNSET IS SOLVED FOR RATHER THAN PICKED. Holding Deep Horizon at 7.2,
 * a ground must reach luminance 0.7593. Searching warm hues for the most
 * CHROMATIC colour that reaches it: at hue 30 the ceiling is #ffdebd at chroma
 * 0.259, at hue 40 it is #ffdf9e at 0.380, and at hue 50 it is #ffe252 at
 * 0.678. Warmth toward gold buys luminance, so an amber is available that is
 * more strongly coloured than the mockup's coral and still legible. #ffdf9e is
 * taken: hue 40, chroma 0.380, ratio 7.25, which reads as evening light rather
 * than as the acid yellow further round.
 *
 * EVERY POINT ON IT IS CHECKED, NOT EVERY STOP. Stops are easy to verify and
 * are not where a gradient fails; the interpolation between them is. Sampled
 * every half per cent, the worst point on the whole sweep is the sunset stop
 * itself at 7.25, and page-gradient.test.ts re-derives that rather than
 * trusting this comment.
 *
 * THE WATER IS THE FOOTER, and it is reached through a fade inside the footer
 * rather than by running dusk blue up into the page. Deep Horizon under this
 * page's Deep Horizon type is 1.00, so any blue that reaches a paragraph is a
 * defect. SiteFooter.astro carries that transition, over its own padding, with
 * no text in it.
 */
:root {
  background-color: var(--horizon-sandstone);
}

/*
 * THE GRADIENT IS ON BODY, NOT ON :root, AND THE FIRST ATTEMPT WAS ON :root.
 *
 * A background on the root element is propagated to the CANVAS: it is painted
 * over the whole viewport and positioned against the canvas origin, not
 * stretched down the document. Written there, this gradient rendered across the
 * first screen and then `no-repeat` left the background-color for the rest.
 * Measured at 390px: the left edge read #f6f0e8 at 27, 58, 88 and 93 per cent
 * of the document, which is the fallback colour rather than any part of the
 * sweep. It looked like nothing had happened, because nothing had.
 *
 * The body's box IS the document, so a gradient on it spans the scroll. The
 * root keeps the background-COLOR, which is what beats globals.css's dark root
 * and what shows anywhere the gradient does not reach.
 */
:root > body {
  color: var(--horizon-deep);
  font-family: var(--horizon-font-body);
  background-image: linear-gradient(
    to bottom,
    var(--horizon-sandstone, #f6f0e8) 0%,
    var(--horizon-sunlight, #fdf6ea) 16%,
    #fdf1d7 42%,
    #ffeac2 68%,
    var(--horizon-page-sunset, #ffdf9e) 88%,
    var(--horizon-page-sunset, #ffdf9e) 100%
  );
  background-repeat: no-repeat;
}
