/* Astra · the page
 * tokens.css holds the brand. This file holds the layout and the motion.
 * One screen. A sky before dawn that you can stir, a rocket that crosses it, the name, one line and the place.
 */

@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/assets/fonts/dm-sans.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/space-grotesk.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/space-mono.woff2") format("woff2"); }

:root {
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --craft: min(clamp(108px, 9.6vw + 64px, 236px), 26vh);   /* the rocket, nose to tail. Smaller on a short screen, where there is less sky above the words */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-sans); font-weight: var(--weight-body);
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: hidden; }
::selection { background: #FFFFFF; color: #000000; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---- the bar. The name, nothing else */
.bar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
       padding: clamp(18px, 2vw, 28px) var(--gutter); color: var(--fg); pointer-events: none; }
.brand { pointer-events: auto; display: inline-block; color: inherit; text-decoration: none;
         font-family: var(--font-display); font-optical-sizing: none; font-weight: var(--weight-strong); font-size: 1.3125rem; line-height: 1; letter-spacing: -0.02em; }
.brand:focus-visible { outline: 1px dashed currentColor; outline-offset: 6px; }

/* ---- the hero. It is the whole page */
.hero { position: relative; z-index: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; background: #000; }
.hero-art { position: absolute; inset: 0; }
.hero-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-art .fluid { opacity: 0; transition: opacity 0.4s ease; }
.hero[data-art="fluid"] .fluid { opacity: 1; }
.hero[data-art="fluid"] .sky { visibility: hidden; }

/* ---- the sky where the fluid does not run, in a browser that cannot run it or on a page without scripts. The same
   light and the same world as one still picture, stretched over the screen above the stars. tools/sky.py paints it */
html:not(.js) .hero-art::after, .hero[data-art="sky"] .hero-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/assets/sky-wide.webp?v=1") center / 100% 100% no-repeat;
}

/* ---- the rocket, a painted picture. It rests where the stylesheet puts it, and the script flies it there and floats
   it. The point it turns about sits six tenths of the way along it */
.craft { position: absolute; z-index: 1; left: 80%; top: 26%; width: var(--craft); height: calc(var(--craft) * 0.4);
         margin: calc(var(--craft) * -0.2) 0 0 calc(var(--craft) * -0.6); pointer-events: none; }
.rocket { display: block; width: 100%; height: 100%; transform-origin: 60% 50%; overflow: visible; transform: rotate(-32deg); }
.rocket .flame { transform-origin: 27px 24px; transform: scaleX(0); }
.js .craft { opacity: 0; }
.js .craft.out { opacity: 1; }

.hero-copy { position: absolute; z-index: 1; left: var(--gutter); bottom: clamp(64px, 12vh, 128px); width: min(100% - 2 * var(--gutter), 47rem);
             display: flex; flex-direction: column; align-items: flex-start; }
.hero h1 { font-family: var(--font-display); font-optical-sizing: none; font-weight: var(--weight-strong); font-size: clamp(2.5rem, 1.15rem + 4.5vw, 5.25rem);
           line-height: 1.02; letter-spacing: var(--tracking-display); color: var(--fg); text-wrap: balance; }
/* each word carries the silver itself, so it can rise on its own */
.hero h1 .w { display: inline-block; padding-block: 0.14em; margin-block: -0.14em;
              background: linear-gradient(180deg, var(--silver-top) 26%, var(--silver-bottom) 100%); -webkit-background-clip: text; background-clip: text;
              -webkit-text-fill-color: transparent; }
/* the place. It stands on the line the last word of the headline stands on. Its box is one line of the headline's own
   type, set at the same foot, and the words inside it are the label's, the size of the name in the bar */
.where { position: absolute; z-index: 1; right: var(--gutter); bottom: clamp(64px, 12vh, 128px); font-family: var(--font-display); font-optical-sizing: none;
         font-size: clamp(2.5rem, 1.15rem + 4.5vw, 5.25rem); line-height: 1.02; color: var(--text-4); }
.where span { display: inline-block; font-family: var(--font-mono); font-size: 1.3125rem; letter-spacing: 0.02em; }

/* ---- the words belong to the picture. They cannot be selected or copied from the page, the cursor stays an arrow over
   them as it is over the sky, and a finger held on them brings up nothing */
.hero { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: default; }

/* the words rise in, a line at a time */
.js [data-rise] { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 1.2s var(--ease-expo), transform 1.2s var(--ease-expo);
                  transition-delay: calc(var(--i, 0) * 100ms + 200ms); }
.js .risen [data-rise] { opacity: 1; transform: none; }

@media (max-width: 1199px) {
  .where { display: none; }
}
@media (orientation: portrait) {
  .craft { left: 78%; top: 20%; }
  html:not(.js) .hero-art::after, .hero[data-art="sky"] .hero-art::after { background-image: url("/assets/sky-tall.webp?v=1"); }
}
/* The still picture cannot draw its world in as the fluid does. On a wide screen where the last line of the headline
   reaches past 36 parts in a hundred of the width, the picture is drawn taller from the top by three times the excess,
   which lowers the rim clear of the words. 5.1 is the length of that line in ems, and the size is the headline's own */
@media (orientation: landscape) {
  html:not(.js) .hero-art::after, .hero[data-art="sky"] .hero-art::after {
    background-position: 50% 0;
    background-size: 100% calc(100% + max(0px, (var(--gutter) + 5.1 * clamp(2.5rem, 1.15rem + 4.5vw, 5.25rem) - 36vw) * 3));
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero-copy, .where { bottom: 36px; }
  .hero h1, .where { font-size: clamp(2rem, 9vh, 3rem); }
  html:not(.js) .hero-art::after, .hero[data-art="sky"] .hero-art::after {
    background-size: 100% calc(100% + max(0px, (var(--gutter) + 5.1 * clamp(2rem, 9vh, 3rem) - 33.5vw) * 3));
  }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-rise] { opacity: 1; transform: none; transition: none; }
}
