/* SWARM site: one scene, told by scrolling. Colours, fonts and the logo come
   from the Console (frontend/lib/tokens.ts, components/BrandLockup.tsx). */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cormorant-garamond-normal-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-normal-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cormorant-garamond-italic-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("fonts/funnel-sans-normal-300-500-latin.woff2") format("woff2");
}

:root {
  --black: #030406;
  --platinum: #eef0f3;
  --silver: #a8afb8;
  --ash: #7f8a98;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Funnel Sans", system-ui, sans-serif;
  --gutter: 20px;
}
@media (min-width: 760px) {
  :root { --gutter: 40px; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--platinum);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.top {
  position: fixed;
  top: 0; right: 0;
  z-index: 5;
  padding: 26px var(--gutter);
}
.top-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--silver);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.top-link:hover { color: var(--platinum); }

/* ── The story ───────────────────────────────────────────────────────────
   Without script it is a plain column of words. With it, one stage stays
   pinned while the page scrolls, and the words come and go over the city. */

.story { position: relative; }
.js .story { height: 640vh; }

.js .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

#field { display: none; }
.js #field {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The edges always sink; the two shades come and go with the words. */
.js .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 50%, rgba(3, 4, 6, 0) 52%, rgba(3, 4, 6, 0.9) 100%);
}
.shade { display: none; }
.js .shade {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.shade-center {
  background: radial-gradient(ellipse 48% 40% at 50% 50%, rgba(3, 4, 6, 0.9), rgba(3, 4, 6, 0) 100%);
}
@media (max-width: 759px) {
  .shade-center {
    background: radial-gradient(ellipse 95% 42% at 50% 50%, rgba(3, 4, 6, 0.94) 40%, rgba(3, 4, 6, 0) 100%);
  }
}
.shade-low {
  background: linear-gradient(to top, rgba(3, 4, 6, 0.94) 0%, rgba(3, 4, 6, 0.65) 28%, rgba(3, 4, 6, 0) 52%);
}

.chapter {
  text-align: center;
  padding: 22vh var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.js .chapter {
  position: absolute;
  left: 0; right: 0;
  z-index: 2;
  padding: 0 var(--gutter);
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}
.js .chapter.center { top: 0; bottom: 0; justify-content: center; }
.js .chapter.low { bottom: 11vh; }

/* The logo: the ring centred above the word, in the brand book's
   proportions (ring 0.225 of the word, gap 0.45). */
.lockup {
  --size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--size) * 0.45);
  margin: 0;
  font-weight: 500;
}
/* The ring sits over the A, not over the middle of the word: the letters
   left and right of the A are not the same width. Its letter-spacing trails
   to the right, so the glyph's centre is half the spacing left of the box's. */
.lockup .a { position: relative; }
.lockup .ring {
  position: absolute;
  left: calc(50% - 0.21em);
  bottom: calc(100% + 0.45em);
  transform: translateX(-50%);
  width: 0.225em;
  height: 0.225em;
  min-width: 8px;
  min-height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}
.lockup .word {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--size);
  line-height: 1;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  /* Room above the word for the ring (gap + ring), as before. */
  padding-top: calc(0.45em + 0.225em);
  text-transform: uppercase;
}
.lockup.big { --size: clamp(52px, 11vw, 132px); }

.tagline {
  margin: clamp(32px, 5vw, 52px) 0 0;
  font-size: clamp(17px, 1.9vw, 21px);
  color: var(--silver);
  letter-spacing: 0.01em;
  max-width: 52ch;
  text-wrap: balance;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}
.display em {
  display: inline-block;
  font-style: italic;
  color: var(--silver);
}

/* The closing: what SWARM sells, in two lines. */
.closing {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: clamp(28px, 4vw, 44px) 0 0;
}
.closing em { font-style: italic; color: var(--silver); }

.offers {
  list-style: none;
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
  max-width: 760px;
  text-align: left;
  font-size: 16px;
  line-height: 1.45;
  color: var(--silver);
}
@media (min-width: 760px) {
  .offers { grid-template-columns: 1fr 1fr; gap: 48px; }
}
.offers li { border-top: 0; padding-top: 0; }
.offers .for {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--platinum);
}

.button {
  display: inline-block;
  margin-top: 40px;
  padding: 18px 36px;
  border-radius: 999px;
  background: var(--platinum);
  color: var(--black);
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
}
.button:hover { background: #ffffff; }

/* "Contact" lands where the story ends. */
.anchor { display: block; }
.js .anchor {
  position: absolute;
  left: 0;
  top: calc(100% - 100vh);
  height: 1px;
}

footer {
  padding: 28px var(--gutter) 40px;
  font-size: 13px;
  color: var(--ash);
  text-align: center;
}
footer p { margin: 0; }
footer p + p { margin-top: 6px; }
footer a { text-decoration: none; color: var(--silver); }
footer a:hover { color: var(--platinum); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
