@import url("./tokens.css");

/* Minimal: one chrome arch that follows the page, four cards, one closing picture. */

:root {
  --size-display: clamp(2.5rem, 3.7vw, 4rem);
  --size-section: clamp(1.875rem, 3vw, 3rem);
  --size-statement: clamp(1.25rem, 1.8vw, 1.625rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  /* The page is one dark field; keep the browser's light scroller off it. */
  scrollbar-color: var(--deep) var(--night);
}

/* Safari ignores scrollbar-color, so draw the same scroller there. */
html::-webkit-scrollbar {
  width: 0.75rem;
}

html::-webkit-scrollbar-track {
  background: var(--night);
}

html::-webkit-scrollbar-thumb {
  border: 3px solid var(--night);
  border-radius: 999px;
  background: var(--deep);
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--deep-2);
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: clip;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: var(--size-display);
  line-height: 1.02;
}

h2 {
  font-size: var(--size-section);
  line-height: 1.05;
}

h3 {
  font-size: var(--size-statement);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

::selection {
  background: var(--green);
  color: var(--green-ink);
}

/* Controls ------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.25rem 1.375rem;
  border: 0;
  background: var(--green);
  color: var(--green-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.button:hover {
  background: var(--green-hover);
}

.button:active {
  transform: scale(0.97);
}

.button-small {
  min-height: 2.5rem;
  padding-inline: 1rem;
  font-size: var(--size-small);
}

/* Bar ------------------------------------------------------------------ */

.bar {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 4rem;
  padding: 0 var(--margin);
  color: var(--ink-light);
  transition: background-color 240ms var(--ease-out), translate 240ms var(--ease-out);
}

/* Once the page moves the bar takes the night field, so it reads over the light section too. */
.bar.is-solid {
  background: var(--night);
}

.bar.is-tucked:not(:focus-within) {
  translate: 0 -100%;
}

[id] {
  scroll-margin-top: 5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.bar-links {
  display: flex;
  gap: clamp(1.25rem, 2.6vw, 2.5rem);
  font-size: var(--size-small);
}

.bar-links a {
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 160ms var(--ease-out);
}

.bar-links a:hover {
  opacity: 1;
}

.bar .button {
  justify-self: end;
}

/* The arch: one canvas over the section backgrounds and under the content.
   Sections never take a z-index, so the canvas (1) sits between their
   backgrounds and the content above it (2). */

.arch3d {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1200ms var(--ease-out);
}

.has-arch3d .arch3d {
  opacity: 1;
}

/* Run: the hero holds while the arch splits into the two markets ------- */

.run {
  background: var(--night);
  color: var(--ink-light);
}

.hero {
  position: relative;
  height: 100svh;
  min-height: 40rem;
  overflow: hidden;
}

.arch {
  position: absolute;
  left: 50%;
  bottom: -3svh;
  height: 97svh;
  min-height: 36rem;
  aspect-ratio: 32 / 26;
  translate: -50% 0;
}

/* Without WebGL the flat arch of the mark stands in. */
.arch-fallback {
  position: absolute;
  top: 3.85%;
  left: 3.125%;
  width: 93.75%;
  height: auto;
  color: var(--green);
  transition: opacity 600ms var(--ease-out);
}

.has-arch3d .arch-fallback {
  opacity: 0;
}

.hero-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(5svh, 2.5rem);
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: min(46rem, calc(100% - var(--margin) * 2));
  text-align: center;
  translate: -50% 0;
}

.hero-copy p {
  color: var(--ink-light-soft);
  text-wrap: balance;
}

.hero-copy .button {
  margin-top: 0.5rem;
}

/* The two markets, held between the halves of the arch. */
.cover {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: var(--section-gap) var(--margin);
  text-align: center;
}

.cover h2 {
  max-width: 12em;
}

.cover > p {
  max-width: 30em;
  color: var(--ink-light-soft);
  text-wrap: balance;
}

.markets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 36rem;
  margin-top: 1.5rem;
}

.market {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  align-content: start;
}

.market h3 {
  color: var(--green);
  font-size: var(--size-body);
  letter-spacing: 0;
}

.market-stat {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  max-width: 14em;
  text-wrap: balance;
}

.market-stat b {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 4.2vw, 4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* The sources sit under the coverage they feed, quieter than it. */
.market ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
  color: var(--ink-light-soft);
  font-size: var(--size-small);
}

/* Pinned only when motion is welcome. With reduced motion (or no script) the hero
   and the two markets read as two plain sections, one after the other. */
@media (prefers-reduced-motion: no-preference) {
  .js .run {
    height: 240svh;
  }

  /* A sticky box is a stacking context of its own, so the whole stage sits over the
     canvas. It has no background, so the arch shows through everywhere but the text. */
  .js .run-stage {
    position: sticky;
    z-index: 2;
    top: 0;
    height: 100svh;
    min-height: 40rem;
    overflow: hidden;
  }

  .js .cover {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(36rem, calc(100% - var(--margin) * 2));
    padding: 0;
    translate: -50% -50%;
    opacity: 0;
    visibility: hidden;
  }
}

/* Tools: four cards ---------------------------------------------------- */

/* One night field from the hero to the close, so the arch never crosses a seam. */
.tools {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding: var(--section-gap) var(--margin);
  background: var(--night);
  color: var(--ink-light);
}

.tools > h2,
.bento {
  position: relative;
  z-index: 2;
}

.tools h2 {
  max-width: 18em;
  margin-inline: auto;
  text-align: center;
}

/* Where the arch settles above the products. Without WebGL the flat mark stands in. */
.arch-dock {
  justify-self: center;
  height: clamp(8rem, 13vw, 11rem);
  aspect-ratio: 32 / 26;
  margin-bottom: -1.5rem;
}

.arch-dock img {
  width: 46%;
  margin: 18% auto 0;
  transition: opacity 600ms var(--ease-out);
}

.has-arch3d .arch-dock img {
  opacity: 0;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.card {
  position: relative;
  grid-column: span 5;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2rem;
  min-height: 34rem;
  padding: 2.25rem 2.25rem 0;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--ink);
}

.card-wide {
  grid-column: span 7;
}

.card-deep {
  background: var(--deep);
  color: var(--ink-light);
}

.card-night {
  background: var(--night-2);
  color: var(--ink-light);
}

.card-head {
  display: grid;
  justify-items: start;
  gap: 0.625rem;
}

.card-head p {
  max-width: 30em;
  color: var(--ink-soft);
}

:is(.card-deep, .card-night) .card-head p {
  color: var(--ink-light-soft);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  margin-block: -0.25rem -0.75rem;
  font-size: var(--size-small);
  font-weight: 500;
  text-decoration: none;
}

.card-link span {
  transition: transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.3em;
  }

  .card-link:hover span {
    transform: translateX(3px);
  }
}

.stage {
  position: relative;
  min-height: 16rem;
  margin-inline: -2.25rem;
  overflow: hidden;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The fragments sit at interface size, cropped by the card's foot. */
[data-ui].frag {
  position: absolute;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

[data-ui].frag-bl {
  top: 2.5rem;
  left: 2rem;
  right: -2rem;
  display: grid;
  gap: 14px;
  padding: 22px 24px 40px;
  border: 1px solid oklch(90% 0.006 160);
  border-radius: 12px;
  background: oklch(99.4% 0.002 140);
  color: oklch(22% 0.01 160);
  font-size: 15px;
  line-height: 23px;
}

[data-ui] .frag-q {
  padding: 10px 12px;
  border-radius: 8px;
  background: oklch(95% 0.006 160);
  font-size: 14px;
}

[data-ui] .frag-a {
  font-weight: 500;
}

[data-ui] mark {
  border-radius: 2px;
  background: oklch(94% 0.09 100);
  color: inherit;
}

[data-ui] .chip {
  display: inline-block;
  padding: 0 7px;
  border-radius: 4px;
  background: oklch(22% 0.01 160);
  color: oklch(98% 0 0);
  font-size: 11px;
  font-weight: 400;
  line-height: 19px;
  white-space: nowrap;
}

[data-ui] .frag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

[data-ui] .frag-pills span {
  padding: 2px 9px;
  border-radius: 999px;
  background: oklch(93% 0.006 160);
  font-size: 12px;
}

[data-ui] .frag-pills .warn {
  background: #fdefd0;
  color: oklch(42% 0.09 70);
}

[data-ui] .frag-pills .soft {
  background: none;
  color: oklch(46% 0.01 160);
}

[data-ui].frag-co {
  inset: 50% auto auto 50%;
  display: grid;
  gap: 6px;
  width: min(22rem, calc(100% - 3rem));
  padding: 22px 24px 26px;
  border: 0;
  border-radius: 12px;
  background: oklch(99.4% 0.002 140);
  color: oklch(22% 0.01 160);
  font-size: 14px;
  text-align: left;
  translate: -50% -50%;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  [data-ui].frag-co:hover {
    transform: translateY(-2px);
  }
}

[data-ui].frag-co:active {
  transform: scale(0.98);
}

[data-ui] .co-date {
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  background: oklch(93% 0.02 150);
}

[data-ui] .co-date span {
  color: oklch(46% 0.01 160);
}

[data-ui] .co-date b {
  font-weight: 500;
}

[data-ui] .co-label,
[data-ui] .co-src {
  color: oklch(46% 0.01 160);
}

[data-ui] .co-label {
  margin-top: 10px;
}

[data-ui] .co-value {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

[data-ui] .co-date b,
[data-ui] .co-value,
[data-ui] .co-src {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), filter 220ms var(--ease-out);
}

[data-ui] .co-value {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), filter 220ms var(--ease-out), color 300ms var(--ease-out);
}

[data-ui].frag-co[data-asof="2019"] .co-value {
  color: oklch(42% 0.12 150);
}

[data-ui].frag-co.is-swapping :is(.co-date b, .co-value, .co-src) {
  opacity: 0;
  filter: blur(2px);
}

[data-ui].frag-co.is-swapping .co-value {
  transform: translateY(6px);
}

[data-ui].frag-sy {
  top: 2.5rem;
  left: 50%;
  display: grid;
  gap: 6px;
  width: min(25rem, calc(100% - 3rem));
  padding: 20px 22px 28px;
  border: 1px solid oklch(90% 0.006 160);
  border-radius: 14px;
  background: var(--white);
  color: oklch(20% 0.02 165);
  font-size: 14px;
  translate: -50% 0;
}

[data-ui] .sy-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
}

[data-ui] .sy-head b,
[data-ui] .sy-row b {
  font-weight: 500;
}

[data-ui] .sy-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: oklch(94% 0.06 85);
  color: oklch(40% 0.09 70);
  font-size: 12.5px;
}

[data-ui] .sy-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

[data-ui] .sy-gauge {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: oklch(93% 0.006 160);
}

[data-ui] .sy-gauge i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 1%);
  border-radius: inherit;
  background: oklch(46% 0.09 165);
}

[data-ui] .sy-gauge.is-low i {
  background: oklch(64% 0.13 60);
}

[data-ui] .sy-foot {
  margin-top: 10px;
  color: oklch(45% 0.015 165);
  font-size: 12.5px;
}

/* Closing: the mountain through three windows */

.close {
  position: relative;
  height: max(36rem, 92svh);
  overflow: hidden;
  background: var(--night);
  color: var(--ink-light);
}

.close-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.close-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Keeps the headline clear on the dark floor and fades the top into the band. */
.close-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--night) 0%, transparent 18%), /* taste-skill-ignore: scrim over the photograph */
    linear-gradient(to top, oklch(14.5% 0.015 160 / 0.88) 0%, oklch(14.5% 0.015 160 / 0.6) 24%, transparent 50%); /* taste-skill-ignore: scrim over the photograph */
}

.close-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(7svh, 3rem);
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  width: min(48rem, calc(100% - var(--margin) * 2));
  translate: -50% 0;
  text-align: center;
}

.close-copy p {
  color: var(--ink-light-soft);
  text-wrap: balance;
}

.close-copy .button {
  margin-top: 0.5rem;
}

/* Footer ---------------------------------------------------------------- */

.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3rem;
  position: relative;
  z-index: 2;
  padding: clamp(3.5rem, 6vw, 5rem) var(--margin) 2rem;
  overflow: clip;
  background: var(--night);
  color: var(--ink-light);
}

.foot-brand {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.875rem;
}

.foot-brand p {
  max-width: 28em;
  color: var(--ink-light-soft);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 2rem clamp(3rem, 6vw, 6rem);
  font-size: var(--size-small);
}

.foot-head {
  margin-bottom: 0.875rem;
  color: var(--ink-light-soft);
}

.foot-cols ul {
  display: grid;
  gap: 0.5rem;
}

.foot-cols a {
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .foot-cols a:hover {
    color: var(--green);
  }
}

.credits {
  grid-column: 1 / -1;
  padding-top: 1rem;
  color: var(--ink-light-soft);
  font-size: var(--size-small);
}

.noscript {
  padding: 1rem var(--margin);
}

/* The request form, over the page --------------------------------------- */

.access {
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  scrollbar-color: oklch(78% 0.014 150) var(--paper);
  scrollbar-width: thin;
  opacity: 0;
  transition-property: opacity, transform, overlay, display;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

.access[open] {
  opacity: 1;
  transition-duration: 240ms;
}

.access::backdrop {
  background: oklch(14.5% 0.015 160 / 0.78);
  opacity: 0;
  transition-property: opacity, overlay, display;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

.access[open]::backdrop {
  opacity: 1;
  transition-duration: 200ms;
}

@starting-style {
  .access[open],
  .access[open]::backdrop {
    opacity: 0;
  }
}

.access-in {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
}

.access-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.access-lede {
  margin-top: -0.75rem;
  color: var(--ink-soft);
}

.access-in:has(.access-success:not([hidden])) .access-lede {
  display: none;
}

.access-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: var(--paper-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

.access-close:hover {
  background: oklch(88% 0.01 140);
}

.access-close svg {
  width: 1.125rem;
}

.picker {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.picker legend {
  margin-bottom: 0.625rem;
  padding: 0;
  font-weight: 500;
}

.picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  background: var(--paper-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

.option:hover,
.option:has(input:checked) {
  background: oklch(88% 0.05 150);
}

.option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--deep);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem 10px;
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: var(--size-small);
  font-weight: 500;
}

.field label span {
  color: var(--ink-soft);
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 0.875rem;
  border: 0;
  border-bottom: 2px solid var(--ink-soft);
  border-radius: 0;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 160ms var(--ease-out);
}

.field input:focus-visible {
  border-bottom-color: var(--deep);
  outline: none;
}

.field input[aria-invalid="true"] {
  border-bottom-color: oklch(55% 0.17 35);
}

.field-error {
  color: oklch(48% 0.16 35);
  font-size: var(--size-small);
}

.field-error:not(:empty) {
  margin-top: 0.3rem;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px; /* taste-skill-ignore: visually hidden, not a rule */
  overflow: hidden;
  clip-path: inset(50%);
}

.submit {
  width: 100%;
  height: 52px;
  margin-top: 1.25rem;
  border: 0;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.submit:active:not(:disabled) {
  transform: scale(0.97);
}

.submit:hover {
  background: var(--green-hover);
}

.submit:disabled {
  cursor: progress;
  opacity: 0.7;
}

.form-status {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: var(--size-small);
}

.access-success {
  display: grid;
  gap: 0.5rem;
  transition: opacity 200ms var(--ease-out);
}

@starting-style {
  .access-success {
    opacity: 0;
  }
}

.access-success[hidden] {
  display: none;
}

/* Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .hero-copy > * {
    animation: rise 900ms var(--ease-out) both;
  }

  .js .hero-copy > :nth-child(2) { animation-delay: 120ms; }
  .js .hero-copy > :nth-child(3) { animation-delay: 220ms; }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease-out) var(--delay, 0ms), transform 900ms var(--ease-out) var(--delay, 0ms);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }

  .js [data-ui] .sy-gauge i {
    transform-origin: left;
    transition: transform 1100ms var(--ease-out) 300ms;
  }

  .js .card:not(.is-in) [data-ui] .sy-gauge i {
    transform: scaleX(0);
  }

  .js [data-ui] .frag-a .w {
    transition: opacity 260ms var(--ease-out) calc(500ms + var(--i) * 32ms);
  }

  .js [data-ui] .frag-pills span {
    transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
    transition-delay: calc(700ms + var(--words, 0) * 32ms);
  }

  .js [data-ui] .frag-pills span:nth-child(2) {
    transition-delay: calc(780ms + var(--words, 0) * 32ms);
  }

  .js [data-ui] .frag-pills span:nth-child(3) {
    transition-delay: calc(860ms + var(--words, 0) * 32ms);
  }

  .js .card:not(.is-in) [data-ui] .frag-a .w,
  .js .card:not(.is-in) [data-ui] .frag-pills span {
    opacity: 0;
  }

  .js .card:not(.is-in) [data-ui] .frag-pills span {
    transform: translateY(4px);
  }


  .access {
    transform: translateY(6px);
  }

  .access[open] {
    transform: none;
  }

  .access-success {
    transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  }

  @starting-style {
    .access[open] {
      transform: translateY(12px);
    }

    .access-success {
      transform: translateY(8px);
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}


/* Tablet ---------------------------------------------------------------- */

@media (max-width: 64rem) {
  .bar {
    grid-template-columns: 1fr auto;
  }

  .bar-links {
    display: none;
  }

  .card,
  .card-wide {
    grid-column: 1 / -1;
    min-height: 28rem;
  }
}

/* Phone ----------------------------------------------------------------- */

@media (max-width: 40rem) and (prefers-reduced-motion: no-preference) {
  /* The arch sits at the top of the phone screen, so the two markets read below it. */
  .js .cover {
    top: auto;
    bottom: 2rem;
    gap: 1rem;
    translate: -50% 0;
  }
}

@media (max-width: 40rem) {
  /* Section headings scale with the screen, like the hero headline, so none runs past two lines. */
  :root {
    --size-section: min(7.2vw, 1.875rem);
  }

  /* The arch sits above the headline instead of around it. */
  .hero {
    display: grid;
    align-content: end;
    height: auto;
    min-height: 0;
    padding: 5rem var(--margin) 3.5rem;
  }

  .arch {
    position: relative;
    left: auto;
    bottom: auto;
    width: calc(100% + var(--margin) * 2);
    height: auto;
    min-height: 0;
    margin: 0 calc(-1 * var(--margin)) 1rem;
    translate: none;
  }

  .hero-copy {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    translate: none;
  }

  .hero-copy h1 {
    font-size: 7.8vw;
  }

  .card,
  .card-wide {
    min-height: 0;
    padding: 1.5rem 1.5rem 0;
  }

  /* The stage keeps its own height, so a longer description never crops the fragment. */
  .stage {
    min-height: 21rem;
    margin-inline: -1.5rem;
  }

  [data-ui].frag-bl {
    left: 1rem;
  }

  .js .hero {
    height: 100svh;
    min-height: 0;
  }

  .markets {
    gap: 1rem;
    margin-top: 1rem;
  }

  .market-stat b {
    font-size: 2.5rem;
  }

  .market ul {
    gap: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }

  .close {
    height: max(34rem, 86svh);
  }

  .close-copy {
    bottom: 2.5rem;
    width: calc(100% - var(--margin) * 2);
  }

  .foot {
    grid-template-columns: 1fr;
  }

  .foot-cols {
    grid-template-columns: 1fr 1fr;
  }

  .fields {
    grid-template-columns: 1fr;
  }

  .access-in {
    padding: 1.5rem;
  }
}
