/* Starpilot — site styles
   Tokens are implementation choices derived from the brandbook's grayscale,
   not values extracted from it. */

/* Self-hosted type (assets/fonts): Suisse Int'l for everything, in the three
   weights the site uses. Light and Regular are preloaded for first paint. */
@font-face { font-family: "Suisse Intl"; font-weight: 300; font-style: normal; font-display: swap; src: url(/assets/fonts/SuisseIntl-Light.woff2) format("woff2"); }
@font-face { font-family: "Suisse Intl"; font-weight: 400; font-style: normal; font-display: swap; src: url(/assets/fonts/SuisseIntl-Regular.woff2) format("woff2"); }
@font-face { font-family: "Suisse Intl"; font-weight: 500; font-style: normal; font-display: swap; src: url(/assets/fonts/SuisseIntl-Medium.woff2) format("woff2"); }

:root {
  --bg: #0a0a0a;
  --fg: #e9e9e7;
  --fg-2: #a3a3a1;
  --fg-3: #7f7f7d;
  --rule: rgba(255, 255, 255, 0.10);
  --focus: rgba(255, 255, 255, 0.70);
  --pad: clamp(20px, 4vw, 48px);
  --sans: "Suisse Intl", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --body: 300 clamp(17px, 1.5vw, 19px) / 1.6 var(--sans); /* all body copy */
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

html {
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 6px;
  border-radius: 1px;
}

/* Small technical labels: one type treatment shared by every caption-sized
   element (labels, nav, skip link, back link, entry links, section numbers). */
.label, .skip, .nav a, .back, .entry .links a, .article h3 .num {
  font: 400 11px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.label { color: var(--fg-3); }

.skip {
  position: absolute;
  left: var(--pad);
  top: -60px;
  z-index: 10;
  padding: 12px 14px;
  background: var(--bg);
}
.skip:focus { top: var(--pad); }

/* Header ---------------------------------------------------------------- */

.site-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: var(--pad);
}

.nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: clamp(6px, 2vw, 24px);
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--fg-3);
  white-space: nowrap;
  transition: color 0.4s ease;
}
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 11px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

/* Footer ---------------------------------------------------------------- */

.site-foot {
  position: relative;
  z-index: 2;
  min-height: calc(44px + 2 * var(--pad)); /* matches the header's nav row */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: var(--pad);
}

/* Brand mark: the supplied logo SVG as a mask, filled with the foreground
   colour so it matches the type on the dark ground. */
.logo {
  display: block;
  width: 30px;
  height: 30px;
  background: var(--fg);
  -webkit-mask: url(/assets/logo.svg) center / contain no-repeat;
  mask: url(/assets/logo.svg) center / contain no-repeat;
}
.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0;
}

/* Home ------------------------------------------------------------------ */

/* The footer clock's right edge lines up with the nav text above it, which
   sits inside the links' 6px side padding. */
.site-foot--home .clock { margin-right: 6px; }

.hero {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
/* Sphere container: width drives the size, 11:8 matches the composition. */
.sphere {
  flex: none;
  position: relative;
  width: min(101vh, 128vw);
  aspect-ratio: 11 / 8;
}
.sphere > canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Static fallback until the canvas is ready, or when it cannot render. */
.sphere-fallback {
  position: absolute;
  left: 45.5%;
  top: 50%;
  width: 77%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 44% 46%,
    rgba(255, 255, 255, 0.11),
    rgba(255, 255, 255, 0.04) 54%,
    rgba(255, 255, 255, 0) 72%);
}
.sphere[data-ready="true"] > .sphere-fallback { display: none; }

.hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--pad);
}
/* Supplied wordmark (assets/wordmark.svg, 3327:300) as a mask so it takes
   the foreground colour; width tracks the viewport like the old text did. */
.hero-mark { line-height: 0; }
.hero-mark .mark {
  display: block;
  width: clamp(200px, 39vw, 620px);
  aspect-ratio: 3327 / 300;
  background: var(--fg);
  -webkit-mask: url(/assets/wordmark.svg) center / contain no-repeat;
  mask: url(/assets/wordmark.svg) center / contain no-repeat;
  filter: drop-shadow(0 0 28px rgba(10, 10, 10, 0.85));
}

.clock {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* same row height as .nav a, so the text centres together */
  white-space: pre;
  font-variant-numeric: tabular-nums;
}

/* Inner pages ----------------------------------------------------------- */

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.8; /* marginal overall dim for legibility */
  /* Dim the field behind the text column so the copy stays legible over the
     dense dust; the mask fades back to full strength across the page. */
  -webkit-mask-image: radial-gradient(ellipse 58% 62% at 22% 42%, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.6) 55%, #000 100%);
  mask-image: radial-gradient(ellipse 58% 62% at 22% 42%, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.6) 55%, #000 100%);
}
.field-dim #field { opacity: 0.45; }
.page-body, .entry { text-shadow: 0 0 18px rgba(10, 10, 10, 0.9); }

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Same top offset on every inner page so the copy starts at one height. */
  padding: clamp(40px, 12vh, 140px) var(--pad) clamp(24px, 8vh, 96px);
}

/* Whatever follows the hidden heading is the first visible thing. */
.page-body > .visually-hidden + * { margin-top: 0; }
.research-index li:first-child { border-top: 0; }
.research-index li:first-child a { padding-top: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.page-body {
  position: relative;
  max-width: 34rem;
}
.placeholder {
  font: var(--body);
  color: var(--fg-2);
  max-width: 30rem;
}

/* Vision statement: two equal paragraphs. */
.statement .placeholder + .placeholder { margin-top: clamp(20px, 3.5vh, 32px); }

.slot {
  margin-top: clamp(28px, 6vh, 56px);
  font: var(--body);
  color: var(--fg-2);
  max-width: 30rem;
}

/* Research ---------------------------------------------------------------- */

.research-index {
  list-style: none;
  padding: 0;
  margin-top: 0;
  max-width: 40rem;
}
.research-index li { border-top: 1px solid var(--rule); }
.research-index li:last-child { border-bottom: 1px solid var(--rule); }
.research-index a {
  display: block;
  padding: clamp(20px, 3vh, 30px) 0;
  color: var(--fg-2);
  transition: color 0.4s ease;
}
.research-index a:hover, .research-index a:focus-visible { color: var(--fg); }
.research-index .label { display: block; margin-bottom: 12px; white-space: nowrap; }
.research-index .title {
  display: block;
  font: var(--body); /* same size as the body copy on Vision and Contact */
  line-height: 1.4;
}
.research-index .who { display: block; margin-top: 6px; font: 300 12px/1.5 var(--sans); color: var(--fg-3); }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0 clamp(24px, 4vh, 40px);
  color: var(--fg-3);
  transition: color 0.4s ease;
}
.back:hover { color: var(--fg); }
.back::before { content: "←"; margin-right: 10px; }

/* With script, the index and the two entries are separate views chosen by
   the URL hash. Without script, everything is shown in sequence. */
.view-entry .page-body { display: none; }
.view-entry .entry { margin-top: 0; padding-top: 0; border-top: 0; }
.entry[hidden] { display: none; }

.entry {
  max-width: 44rem;
  margin-top: clamp(64px, 12vh, 140px);
  padding-top: clamp(28px, 5vh, 48px);
  border-top: 1px solid var(--rule);
}
.entry-meta { display: block; margin-bottom: 20px; line-height: 1.7; white-space: nowrap; }
.entry h2 {
  font: 300 clamp(26px, 3vw, 40px) / 1.15 var(--sans);
  letter-spacing: -0.01em;
  max-width: 36rem;
}
.entry .byline { margin-top: 14px; font: 300 15px/1.5 var(--sans); color: var(--fg-2); }
.entry .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 28px;
}
.entry .links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--rule);
  transition: color 0.4s ease, border-color 0.4s ease;
}
.entry .links a:hover { color: var(--fg); border-color: var(--fg-2); }

.article { margin-top: clamp(32px, 5vh, 56px); }
.article > p, .article li {
  font: var(--body);
  color: var(--fg-2);
  margin-top: 1.2em;
}
.article .lede { color: var(--fg); }
.article h3 {
  margin-top: clamp(48px, 8vh, 80px);
  font: 400 clamp(20px, 2vw, 26px) / 1.3 var(--sans);
  color: var(--fg);
}
.article h3 .num {
  display: block;
  margin-bottom: 10px;
  color: var(--fg-3);
}
.article h4 {
  margin-top: 2.2em;
  font: 400 17px/1.4 var(--sans);
  color: var(--fg);
}
.article .callout {
  margin-top: 2em;
  padding-left: 20px;
  border-left: 1px solid var(--rule);
  font: 300 clamp(19px, 1.8vw, 24px) / 1.4 var(--sans);
  color: var(--fg);
}
.article ul { padding-left: 1.1em; }
.article figure { margin: 2.2em 0 0; }
.article figure img,
.article figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #0f0f0f;
}
.article figure video { aspect-ratio: 16 / 9; object-fit: cover; }
.article figcaption {
  margin-top: 12px;
  font: 300 14px/1.55 var(--sans);
  color: var(--fg-3);
}
.article figcaption strong { font-weight: 400; color: var(--fg-2); }
.article .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 2.2em;
}
.article .grid figure { margin: 0; }
.fn { font-size: 0.65em; line-height: 0; vertical-align: super; margin-left: 1px; }
.fn a { color: var(--fg-3); }
.fn a:hover { color: var(--fg); }
.footnotes { margin-top: clamp(48px, 8vh, 80px); }
.footnotes ol { padding-left: 1.6em; margin-top: 16px; }
.footnotes li {
  font: 400 13px/1.6 var(--sans);
  color: var(--fg-3);
  margin-top: 0.7em;
}
.footnotes li:target { color: var(--fg-2); }
.abstract {
  margin-top: 24px;
  font: var(--body);
  color: var(--fg-2);
  max-width: 40rem;
}

/* Contact */
.contact-link {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 0;
  font: var(--body);
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.4s ease;
}
.contact-link:hover { border-color: var(--fg-2); }
.pending { color: var(--fg-2); }
.note { margin-top: 20px; display: block; text-transform: none; letter-spacing: 0.06em; line-height: 1.6; }

@media (max-width: 720px) {
  /* Two rows: logo, then the nav spread edge to edge. */
  .site-head { flex-direction: column; align-items: stretch; row-gap: 4px; }
  .home-link { align-self: center; margin-bottom: 8px; }
  /* Three equal columns with each link centred in its column: the three
     centres sit at 1/6, 1/2 and 5/6 of the width, symmetric under the logo. */
  .nav ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
  .nav li { justify-self: center; }
  .nav a { padding: 0; }
  .nav a[aria-current="page"]::after { left: 0; right: 0; }

  /* Home footer on phones: the two lines stack, centred. */
  .site-foot--home { flex-direction: column; justify-content: center; gap: 0; text-align: center; }
  .article .grid { grid-template-columns: 1fr; }
  .entry { margin-top: 64px; }

  /* Copy spans the full width on phones: centre the dimming mask. */
  #field {
    -webkit-mask-image: radial-gradient(ellipse 95% 42% at 50% 50%, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.5) 60%, #000 100%);
    mask-image: radial-gradient(ellipse 95% 42% at 50% 50%, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.5) 60%, #000 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
