/* Self-hosted fonts (SIL Open Font License; licence texts are in /fonts/). Variable files: one per script subset. */
@font-face {
  font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/hanken-grotesk-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/hanken-grotesk-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: 'Unbounded'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url(/fonts/unbounded-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Unbounded'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url(/fonts/unbounded-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;
}

:root {
  --field: #050816;        /* deep field: page background */
  --starlight: #E8ECF8;    /* primary text */
  --haze: #8C95B8;         /* secondary text */
  --agent: #7FA0FF;        /* the agents: cool */
  --human: #FFB648;        /* the one human: warm */
  --rule: rgba(255, 255, 255, 0.09);
  --display: "Unbounded", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--starlight);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, p, ul { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--human); outline-offset: 4px; border-radius: 2px; }

/* ---------- one screen ---------- */
.screen {
  position: relative;
  min-height: 100vh;       /* for browsers without svh */
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

/* The universe fills the screen; the copy sits over its quiet left side. */
.stage { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; }
.stage canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; display: block; }
.stage::before, .stage::after { content: ""; position: absolute; pointer-events: none; z-index: 1; }
.stage::before { top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: linear-gradient(90deg, var(--field) 0%, rgba(5,8,22,0.8) 22%, rgba(5,8,22,0) 44%); }
.stage::after { right: 0; bottom: 0; left: 0; inset: auto 0 0 0; height: 16%; background: linear-gradient(180deg, rgba(5,8,22,0), rgba(5,8,22,0.85)); }

/* ---------- copy ---------- */
.copy {
  position: relative; z-index: 3;
  align-self: center;
  width: calc(min(36rem, 36vw) + var(--gutter));
  padding: 2.5rem 0 2.5rem var(--gutter);
}
h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.9rem, 3.25vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h1 span { display: block; white-space: nowrap; }
h1 .one { color: var(--human); }
.lede {
  margin-top: 1.5rem;
  max-width: 30rem;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  color: var(--haze);
}
.lede strong { color: var(--starlight); font-weight: 500; }
.goals {
  list-style: none; padding: 0;
  margin-top: 2rem;
  max-width: 30rem;
}
.goals li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
}
.goals li:last-child { border-bottom: 1px solid var(--rule); }

/* ---------- galaxy labels ---------- */
.glabel {
  position: absolute; z-index: 2;
  white-space: nowrap; line-height: 1.25;
  font-size: calc(0.8rem * var(--k, 1));
  opacity: var(--o, 1);
  color: var(--haze);
  text-shadow: 0 0 14px var(--field), 0 0 5px var(--field);
  transition: opacity 1.4s ease;
}
/* Until the script has given each label its place, show none of them (no pile in the corner). */
.stage:not(.ready) .glabel { opacity: 0; visibility: hidden; transition: none; }
.stage.intro .glabel { opacity: 0; }
.stage.intro .glabel.lit { opacity: var(--o, 1); }
.glabel .tag { font-family: var(--display); font-weight: 400; letter-spacing: 0.06em; }
.glabel.main {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.15rem;
  text-decoration: none; border-radius: 14px;
  font-size: 0.8rem;
}
.glabel.main .tag { color: var(--starlight); }
.glabel.main .site {
  font-size: 0.9rem; color: #AFC2FF;
  padding-bottom: 2px; border-bottom: 1px solid rgba(127,160,255,0.4);
  transition: color .2s, border-color .2s;
}
/* One plain line saying what the company makes. It hangs below the label box, so the tag and the site name stay exactly where they were. */
.glabel.main .what {
  position: absolute; top: 100%; left: 50%; transform: translateX(calc(-50% + var(--bx, 0px)));
  margin-top: 0.3rem; font-size: 0.72rem; color: var(--haze);
}
/* Narrower desktops: one long line would run into its neighbour or off the edge, so it wraps. */
@media (min-width: 900px) and (max-width: 1139px) {
  .glabel.main .what { white-space: normal; width: max-content; max-width: 10rem; text-align: center; line-height: 1.3; }
}

/* ---------- footer line ---------- */
.foot {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem 2rem;
  padding: 1rem var(--gutter);
  border-top: 1px solid var(--rule);
  font-size: 0.85rem; color: var(--haze);
}
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; }
.legend b { font-weight: 500; color: var(--starlight); }
.dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.08em; }
.dot-human { background: var(--human); box-shadow: 0 0 10px var(--human); }
.dot-agent { background: var(--agent); }
.dot-galaxy { background: transparent; border: 1px solid var(--agent); box-shadow: 0 0 8px rgba(127,160,255,0.6); }
.mail { text-decoration: none; opacity: 0.8; transition: color .2s, opacity .2s; }
.mail:hover { color: var(--starlight); opacity: 1; }
/* About and the pause control sit just left of the mail address, out of the flow, so nothing else in the line moves. */
.foot-end { position: relative; display: flex; }
.foot-extra { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin-right: 1.4rem; display: flex; gap: 1.2rem; white-space: nowrap; }
.foot-extra a, .foot-extra button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: none; opacity: 0.8; transition: color .2s, opacity .2s;
}
.foot-extra a:hover, .foot-extra button:hover { color: var(--starlight); opacity: 1; }

/* Just above the phone layout the footer line is at its tightest: close the gaps a little so About and Pause clear the legend. */
@media (min-width: 900px) and (max-width: 999px) {
  .legend { gap: 0.3rem 0.9rem; }
  .foot-extra { gap: 0.8rem; margin-right: 0.9rem; }
}

/* If larger text or wider letter spacing leaves no room beside the legend, About and Pause join the line instead of sitting over it (app.js). */
.foot.stack { flex-wrap: wrap; }
.foot.stack .foot-extra { position: static; transform: none; margin: 0 1.4rem 0 0; }

/* A wide but short window (a phone on its side): tighten the copy so the page still fits one screen. */
@media (min-width: 900px) and (max-height: 520px), (min-width: 1400px) and (max-height: 560px) {
  .copy { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .lede { margin-top: 0.7rem; line-height: 1.45; }
  .goals { margin-top: 0.8rem; }
  .goals li { padding: 0.3rem 0; }
  .foot { padding-top: 0.5rem; padding-bottom: 0.5rem; }
}

/* ---------- small screens: the universe sits above the copy, and the page scrolls ---------- */
@media (max-width: 899px) {
  .screen { display: block; }
  .stage { position: relative; top: auto; right: auto; bottom: auto; left: auto; inset: auto; height: 52vh; height: 52svh; min-height: 21rem; }
  .stage::before { display: none; }
  .stage::after { height: 22%; background: linear-gradient(180deg, rgba(5,8,22,0), var(--field)); }
  .copy { width: auto; padding: 0.5rem var(--gutter) 2.5rem; }
  h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
  h1 span { white-space: normal; }
  .glabel[data-galaxy="4"], .glabel[data-galaxy="5"] { display: none; }
  .glabel.main .site { font-size: 0.8rem; }
  /* No room for a standing line on a phone: the description is a bubble.
     Mouse: it shows on hover. Touch: a tap shows it, a second tap hides it (app.js). Keyboard: focus shows it. */
  .glabel.main .what {
    width: max-content; max-width: 9.5rem; white-space: normal; text-align: center; line-height: 1.3;
    margin-top: 0.5rem; padding: 0.45rem 0.65rem; border-radius: 10px;
    background: rgba(13,18,40,0.96); border: 1px solid rgba(127,160,255,0.45);
    color: var(--starlight); font-size: 0.75rem; text-shadow: none;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .glabel.main.open, .glabel.main:focus-visible { z-index: 4; }
  .glabel.main.open .what, .glabel.main:focus-visible .what { opacity: 1; }
  @media (hover: hover) {
    .glabel.main:hover { z-index: 4; }
    .glabel.main:hover .what { opacity: 1; }
  }
  .foot { flex-direction: column; align-items: flex-start; }
  .foot-end { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .foot-extra { position: static; transform: none; margin: 0; order: 1; }
  .foot-extra a, .foot-extra button { padding: 0.35rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  .glabel { transition: none; }
}

/* ---------- text for screen readers and crawlers only (describes the canvas) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- plain pages: About and Not found ---------- */
.page { max-width: 44rem; margin: 0 auto; padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) 4rem; }
.page .home { font-family: var(--display); font-weight: 400; letter-spacing: 0.06em; color: var(--starlight); text-decoration: none; }
.page h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 2.5rem 0 1.5rem; }
.page h1 span { white-space: normal; }
.page h2 { font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.02em; color: var(--starlight); margin: 2.4rem 0 0.6rem; }
.page p, .page li { color: #B4BCD8; line-height: 1.7; font-size: 1rem; }
.page p { margin: 0 0 1rem; }
.page ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.page a { color: #AFC2FF; text-underline-offset: 3px; }
.page a:hover { color: #fff; }
.page .fine { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--haze); }
