/* Astral Amino — homepage composition. Loaded after amino.css, by index.html only.

   One typeface (the label's), no small-caps labels over headings, nothing numbered. Each part
   says one thing: the vial in the middle of a line; how an order reaches you, and how fast; the
   bestsellers on one shelf; what you can count on, beside the questions. */

/* ---- hero: the vial in the middle of the line, on a page divided like its label ----
   The vial is a cut-out layer standing under the logo. The headline is broken at it: the first
   half ends at the glass on the left, standing on the top edge of the label; the second half
   starts from the glass on the right with the button under it, and the button's foot is the
   label's bottom edge. Behind them the page is two tones divided by the label's own
   diagonal, which leaves the glass where the label's line reaches it on each side.
   Everything is placed from the vial: --vh is its height from cap to base, --vw its width across
   the glass. The layer is 1.8 times --vw wide, with the cap 3% of --vh below its top; those
   numbers and the 61.5% below come from tools/build-home-art.py. */
.hero {
  --hero-h: clamp(600px, 100svh, 940px);
  --U: calc(var(--hero-h) - var(--header-h));     /* the screen under the header */
  --vh: calc(var(--U) * .78);
  --vw: calc(var(--vh) * .4246);
  --vt: calc(var(--U) * .066);                    /* header to cap */
  --gap: calc(var(--vw) * .16);                   /* glass to lettering */
  --side: calc(min(50vw, (var(--wrap) + var(--gutter) * 2) / 2) - var(--vw) / 2 - var(--gap) - var(--gutter));
  --fs: min(calc(var(--side) / 4.0595), 112px);   /* sized so the B of "Built" (4.0595em from the d's box edge) starts on the nav's left edge */
  --btn: 46px;                                    /* the button's height */
  --plane: #232326;                               /* as far above the page as the label's lighter tone is above its black */
  position: relative; isolation: isolate; overflow: clip; height: var(--hero-h); padding-top: var(--header-h);
}
.hero__in { position: relative; height: 100%; }
/* The layer is the element's background (set in the markup, so it loads with the page), never an
   image element: see "pictures" in js/app.js. 1071 x 1629 is the layer file's size. */
.hero__art { position: absolute; left: calc(50% - var(--vw) * .9); top: calc(var(--vt) - var(--vh) * .03); width: calc(var(--vw) * 1.8); aspect-ratio: 1071 / 1629; background-size: 100% 100%; background-repeat: no-repeat; }
/* The page's second tone: everything below a line through the vial's axis 61.5% down the layer,
   at the angle that meets the label's own line at both edges of the glass. It dies away toward
   the floor, so the hero ends on the page colour like every other part. */
.hero__art::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 61.5%;
  width: 500vmax; height: 500vmax; translate: -50% -50%; pointer-events: none;
  background: linear-gradient(144deg, transparent calc(50% - .6px), var(--plane) calc(50% + .6px));
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, transparent 56%, var(--obsidian) 97%); }
.hero__title { font-weight: 300; font-size: var(--fs); line-height: 1; letter-spacing: -.035em; }
.hero__a, .hero__b { position: absolute; white-space: nowrap; }
/* The label's top edge is 36.9% down the vial and its bottom edge 88.8%. A line of this type has
   its baseline .86em under its top, and the button's top is one x-height (.5em) under the "by bond."
   baseline: the tail of the y then clears it by less than the halves stand from the glass, so the
   button reads as part of its line and not of the vial.
   Placed by the letters' ink, not their boxes: the d ending "Built bond" stops .0404em inside its
   box and the b starting "by bond." begins .0757em inside, so the second half moves .0353em
   left to stand as far from the glass as the first.
   The button is exactly as wide as "by bond." (from the b's stem, .0757em inside the box, to the
   period, 3.523em), so the words and the button make one block, the same width top and bottom,
   set against "Built bond" across the vial. Its top is one x-height under the baseline and its
   foot is the label's bottom edge. */
.hero__a { right: calc(50% + var(--vw) / 2 + var(--gap)); top: calc(var(--vt) + var(--vh) * .369 - var(--fs) * .86); }
.hero__b { left: calc(50% + var(--vw) / 2 + var(--gap) - var(--fs) * .0353); top: calc(var(--vt) + var(--vh) * .888 - var(--btn) - var(--fs) * 1.36); }
.hero__cta { position: absolute; left: calc(50% + var(--vw) / 2 + var(--gap) + var(--fs) * .0404); top: calc(var(--vt) + var(--vh) * .888 - var(--btn)); }
/* The button is a strip of the vial's label: the label's black, its right end cut at the page's
   angle so the label's diagonal is the strip's own edge. Cut, hover sweep and focus come from the
   site's button family in amino.css (.btn); this strip only sets its stock, its height and its width.
   No arrow: the cut end is the cue. */
.hero__cta .btn {
  --h: var(--btn);
  --label-black: #0e0e0f;                         /* the vial label's black, sampled from the render */
  width: calc(var(--fs) * 3.4473); background: var(--label-black); color: var(--bone);
}

/* Once, on arrival: the two halves come out from behind the glass. Without animation they are simply there. */
@media (min-width: 1000px) {
  .hero__a { animation: hero-out-left .9s var(--ease) .1s both; }
  .hero__b, .hero__cta { animation: hero-out-right .9s var(--ease) .22s both; }
}
@keyframes hero-out-left { from { opacity: 0; transform: translateX(36px); } }
@keyframes hero-out-right { from { opacity: 0; transform: translateX(-36px); } }

/* Section headings sit a clear step under the hero line. */
.shelf--best .h2, .sheet .h2 { font-size: clamp(28px, 3.1vw, 44px); }

/* The homepage keeps one tighter rhythm than the inner pages: one gap between its parts. The
   first part starts close under the hero, whose floor light already stands clear of the vial. */
:root { --home-gap: clamp(48px, 4.5vw, 64px); }
.shelf--best { padding-block: 0 var(--home-gap); }

/* ---- from shelf to door: the order in three panes, joined by one bond ----
   Each pane holds one real thing from the site, not a picture of a screen: the strength choice,
   the cut strip that places the order, and the vial itself. The panes' corners are cut at the
   label's angle (tan 36deg = .7265), and one hairline runs under all three, with a sliver of label
   on it under each pane: the bond the line is named for. It draws across once, on arrival. */
.order { padding-block: clamp(8px, 1.6vw, 24px) var(--home-gap); overflow-x: clip; }
.order .h2 { font-size: clamp(28px, 3.1vw, 44px); }
.order__head { margin-bottom: clamp(20px, 2.4vw, 32px); }
.order__steps { --scene-h: clamp(200px, 17vw, 236px); --step-gap: clamp(12px, 1.6vw, 20px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--step-gap); }
.step { position: relative; display: grid; align-content: start; }
/* the bond: each pane draws its length of one line at the height of the nodes, on across the gap
   to the next, so the three lengths read as one line */
.step::before {
  content: ""; position: absolute; left: 0; width: calc(100% + var(--step-gap)); top: calc(var(--scene-h) + 28px); height: 1px; background: var(--line-2);
  transform-origin: left; transition: transform .9s var(--ease); transition-delay: calc(var(--d, 0s) * 4 + .2s);
}
.step:last-child::before { width: 100%; }
.step.rise.will-rise:not(.is-in)::before { transform: scaleX(0); }
.step__scene {
  display: grid; place-items: center; height: var(--scene-h); background: var(--obsidian-2);
  clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 32px, 100% 100%, 0 100%);
}
.step__scene .opts--pills { flex-wrap: nowrap; justify-content: center; gap: 8px; }
.step__scene .opts--pills .opt { min-height: 44px; padding: 0 clamp(12px, 1.3vw, 20px); font-size: 14.5px; }
.step__scene .opt.is-on { background: var(--bone); color: var(--ink); box-shadow: none; }
.step__btn { --h: 52px; width: min(78%, 280px); pointer-events: none; }
/* The vial is the hero's cut-out layer, the one vial picture that may stand on another tone; its
   floor light runs into the foot of the pane. */
.step__vial { align-self: end; width: 100%; height: 94%; background-size: contain; background-position: center bottom; background-repeat: no-repeat; }
/* a sliver of the label: a parallelogram leaning at the label's angle */
.step__node {
  position: relative; z-index: 1; display: block; width: 26px; height: 9px; margin: 24px 0 18px; background: var(--bone);
  clip-path: polygon(12.4px 0, 100% 0, calc(100% - 12.4px) 100%, 0 100%);
}
.step h3 { font-size: 19px; font-weight: 400; line-height: 1.3; }
.step p { margin-top: 4px; max-width: 24em; font-size: 16px; color: var(--bone-2); }

/* The promise: a panel cut from the vial's label, beside the steps it is a promise about: the
   label's black, its corner cut at the label's angle like the panes. In it, a clock face of the
   day, one tick an hour and a longer one every six; its ring fills as the page scrolls to it,
   the hours in its middle. The promise is said beside it, and its two terms under that. */
.promise {
  --label-black: #0e0e0f;                         /* the vial label's black, as in the hero strip */
  display: grid; align-content: center; gap: clamp(24px, 3vw, 36px);
  margin-top: clamp(32px, 4vw, 48px); padding: clamp(28px, 4vw, 52px);
  background: var(--label-black); clip-path: polygon(0 0, calc(100% - 66px) 0, 100% 48px, 100% 100%, 0 100%);
}
.promise__title { max-width: 16em; padding-right: 40px; font-size: clamp(24px, 2.4vw, 34px); font-weight: 300; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.promise__body { display: grid; grid-template-columns: clamp(170px, 15vw, 210px) minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: center; }
.dial { position: relative; aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; rotate: -90deg; overflow: visible; }
.dial circle { fill: none; stroke-width: 7; }
.dial__track { stroke: var(--line); }
/* full by default; the script empties it and fills it with the scroll (see driveDials in js/app.js) */
.dial__arc { stroke: var(--bone); stroke-dasharray: 1; stroke-dashoffset: 0; }
.has-dials .dial__arc { stroke-dashoffset: 1; }
.dial__ticks line { stroke: var(--bone-3); stroke-width: .8; }
.dial__ticks line.is-major { stroke: var(--bone); stroke-width: 1.4; }
.dial__num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: clamp(52px, 4.8vw, 68px); font-weight: 300; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dial__num span { margin-top: 8px; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); }
.promise__terms div { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.promise__terms div:last-child { border-bottom: 1px solid var(--line); }
.promise__terms dt { font-size: 20px; font-weight: 400; line-height: 1.2; }
.promise__terms dd { margin: 0; font-size: 15px; color: var(--bone-2); }

/* On a wide screen the steps and the panel stand side by side as one section: the steps as a
   column on the left, each pane beside its words, the bond running down through the nodes; the
   label panel on the right, as tall as the three steps. */
@media (min-width: 1000px) {
  .order__body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 3.2vw, 48px); align-items: stretch; }
  .order__steps { --scene-h: 156px; --step-gap: 14px; grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: 50% minmax(0, 1fr); align-items: center; }
  .step__text { position: relative; padding-left: 44px; }
  .step__node { position: absolute; left: 0; top: 9px; margin: 0; }
  /* the bond turns to run down the column, through every node */
  .step::before { left: calc(50% + 13px); top: 0; width: 1px; height: calc(100% + var(--step-gap)); transform-origin: top; }
  .step:last-child::before { width: 1px; height: 100%; }
  .step.rise.will-rise:not(.is-in)::before { transform: scaleY(0); }
  .step__scene .opts--pills .opt { padding: 0 14px; }
  .step__btn { width: min(80%, 240px); min-width: 0; }
  .promise { margin-top: 0; }
}

/* ---- the light sheet: what you can count on beside the questions, on one piece of paper ---- */
.sheet { position: relative; z-index: 2; margin: 0 clamp(8px, 1.2vw, 16px); border-radius: clamp(20px, 2.4vw, 34px); color: var(--ink); background: var(--paper); padding-block: var(--home-gap); }
.foot { padding-top: var(--home-gap); }
.sheet :focus-visible { outline-color: var(--ink); }
.sheet__in { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.sheet .qa { margin-top: clamp(20px, 2.4vw, 32px); }
.sheet .qa a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; color: var(--ink); }
/* The two halves read as two things: what you can count on sits on an inset card of the sheet's
   deeper tone, its corner cut at the label's angle like every panel above; the questions stay on
   the open paper. On a wide screen the questions start level with the card's title. */
/* the card ends level with the questions beside it, measured with every question closed (holdHeight in js/app.js) */
.counts.is-held { min-height: var(--held-h); }
.sheet .faq .qa summary { min-height: calc(64px + var(--fold-fill, 0px)); }
.counts { --pad: clamp(28px, 3.4vw, 48px); padding: var(--pad); background: var(--paper-2); clip-path: polygon(0 0, calc(100% - 48px) 0, 100% 35px, 100% 100%, 0 100%); }
@media (min-width: 900px) {
  .faq { padding-top: clamp(28px, 3.4vw, 48px); }
  .counts .h2 { font-size: clamp(26px, 2.4vw, 36px); }   /* one line inside the card */
}
/* each point is marked with the sliver of label the steps stand on, in the paper's ink */
.counts__list { display: grid; gap: clamp(22px, 2.4vw, 30px); margin-top: clamp(24px, 2.8vw, 36px); }
.counts__list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 18px; }
.counts__list li::before { content: ""; grid-row: 1; width: 26px; height: 9px; margin-top: .55em; background: var(--ink); clip-path: polygon(12.4px 0, 100% 0, calc(100% - 12.4px) 100%, 0 100%); }
.counts__list h4 { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.3; }
/* Made in the USA is said with the same tag the footer wears; its marker sits level with the tag's middle */
.counts__tag .foot__tag { margin-top: 0; }
.counts__list li:has(.counts__tag)::before { margin-top: 11.5px; }
.counts__tag + p { margin-top: 6px; }
.counts__list p { grid-column: 2; max-width: 30em; font-size: 15.5px; color: var(--ink-2); }

/* ---- narrower windows ---- */
/* The hero on a phone is built for the phone, not folded from the desktop: it is exactly one screen.
   The line opens it, in one line under the header; the vial stands large under it, as on a
   product screen; and the strip runs the full width at the foot of the screen, where the thumb is.
   The three are set one equal gap apart, measured by what the eye sees, not by boxes: from the
   header's mark (its foot is 40px down) to the top of the capitals, from the baseline to the cap of
   the vial, and from the foot of the glass to the strip. The vial's height is what is left of the
   screen once those gaps, the line and the strip are placed, so nothing is cut off and nothing
   spills into the catalog on a short phone or a tall one.
   The line is one line, as wide as the strip under it: its ink runs 7.8em from the B's stem to the
   period, and the B's stem stands .1em inside the box, so the box moves .1em left to put the ink
   on the gutter. In a box of line-height 1 the capitals (.7em tall) start .16em down and the
   baseline is .86em down. In the layer the cap is 2.58% of its height below its top, and the glass
   is 85.94% of it tall; the floor light under the glass (the last 11.48%) runs on under the strip. */
@media (max-width: 999px) {
  .hero {
    --fs: min(calc((100vw - var(--gutter) * 2) / 7.8), 72px);
    --hh: clamp(620px, 100svh, 1000px);
    --pb: max(32px, calc(env(safe-area-inset-bottom) + 12px));   /* the strip stands clear of the screen's foot and the home bar */
    --g: clamp(30px, 5svh, 52px);                  /* the one gap */
    /* the screen less: the mark's foot, three gaps, the capitals, the strip and the space under it */
    --art-h: clamp(300px, calc((var(--hh) - 40px - var(--g) * 3 - var(--fs) * .7 - var(--btn) - var(--pb)) / .8594), 900px);
    --vh: calc(var(--art-h) * .8594);
    --btn: 60px;
    height: var(--hh); min-height: 0; max-height: none; padding-bottom: 0;
  }
  .hero__in { display: flex; flex-direction: column; height: 100%; padding: 0 var(--gutter) var(--pb); }
  .hero__title { order: 1; position: relative; z-index: 1; margin: calc(40px + var(--g) - var(--header-h) - var(--fs) * .16) 0 0 calc(var(--fs) * -.1); font-size: var(--fs); line-height: 1; white-space: nowrap; }
  .hero__art { order: 2; position: relative; inset: auto; flex: none; align-self: center; width: calc(var(--vw) * 1.8); margin-top: calc(var(--g) - var(--fs) * .14 - var(--art-h) * .0258); margin-bottom: calc(var(--art-h) * -.1148); }
  .hero__a, .hero__b { position: static; }
  .hero__cta { order: 3; position: relative; z-index: 1; inset: auto; margin-top: auto; padding-top: 0; }
  .hero__cta .btn { width: 100%; min-width: 0; padding-left: 24px; font-size: 16.5px; }   /* the family's 4.4-cut minimum is wider than a 360 screen at this height */
}
@media (max-width: 899px) {
  .sheet__in { grid-template-columns: minmax(0, 1fr); gap: var(--home-gap); }
  .counts.is-held { min-height: 0; }
}
@media (max-width: 719px) {
  .promise { margin-inline: calc(var(--gutter) * -.5); }
  .promise__body { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .dial { width: min(64%, 220px); justify-self: center; }
  /* The shelf runs off the right edge of the screen with a third vial showing, so it reads as a
     row to swipe, not two products. */
  .shelf--best .shelf__track { grid-auto-columns: 42%; margin-right: calc(var(--gutter) * -1); }
  /* The three panes become a row to swipe, like the shelf above, so the bond stays one line. */
  .order__steps {
    --scene-h: 200px; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
  }
  .order__steps::-webkit-scrollbar { display: none; }
  .step { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .step::before { transition: none; transform: none !important; }
}

.hero__art { background-image: url("../media/home/ccb59edbe7-hero-1071.webp?v=e8c1af8578188313"); background-image: image-set(url("../media/home/ccb59edbe7-hero-540.webp?v=942f42a0534eb111") 1x, url("../media/home/ccb59edbe7-hero-1071.webp?v=e8c1af8578188313") 2x); }
.step__vial { background-image: url("../media/home/ccb59edbe7-hero-540.webp?v=942f42a0534eb111"); }
