/* THE FIRST SCREEN — what index.html shows before the showroom's JavaScript has run, and what the showroom's
   own loader (ui/Loader) keeps showing, in the same places, until the room is ready: the logotype, what the
   page is, a loading bar and the links to the site's pages. It is also the whole page for a reader that never
   runs the room — a crawler, a browser without WebGL — so it is real text, not a picture of it.

   A file and not a <style> in the page: the CSP refuses inline styles (public/_headers). Published as
   assets/boot-<hash>.css by site/plugin.ts, so a changed sheet is a new address and no cache can pair an old one
   with a new page. Small on purpose, and asked for straight after the HTML, before the bundle. */

/* Inter from the first frame (the same files and subsets as src/styles.css, which repeats these for the
   showroom): without them the first screen is set in the system's face and changes font the moment the
   bundle's stylesheet arrives. The Latin file is preloaded by the page's head (site/layout.ts). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304,
    U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-rows: 1fr auto;
  background: #eef1f4;
  color: #191d23;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: center;
  transition: opacity 600ms ease;
}

.boot[data-done='true'] {
  opacity: 0;
  pointer-events: none;
}

.boot[hidden] {
  display: none;
}

.boot__in {
  align-self: center;
  justify-self: center;
  width: min(560px, 100% - 48px);
  padding: 24px 0;
}

.boot__mark {
  display: block;
  width: min(360px, 78vw);
  height: auto;
  aspect-ratio: 12781 / 557;
  margin: 0 auto 36px;
  color: #000;
}

.boot__in h1,
.boot__in .boot__h {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(25, 29, 35, 0.78);
}

.boot__in p {
  margin: 0 auto;
  max-width: 480px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(25, 29, 35, 0.62);
}

.boot__bar {
  position: relative;
  width: min(260px, 60vw);
  height: 1px;
  margin: 32px auto 0;
  overflow: hidden;
  background: rgba(25, 29, 35, 0.14);
}

.boot__bar i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  background: #191d23;
  transform: scaleX(var(--p, 0));
  transition: transform 200ms ease-out;
}

/* Before the loader knows how far it has got, a light that travels along the line instead of a figure. */
.boot__bar:not([data-p]) i {
  width: 30%;
  transform: translateX(-100%);
  animation: boot-travel 1.4s ease-in-out infinite;
}

@keyframes boot-travel {
  to {
    transform: translateX(340%);
  }
}

.boot__label {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(25, 29, 35, 0.68);
  font-variant-numeric: tabular-nums;
}

/* Only when the room cannot be drawn (main.tsx sets the flag) or no script runs at all. */
.boot__nogl {
  display: none;
  margin-top: 28px !important;
  color: #191d23 !important;
}

:root[data-nowebgl] .boot__nogl,
.boot__nojs {
  display: block;
}

:root[data-nowebgl] .boot__bar {
  display: none;
}

/* ... and then the links follow the sentence that points at them, instead of waiting at the bottom edge.
   `.boot:has(.boot__nojs)` is the page with no script at all: only then is the <noscript> made of elements. */
:root[data-nowebgl] .boot,
.boot:has(.boot__nojs) {
  grid-template-rows: auto auto;
  align-content: center;
}

:root[data-nowebgl] .boot__nav,
.boot:has(.boot__nojs) .boot__nav {
  padding-top: 10px;
  font-size: 14px;
}

:root[data-nowebgl] .boot__nav a,
.boot:has(.boot__nojs) .boot__nav a {
  color: #191d23;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.boot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 16px 20px max(18px, env(safe-area-inset-bottom));
  font-size: 12px;
}

.boot__nav a {
  color: rgba(25, 29, 35, 0.62);
  text-decoration: none;
}

.boot__nav a:hover,
.boot__nav a:focus-visible {
  color: #191d23;
  text-decoration: underline;
}

/* Languages Inter does not draw read better without the tracking the capitals are set with. */
:root:is([lang|='ar'], [lang|='he'], [lang|='hi'], [lang|='th'], [lang|='zh'], [lang|='ja'], [lang|='ko']) :is(.boot__in h1, .boot__h, .boot__label) {
  letter-spacing: 0;
}

@media (max-height: 520px) {
  .boot__mark {
    margin-bottom: 18px;
  }
  .boot__in p {
    display: none;
  }
}
