/* ==========================================================================
   Base: fonts, reset, type, focus, reduced motion.
   ========================================================================== */

/* Self-hosted, OFL-licensed (see /assets/fonts/OFL-*.txt). Latin subset.
   File names are versioned because /assets/* is cached for a year. */
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-var-v1.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Grenze Gotisch";
  src: url("/assets/fonts/grenze-gotisch-latin-var-v1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* The roman sibling of Grenze Gotisch, for headings below display size. */
@font-face {
  font-family: "Grenze";
  src: url("/assets/fonts/grenze-latin-800-v1.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  /* Nothing may pan the page sideways. `clip` keeps position: sticky working. */
  max-width: 100%;
  overflow-x: clip;
  background: var(--v-bg);
  color: var(--v-text);
  font-family: var(--v-font-text);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
h4,
p,
ol,
ul,
figure,
dl,
dd {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}

/* Headings break into even lines and paragraphs avoid a lone last word,
   where the browser can; elsewhere they wrap as usual. */
h1,
h2,
h3,
summary {
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code,
kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* The focus ring is gold on the night surfaces and ink on parchment: each
   surface sets --focus to a colour that stands out on it. */
:focus-visible {
  outline: 3px solid var(--focus, var(--v-title));
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border: var(--v-outline);
  border-radius: var(--v-radius-sm);
  background: var(--v-paper);
  color: var(--v-on-paper);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

/* The page column. */
.wrap {
  width: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--site-gutter);
}

/* Scroll reveal. The resting state is the final state: an element only
   starts hidden once script.js has said it will reveal it (`.can-reveal` on
   <html>), so the page is complete without JavaScript. */
/* The rise uses `translate`, not `transform`, so an element's own tilt
   (the live-count ticket, the titles) is left alone. */
.can-reveal [data-reveal] {
  opacity: 0;
  translate: 0 22px;
}
.can-reveal [data-reveal].is-in {
  opacity: 1;
  translate: none;
  transition:
    opacity var(--dur-3) var(--ease-out),
    translate var(--dur-3) var(--ease-out);
}

/* On paper nothing has been scrolled to, so nothing may wait to be revealed. */
@media print {
  .can-reveal [data-reveal] {
    opacity: 1;
    translate: none;
  }
}

/* Without JavaScript (boot.js never set .js) nothing can fetch the live
   count: leave out the parts that would say "checking" for ever. */
html:not(.js) .hero-presence,
html:not(.js) .ticket-head,
html:not(.js) .ticket-num,
html:not(.js) .ticket-label,
html:not(.js) .ticket-rows {
  display: none;
}

/* Reduced motion: everything still and visible. The class is set before
   first paint by boot.js; the media query covers the no-JS case. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .can-reveal [data-reveal] {
    opacity: 1;
    translate: none;
  }
}
.reduce-motion {
  scroll-behavior: auto;
}
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}
.reduce-motion.can-reveal [data-reveal] {
  opacity: 1;
  translate: none;
}
