/* 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,
/* Centred like the lines under it: `margin: 0 0 14px` outranked their `0 auto` and left this line's 480 px box against
   the left of the 560 px column — 40 px off centre on any screen wider than about 608 px (2026-09-30). */
.boot__in .boot__h {
  margin: 0 auto 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 IF NOTHING HAS TAKEN THE FIRST SCREEN'S PLACE after twenty seconds — the showroom replaces it the moment its
   code runs: a browser too old to run that code would otherwise watch the light travel along the line for ever.
   A sentence that fades in by itself, with no script, which is the one thing such a browser is sure to do. */
.boot__in .boot__slow {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: #191d23;
  animation: boot-slow 0.6s ease-out 20s forwards;
}

@keyframes boot-slow {
  to {
    max-height: 12em;
    padding-top: 24px;
    opacity: 1;
  }
}

:root[data-nowebgl] .boot__in .boot__slow {
  display: none;
}

/* 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;
}

/* THE ROOM THAT COULD NOT GO ON (ui/Failure): the same first screen, laid out the way it is for a browser
   with no WebGL — the sentence, then the links right under it — plus the one button there is, to load the page
   again: solid ink, the pressed state of every control in the room. */
.boot--failed {
  grid-template-rows: auto auto;
  align-content: center;
}

.boot--failed .boot__nav {
  padding-top: 10px;
  font-size: 14px;
}

.boot--failed .boot__nav a {
  color: #191d23;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.boot__fail {
  margin-top: 28px !important;
  color: #191d23 !important;
}

.boot__retry {
  margin-top: 18px;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: #191d23;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.boot__retry:hover {
  background: #2c323b;
}

.boot__retry:focus-visible,
.boot__nav a:focus-visible {
  outline: 2px solid #0b7d5c;
  outline-offset: 3px;
}

.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;
  }
}

/* ---------- THE FILM BEFORE THE ROOM (site/intro.js) ------------------------------------------------------------------
   Over the first screen from the first paint, on the films' own white; the film fades in over it once it plays, and at
   the end its logotype is flown to the page's (intro.js: fly) while the white clears round it. Skipped or failed, the
   whole of it fades. Without a script nobody would ever take it down, so a browser that says it has none never shows
   it, and any other lets it go by itself after nine seconds of nobody taking charge of it. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
  background-color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 600ms ease,
    background-color 950ms cubic-bezier(0.45, 0, 0.2, 1) 120ms;
}

@media (scripting: none) {
  .intro {
    display: none;
  }
}

.intro:not([data-state]) {
  animation: intro-lapse 0.4s ease 9s forwards;
}

@keyframes intro-lapse {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Its box is set by intro.js (place): as big as fills the frame, as long as its logotype stays whole. */
.intro__film {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity 500ms ease;
  pointer-events: none;
}

.intro[data-state='play'] .intro__film,
.intro[data-state='leave'] .intro__film {
  opacity: 1;
}

/* Skipped, failed or ended with nowhere to fly to: all of it fades. */
.intro[data-state='leave'] {
  opacity: 0;
  pointer-events: none;
}

/* Ended: the film goes at once — its last frame is the white and the logotype laid over it — and the white clears. */
.intro:is([data-state='fly'], [data-state='gone']) {
  background-color: rgba(255, 255, 255, 0);
  pointer-events: none;
}

.intro[data-state='fly'] .intro__film {
  opacity: 0;
  transition: none;
}

.intro__mark {
  position: fixed;
  z-index: 1;
  display: block;
  margin: 0;
  color: #000;
  transform-origin: 0 0;
  pointer-events: none;
}

/* Skip, in the corner: a capsule of the header's smoked glass (src/ui/glass/tokens.css: --g-capsule-*), written out here
   because this sheet arrives before the showroom's. */
.intro__skip {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background-color: rgba(18, 22, 29, 0.52);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 60%, rgba(255, 255, 255, 0));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 14px 30px -16px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  color: #fff;
  font: 500 13px/1 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 400ms ease,
    background-color 180ms ease;
}

.intro[data-state='play'] .intro__skip {
  opacity: 1;
}

.intro__skip:hover {
  background-color: rgba(18, 22, 29, 0.7);
}

.intro__skip:focus-visible {
  outline: 2px solid #7ff0c8;
  outline-offset: 3px;
}

/* While the flown logotype is on its way, the page's own are not there: the one that lands is the only one. */
:root[data-intro='landing'] :is(.brand__mark, .boot__mark) {
  visibility: hidden;
}
