/*
 * Lion Express base layer.
 * Contract: docs/renewal/DESIGN.md and tokens.css.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --lx-safe-top: env(safe-area-inset-top);
  --lx-safe-bottom: env(safe-area-inset-bottom);
  --lx-safe-left: env(safe-area-inset-left);
  --lx-safe-right: env(safe-area-inset-right);
  --lx-gutter-base: var(--lx-s-4);
  --lx-gutter: max(var(--lx-gutter-base), var(--lx-safe-left), var(--lx-safe-right));
}

html {
  min-width: 320px;
  background: var(--lx-deep);
  color: var(--lx-body);
  font-family: var(--lx-font);
  font-size: var(--lx-text-body);
  line-height: var(--lx-lh-body);
  letter-spacing: var(--lx-track-body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  :root {
    --lx-gutter-base: var(--lx-s-6);
  }
}

/* Overscroll is stopped only while a sheet or modal holds the scroll lock, so iOS Safari
   keeps pull-to-refresh on every page otherwise. */
html.lx-scroll-locked,
html.lx-scroll-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

body.lx-sheet-open {
  overscroll-behavior: none;
}

/* The browser's own focus scrolling keeps a focused control clear of the sticky header
   and the fixed bottom layers (buy bar, cookie notice). Controls inside those layers are
   left out: they never move with the page, so a margin would only scroll the page behind. */
:where(a[href], button, input, select, textarea, summary, [tabindex]):where(:not([data-lx-header] *, .lx-sheet *, .lx-buybar *, [data-lx-cookie] *)) {
  scroll-margin-block: calc(var(--lx-header-offset, var(--lx-header-h)) + var(--lx-s-3))
    calc(var(--lx-bottom-bar-h, 0px) + var(--lx-cookie-h, 0px) + var(--lx-s-7));
}

@media (max-width: 767px) {
  html:has(.lx-buybar:not([hidden])) {
    --lx-bottom-bar-h: calc(var(--lx-control-h) + var(--lx-s-3) * 2 + var(--lx-safe-bottom));
  }
}

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  background: var(--lx-paper);
  color: var(--lx-body);
  font-family: inherit;
  font-size: var(--lx-text-body);
  line-height: var(--lx-lh-body);
  letter-spacing: var(--lx-track-body);
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  min-width: 0;
  color: inherit;
}
@media (max-width: 767px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

button,
select {
  text-transform: none;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

a {
  color: var(--lx-link);
  text-decoration-line: underline;
  text-decoration-thickness: max(1px, .08em);
  text-underline-offset: .18em;
}

a:hover {
  text-decoration-thickness: max(2px, .1em);
}

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

img {
  height: auto;
}

svg {
  overflow: visible;
}

p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin-block: 0;
  padding-inline-start: 1.4em;
}

li + li {
  margin-block-start: var(--lx-s-1);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--lx-ink);
  font-feature-settings: "palt";
  letter-spacing: var(--lx-track-heading);
  text-wrap-style: balance;
}

h1 {
  font-size: var(--lx-text-h1);
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  font-size: var(--lx-text-h2);
  font-weight: 700;
  line-height: var(--lx-lh-heading);
}

h3 {
  font-size: var(--lx-text-h3);
  font-weight: 700;
  line-height: 1.45;
}

h4 {
  font-size: var(--lx-text-h4);
  font-weight: 700;
  line-height: 1.5;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: var(--lx-focus);
  outline-offset: var(--lx-focus-offset);
}

::selection {
  background: var(--lx-mist);
  color: var(--lx-deep);
}

.lx-container {
  width: min(100% - (var(--lx-gutter) * 2), var(--lx-content-max));
  margin-inline: auto;
}

.lx-section {
  padding-block: var(--lx-section-gap);
  background: var(--lx-paper);
}

.lx-section--fog {
  background: var(--lx-fog);
}

.lx-section--deep {
  background: var(--lx-deep);
  color: var(--lx-paper);
}

.lx-section--deep h1,
.lx-section--deep h2,
.lx-section--deep h3,
.lx-section--deep h4,
.lx-section--deep .lx-price {
  color: var(--lx-paper);
}

/* --lx-muted would fall below AA on --lx-deep (2.04:1); mist keeps the label quiet but legible. */
.lx-section--deep .lx-price__tax {
  color: var(--lx-mist);
}

.lx-section--deep a {
  color: var(--lx-paper);
}

/* The paper link color above would sit at 2:1 on primary buttons;
   buttons keep their own amber bg with deep text even inside deep sections. */
.lx-section--deep .lx-btn--primary {
  color: var(--lx-deep);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  inset-block-start: calc(var(--lx-s-3) + var(--lx-safe-top));
  inset-inline-start: calc(var(--lx-s-3) + var(--lx-safe-left));
  z-index: 1000;
  min-height: var(--lx-touch);
  padding: var(--lx-s-3) var(--lx-s-5);
  border-radius: var(--lx-radius-pill);
  background: var(--lx-paper);
  color: var(--lx-deep);
  box-shadow: var(--lx-shadow-float);
  font-weight: 700;
  transform: translateY(calc(-100% - var(--lx-s-6)));
  transition: transform var(--lx-dur) var(--lx-ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
