/*
 * Adrastea shared styles: design tokens, base elements and the site chrome
 * (nav, orbit, hero, buttons, closing call, footer). Page-specific styles live in /style.
 */

/* Fraunces draws its ampersand like an @, so that one character comes from a plainer serif.
   The unicode-range limits these faces to "&"; everything else falls through to Fraunces. */
@font-face {
  font-family: "Adrastea Ampersand";
  font-weight: 100 500;
  src: local("Georgia"), local("Times New Roman"), local("Noto Serif"), local("serif");
  unicode-range: U+0026;
}

@font-face {
  font-family: "Adrastea Ampersand";
  font-weight: 501 900;
  src: local("Georgia Bold"), local("Georgia-Bold"), local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Noto Serif Bold");
  unicode-range: U+0026;
}

:root {
  color-scheme: dark;
  --bg: #07040f;
  --brand: #7415c9;
  --lilac: #c9a7ff;
  --violet: #9a6bff;
  --pink: #f08adf;
  --ink: #f6f0ff;
  --mute: #a99bc9;
  --line: rgba(201, 167, 255, 0.18);
  --font-display: "Adrastea Ampersand", "Fraunces", Georgia, serif;
  --font-body: "Adrastea Ampersand", "Fraunces", Georgia, serif;
  --font-accent: "Instrument Serif", "Fraunces", Georgia, serif;
  --display-weight: 600;
  --display-tracking: -0.02em;
  --display-leading: 1.11;
  --gutter: clamp(20px, 6vw, 96px);
  --section-space: clamp(100px, 16vh, 200px);
  --radius: 28px;
  /* opaque, so the sky never shows through a card */
  --card: linear-gradient(160deg, rgba(116, 21, 201, 0.22), rgba(14, 8, 32, 0.55)), #0c0619;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  /* no scroll-behavior: smooth here; it makes ScrollTrigger measure positions mid-scroll on refresh */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* clip, not hidden: hidden would turn main into a scroll container and break position: sticky */
main {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

section {
  position: relative;
}

/* ---------- the sky behind every page (see sky.js) ---------- */

.site-sky {
  position: fixed;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  text-wrap: balance;
}

/* The tight display tracking suits large headlines; at card-title size it squeezes the letters,
   so smaller headings get more room. */
h3 {
  letter-spacing: -0.008em;
  line-height: 1.2;
}

h4 {
  letter-spacing: 0;
}

p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* emphasis words carry the accent typeface */
em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

h1 em,
h2 em {
  color: var(--lilac);
}

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 4px;
}

/* content sits above the orbit (z-index 10) */
.layer {
  position: relative;
  z-index: 20;
}

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

.skip-link {
  position: fixed;
  z-index: 300;
  top: 12px;
  left: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #14072b;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- loading screen (home, first visit of a session; see loader.js) ---------- */

.loader {
  position: fixed;
  z-index: 500;
  display: none;
  inset: 0;
  background:
    radial-gradient(50% 42% at 50% 46%, rgba(116, 21, 201, 0.34), transparent 72%),
    var(--bg);
  place-items: center;
  text-align: center;
  transition:
    transform 0.9s var(--ease),
    opacity 0.9s ease;
}

.is-loading .loader {
  display: grid;
}

.is-loading body {
  overflow: hidden;
}

/* the screen lifts away like a curtain */
.loader.is-leaving {
  opacity: 0;
  transform: translateY(-6%);
}

.loader-inner {
  display: grid;
  width: min(360px, 78vw);
  justify-items: center;
  animation: loader-in 0.9s var(--ease) both;
}

.loader-mark {
  width: 72px;
  height: 72px;
  box-shadow: 0 0 60px 6px rgba(116, 21, 201, 0.6);
}

.loader-name {
  margin-top: 26px;
  font-size: 1.5rem;
  font-weight: var(--display-weight);
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* balances the trailing letter-space so the word sits centred */
}

.loader-motto {
  margin-top: 6px;
  color: var(--mute);
  font-size: 1.05rem;
}

.loader-motto em {
  color: var(--lilac);
}

.loader-bar {
  overflow: hidden;
  width: 100%;
  height: 1px;
  margin-top: 34px;
  background: rgba(201, 167, 255, 0.2);
}

.loader-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), #fff);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.loader-meta {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--mute);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader-count {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@keyframes loader-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- nav: floating glass pill ---------- */

.nav {
  position: fixed;
  z-index: 100;
  top: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 8px 10px;
  border: 1px solid rgba(201, 167, 255, 0.28);
  border-radius: 999px;
  background: rgba(10, 5, 24, 0.88);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transform: translateX(-50%);
  transition: transform 0.45s var(--ease);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

/* slides away on scroll down, returns on scroll up (see components.js) */
.nav.hide {
  transform: translate(-50%, -170%);
}

.nav a {
  padding: 10px 2px; /* a taller target than the text alone */
  color: var(--mute);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.25s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 6px;
  color: var(--ink);
}

.nav .brand b {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: var(--display-weight);
  letter-spacing: 0.16em;
}

.nav .cta,
.nav .cta:hover,
.nav .cta[aria-current="page"] {
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #14072b;
  font-weight: 500;
}

/* the round emblem, cropped from the logo */
.mark {
  display: inline-block;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand) url("../images/general/emblem.jpg") center / cover;
}

@media (max-width: 620px) {
  .nav {
    gap: 16px;
  }

  .nav .brand {
    margin-right: 0;
  }

  .nav .brand b {
    display: none;
  }
}

/* ---------- the orbit: follows the visitor down every page (see motion.js) ---------- */

.orbit {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 1000px;
  height: 1000px;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.orbit svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  width: 100%;
  height: 100%;
}

.orbit path,
.orbit .orbit-ring {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.orbit-core {
  position: absolute;
  top: 31%;
  left: 31%;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: var(--brand) url("../images/general/emblem.jpg") center / cover;
  box-shadow:
    0 0 0 2px rgba(201, 167, 255, 0.55),
    0 0 120px 16px rgba(116, 21, 201, 0.5);
}

/* ---------- cursor star trail (see star-trail.js) ---------- */

.site-star-trail {
  position: fixed;
  z-index: 200;
  inset: 0 auto auto 0;
  pointer-events: none;
}

/* ---------- hero: text low on the left, the orbit overlaps from the right ---------- */

.hero {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: flex-end;
  padding: 150px var(--gutter) 11vh;
  background: radial-gradient(70% 55% at 72% 45%, rgba(116, 21, 201, 0.32), transparent 72%);
}

.hero h1 {
  max-width: 92vw;
  font-size: clamp(2.1rem, 4.6vw, 4.4rem);
}

.hero p {
  max-width: 560px;
  margin-top: 26px;
  color: var(--mute);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

/* on wide screens the copy stops short of the orbit's core */
@media (min-width: 720px) {
  .hero h1 {
    max-width: min(1100px, 52vw);
  }

  .hero p {
    max-width: min(560px, 52vw);
  }
}

/* the hero's second audience: a text link, so the two buttons above keep their weight */
.hero-aside {
  margin-top: 22px;
  font-size: 0.95rem;
}

/* ---------- buttons and links ---------- */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-block;
  padding: 16px 30px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #14072b;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 0.3s var(--ease),
    background-color 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.dark {
  border: 1px solid rgba(201, 167, 255, 0.55);
  background: rgba(14, 8, 32, 0.7);
  color: #fff;
}

.btn.dark:hover {
  background: rgba(116, 21, 201, 0.5);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--lilac);
  text-decoration: none;
}

.link::after {
  content: "\2192";
  transition: transform 0.3s var(--ease);
}

a.link:hover::after,
a:hover .link::after {
  transform: translateX(5px);
}

/* ---------- shared section pieces ---------- */

.section-title {
  max-width: 900px;
  margin-bottom: 56px;
  font-size: clamp(2rem, 4.4vw, 4rem);
}

/* the second sentence of a two-tone heading, set quieter than the first */
.soft {
  color: var(--mute);
}

.section-title + .section-lede {
  max-width: 62ch;
  margin: -28px 0 56px;
  color: var(--mute);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

/* A photo that fills its card; a brand-tinted scrim keeps the copy at the foot readable. */
.card-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  margin: 0;
  transition: transform 1.1s var(--ease);
}

/* taller than its frame so the parallax drift (data-parallax) never exposes an edge */
.card-photo img {
  position: absolute;
  top: -9%;
  left: 0;
  width: 100%;
  height: 118%;
  max-width: none;
  filter: saturate(0.92) contrast(1.04);
  object-fit: cover;
}

.card-photo::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(7, 4, 15, 0.96) 0%,
      rgba(7, 4, 15, 0.7) 38%,
      rgba(7, 4, 15, 0.12) 74%
    ),
    linear-gradient(135deg, rgba(116, 21, 201, 0.3), transparent 62%);
  content: "";
}

:hover > .card-photo {
  transform: scale(1.05);
}

/* small label with a coloured dot; --c ties it to a division's colour */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mute);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tag-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c, var(--ink));
  box-shadow: 0 0 14px var(--c, var(--ink));
}

/* a statement that lights up word by word as it is scrolled (data-scrub) */
.scrub {
  padding: clamp(120px, 22vh, 240px) var(--gutter);
}

.scrub p {
  max-width: 1100px;
  font-size: clamp(1.7rem, 3.5vw, 3.3rem);
  letter-spacing: -0.015em;
  line-height: 1.22;
}

/* ---------- scroll stages: a tall section whose sticky viewport is driven by scroll
   (the divisions ring on the home page, the roadmap constellation on the About page) ---------- */

.sticky {
  position: sticky;
  top: 0;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  background: radial-gradient(70% 60% at 70% 50%, rgba(116, 21, 201, 0.2), transparent 70%);
}

.copy {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: var(--gutter);
  width: min(440px, 38vw);
  height: 380px;
  transform: translateY(-50%);
}

/* leaving is quick; arriving waits for the leaver to go, so captions never overlap */
.step {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.step.on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.5s ease 0.18s,
    transform 0.5s ease 0.18s;
}

.step h2 {
  margin: 16px 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.step p {
  max-width: 40ch;
  color: var(--mute);
  font-size: 1.05rem;
  line-height: 1.6;
}

.step .link {
  margin-top: 18px;
}

/* on phones the ring sits in the upper half and the caption below it, clear of the docked orbit */
@media (max-width: 720px) {
  .copy {
    top: auto;
    right: 20px;
    bottom: 96px;
    left: 20px;
    width: auto;
    height: 290px;
    transform: none;
  }

  .step h2 {
    margin: 10px 0 8px;
    font-size: 1.9rem;
  }

  .step p {
    font-size: 0.98rem;
  }
}

/* ---------- split rows: a label on the left, its content on the right, separated by hairlines ---------- */

.split {
  display: grid;
  max-width: 1280px;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 24px clamp(24px, 4vw, 64px);
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 800px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- marquee rows (filled from data-marquee by motion.js) ---------- */

.mq {
  display: flex;
  margin: 10px 0;
  white-space: nowrap;
}

.mq-track {
  display: flex;
  flex: none;
  gap: 56px;
  padding-right: 56px;
  animation: mq 38s linear infinite;
}

.mq--reverse .mq-track {
  animation-duration: 46s;
  animation-direction: reverse;
}

.mq span,
.mq i {
  font-size: clamp(3rem, 9vw, 8rem);
}

.mq span {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
}

.mq span {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
}

/* logos are drawn for light backgrounds, so each sits on a light chip */
.mq-logo {
  width: auto;
  max-width: none;
  height: 0.62em;
  padding: 0.1em 0.16em;
  border-radius: 0.14em;
  background: var(--ink);
}

.mq--outline span {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(201, 167, 255, 0.7);
}

.mq i {
  flex: none;
  align-self: center;
  width: 0.22em;
  height: 0.22em;
  border-radius: 50%;
  background: var(--violet);
}

@keyframes mq {
  to {
    transform: translateX(-100%);
  }
}

/* ---------- closing call ---------- */

.join {
  display: grid;
  min-height: 100svh;
  padding: 140px 24px 100px;
  place-items: center;
  text-align: center;
}

.join h2 {
  margin-bottom: 30px;
  font-size: clamp(3rem, 9.5vw, 9rem);
}

.join p {
  max-width: 520px;
  margin: 0 auto 38px;
  color: var(--mute);
  font-size: 1.15rem;
}

.join .row {
  justify-content: center;
  margin-top: 0;
}

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding: 56px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  background: rgba(7, 4, 15, 0.8);
}

.foot .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: var(--display-weight);
  letter-spacing: 0.16em;
  text-decoration: none;
}

.foot-about {
  max-width: 36ch;
  margin-top: 18px;
  color: var(--mute);
  font-size: 0.95rem;
}

.foot-label {
  margin-bottom: 14px;
  color: var(--mute);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.foot ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot ul a {
  text-decoration: none;
  transition: color 0.25s;
}

.foot ul a:hover,
.foot ul a[aria-current="page"] {
  color: var(--lilac);
}

.foot-credit {
  color: var(--mute);
  font-size: 0.8rem;
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .foot {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
