/* The AERA page. The landing's Statements, with one image: a fixed set of lamps (aeraLamps.js) on a stage that stays
   pinned while the statements pass. On a wide screen the statements take the left half and the lamps the right, in one
   grid cell. On a narrow one the stage is a band above the text, and the text passes beneath it. Colour carries the same
   meanings as the landing: mint for stakers, bids and the one filled action, pink for asks. */
.at { --at-stage-top: var(--aera-sticky-height, 54px); --at-stage: calc(100svh - var(--at-stage-top)); }
.at-flow { display: grid; grid-template-columns: minmax(0, 1fr); }
.at-flow > * { grid-area: 1 / 1; min-width: 0; }
.at-stage {
  position: sticky; top: var(--at-stage-top); z-index: 0; align-self: start; justify-self: center;
  width: 100%; max-width: var(--lb-max); height: var(--at-stage); margin: 0; pointer-events: none;
}
.at-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
/* For the first look the canvas covers the whole screen, because the lamps come from everywhere, and stays behind the words. */
.at-stage[data-air] { z-index: 0; }
.at-stage[data-air] canvas { inset: auto; left: var(--at-air-x); top: var(--at-air-y); width: var(--at-air-w); height: var(--at-air-h); }
.at-chapters { position: relative; z-index: 1; min-width: 0; }

/* Labels on the lamps, in each shape's own coordinates. They show while the lamps hold still. */
.at-tag {
  position: absolute; left: var(--x, 0); top: var(--y, 0); margin: 0; color: var(--text-soft);
  font: 500 .8125rem/1.3 var(--fontfam-term); font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transition: opacity 220ms cubic-bezier(.2, .8, .2, 1);
}
.at-tag--end { translate: -100% 0; }
.at-tag--above { translate: 0 -100%; }
.at-tag--end.at-tag--above { translate: -100% -100%; }
.at-tag--accent { color: var(--positive); }
.at-tag--ask { color: var(--danger-soft); }
.at-stage[data-shape="fees"] [data-shape~="fees"],
.at-stage[data-shape="vote"] [data-shape~="vote"],
.at-stage[data-shape="floor"] [data-shape~="floor"],
.at-stage[data-shape="grid"] [data-shape~="grid"] { opacity: 1; }

/* ---------- The hero: the headline beside the mark ---------- */
.at-hero { display: grid; align-items: center; min-height: var(--at-stage); max-width: var(--lb-max); margin: 0 auto; padding: clamp(24px, 4vh, 48px) var(--g); }
.at-hero-copy { display: grid; justify-items: start; gap: clamp(24px, 2.4vw, 36px); min-width: 0; }
.at-title > span { display: block; }
.at-title-accent { color: var(--positive); }
.at-hero-copy .lb-btn { margin-top: clamp(4px, 1vw, 12px); }

/* ---------- Chapters: each holds the stage while its statement passes ---------- */
.at-chapter { display: grid; align-items: center; min-height: var(--at-stage); }
.at-chapter .lb-statement { width: 100%; padding-top: 0; }
.at-chapter .lb-statement-body { max-width: 34rem; }
.at-paused { margin: 0; color: var(--network-label); font-size: 1.0625rem; }
.at-paused[hidden] { display: none; }
.at-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.at-links [hidden] { display: none; }
/* Without lamps the sentence about them has nothing to point at. */
.at[data-lamps="off"] .at-reveal { display: none; }

/* ---------- The close: the mark above, the statement and the way in below ---------- */
.at-close { display: grid; justify-items: center; align-content: end; gap: clamp(16px, 1.8vw, 24px); min-height: var(--at-stage); padding: calc(var(--at-stage) * .42) var(--g) clamp(32px, 6vh, 72px); text-align: center; }
.at-close .lb-display--close { max-width: 15ch; font-size: clamp(2.5rem, 5.2vw, 4.75rem); }
.at-close .at-links { justify-content: center; }
.at-close-facts { display: grid; gap: 4px; }
.at-close .lb-proof { color: var(--text-soft); }

/* The footer follows the page directly. */
.at + .lb-footer { margin-top: 0; }

@media (max-width: 1100px) {
  /* The stage becomes a band above the text, opaque, so the statements pass beneath it. */
  :root { --at-band: max(220px, 38svh); }
  html:has(#aera-token-page:not([hidden]):not([data-lamps="off"])) { scroll-padding-top: calc(var(--aera-sticky-height, 54px) + var(--at-band) + 28px); }
  .at-stage { z-index: 2; height: var(--at-band); background: var(--ground-fill); pointer-events: auto; }
  .at-stage::after { content: ''; position: absolute; inset: 100% 0 auto; height: 28px; background: linear-gradient(rgb(var(--ground-rgb)), rgb(var(--ground-rgb) / 0)); pointer-events: none; }
  .at-tag { font-size: .75rem; }
  .at-hero { align-items: start; min-height: 0; padding-top: calc(var(--at-band) + 28px); padding-bottom: 12px; }
  .at-chapter { min-height: 0; align-items: start; padding: clamp(64px, 11vh, 112px) 0 clamp(8px, 2vh, 24px); }
  /* The band stays pinned over the close, so the text simply follows the last chapter. */
  .at-close { min-height: 0; padding-top: clamp(64px, 11vh, 112px); padding-bottom: clamp(64px, 12vh, 112px); align-content: start; }
  .at[data-lamps="off"] .at-hero { padding-top: 48px; }
}
/* Without lamps the stage steps aside and the text stands alone. */
.at-stage[data-run="off"] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .at-tag { transition: none; }
}
