/* Reset + typographic base. Depends on tokens.css. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/SpaceGrotesk-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'V_myfont_002';
  src: url('../assets/fonts/V_myfont_002-Regular.otf') format('opentype'),
       url('../assets/fonts/V_myfont_002-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Cross-document view transitions.
 *
 * Pages are still separate documents — this is not a single-page app — but
 * the browser snapshots the old page, swaps the DOM and animates between the
 * two. Anything carrying a `view-transition-name` present on both pages is
 * treated as the *same* element and persists, so the bottom bar and brand
 * mark visibly stay put while only the body content changes.
 *
 * Chromium-only today; elsewhere navigation is an ordinary page load, which
 * is exactly the current behaviour. Nothing to fall back to.
 */
@view-transition {
  navigation: auto;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Clip horizontal overflow at the root. body's overflow-x:hidden doesn't
     contain position:fixed elements (the brand mark), so a wide wordmark could
     still create a horizontal scroll on mobile; this stops it. overflow-x
     doesn't create a scroll container the way `overflow:hidden` on both axes
     would, so the checkout summary's position:sticky keeps working. */
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Visible, consistent focus for keyboard users only. */
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* The persistent chrome must not cross-fade — a name alone would still make
   the browser animate old→new. Suppressing the animation is what turns
   "fades out and back" into "holds still". */
::view-transition-group(nav-pill),
::view-transition-group(bottom-bar),
::view-transition-group(brand-mark) {
  animation: none;
}

::view-transition-old(nav-pill),
::view-transition-new(nav-pill),
::view-transition-old(bottom-bar),
::view-transition-new(bottom-bar),
::view-transition-old(brand-mark),
::view-transition-new(brand-mark) {
  animation: none;
  mix-blend-mode: normal;
}

/* Only the page content cross-fades, and briefly. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Content that sits on top of the photo stage. */
.u-on-stage {
  color: var(--c-on-dark);
  text-shadow: 0 1px 24px rgb(0 0 0 / 0.35);
}
