/* ============================================================
   Cloud Nine — base
   Layout primitives, typography, the ascent background,
   navigation, altimeter, contact band, footer.
   ============================================================ */

/* Registered so it can be interpolated and read predictably. */
@property --ascent {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  color: var(--cirrus);
  background: var(--nightfall);
  -webkit-font-smoothing: antialiased;

  /* Each page occupies a band of the same sky. Overridden per page. */
  --ascent: 0;
  --progress: 0;
}

/* ------------------------------------------------------------
   The ascent

   One tall gradient behind everything. Scroll translates it
   downward, so progressively higher — and lighter — atmosphere
   fills the viewport. Transform only, so it stays on the
   compositor and never bands.
   ------------------------------------------------------------ */

.ascent {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ascent__sky {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 260vh;
  /* The sky lifts from pre-dawn to a high, open blue but never
     goes pale: every scrolling section keeps light text on it at
     4.5:1 or better. The bright arrival is delivered by
     .summit-plate at the end of the climb, not by the sky. */
  background: linear-gradient(
    to top,
    #060912 0%,
    var(--nightfall) 22%,
    #111c31 40%,
    var(--stratus) 58%,
    #22355a 74%,
    #263a5e 86%,
    var(--altitude) 100%
  );
  transform: translate3d(0, calc(var(--ascent) * 160vh), 0);
  will-change: transform;
}

/* Ambient drift. Two slow, blurred masses — barely perceptible,
   and the only thing keeping the sky from reading as flat. */
.ascent__drift {
  position: absolute;
  inset: -20%;
  opacity: 0.5;
  background:
    radial-gradient(
      42% 30% at 22% 34%,
      rgba(227, 183, 127, 0.13),
      transparent 70%
    ),
    radial-gradient(
      50% 36% at 78% 62%,
      rgba(201, 214, 232, 0.16),
      transparent 72%
    );
  animation: drift 96s var(--ease-soft) infinite alternate;
}

.ascent__drift--slow {
  opacity: 0.34;
  background:
    radial-gradient(
      38% 28% at 68% 22%,
      rgba(255, 255, 255, 0.11),
      transparent 70%
    ),
    radial-gradient(
      44% 32% at 30% 78%,
      rgba(46, 68, 104, 0.3),
      transparent 72%
    );
  animation: drift-slow 148s var(--ease-soft) infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(-3%, 1%, 0) scale(1);
  }
  to {
    transform: translate3d(4%, -3%, 0) scale(1.12);
  }
}

@keyframes drift-slow {
  from {
    transform: translate3d(3%, -2%, 0) scale(1.08);
  }
  to {
    transform: translate3d(-4%, 3%, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ascent__drift {
    animation: none;
  }
}

/* ------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: 58rem;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.measure {
  max-width: var(--measure);
}

/* Sections declare which half of the ascent they sit on, so text
   contrast is deliberate rather than inherited by accident. */
[data-scheme="dark"] {
  color: var(--cirrus);
  --rule: var(--hairline-dark);
  --muted: var(--haze);
  --strong: var(--summit);
}

[data-scheme="light"] {
  color: var(--ink-soft);
  --rule: var(--hairline-light);
  --muted: var(--ink-soft);
  --strong: var(--ink);
}

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

.display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 28, "WONK" 1;
  font-weight: 300;
  line-height: var(--lh-display);
  letter-spacing: -0.022em;
  color: var(--strong);
}

.display--hero {
  font-size: var(--step-5);
  line-height: var(--lh-tight);
  letter-spacing: -0.032em;
}

.display--xl {
  font-size: var(--step-4);
}

.display--lg {
  font-size: var(--step-3);
}

.display--md {
  font-size: var(--step-2);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
}

.body-text {
  color: var(--muted);
}

.body-text + .body-text {
  margin-top: var(--s-3);
}

/* Section label. Deliberately set in the body face, not mono —
   mono is reserved for readouts that carry data. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-4);
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Numerals and instrument readings only. */
.readout {
  font-family: var(--font-readout);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   The horizon rule — the one warm mark, used once per screen.
   ------------------------------------------------------------ */

.horizon {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(
    to right,
    var(--daybreak) 0%,
    rgba(227, 183, 127, 0.28) 32%,
    transparent 78%
  );
}

/* ------------------------------------------------------------
   Links & actions
   ------------------------------------------------------------ */

.link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  text-decoration: none;
  color: var(--strong);
  padding-block: 0.15em;
  transition: color var(--dur-fast) var(--ease-soft);
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.32;
  transform-origin: left;
  transition:
    opacity var(--dur-fast) var(--ease-soft),
    transform var(--dur) var(--ease-out);
}

.link:hover::after,
.link:focus-visible::after {
  opacity: 1;
  background: var(--daybreak);
}

.link__arrow {
  display: inline-block;
  transition: transform var(--dur) var(--ease-out);
}

.link:hover .link__arrow {
  transform: translateX(0.32em);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 1.7em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--strong);
  background: transparent;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft),
    transform var(--dur) var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--daybreak);
  background: rgba(227, 183, 127, 0.09);
  transform: translateY(-2px);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--daybreak);
  outline-offset: 4px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: 0.7em 1.2em;
  background: var(--summit);
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ------------------------------------------------------------
   Masthead
   ------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-block: var(--s-3);
  transition: background-color var(--dur) var(--ease-soft);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--strong);
}

/* The mark: a ring opened at top and bottom — creator and brand facing
   each other across the gap the agency exists to close. */
.wordmark__mark {
  width: 0.92em;
  height: 0.92em;
  flex: none;
  color: var(--daybreak);
  transform: translateY(0.06em);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.4rem);
}

.nav__link {
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.4em;
  border-bottom: 1px solid transparent;
  transition:
    color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft);
}

.nav__link:hover {
  color: var(--strong);
}

.nav__link[aria-current="page"] {
  color: var(--strong);
  border-bottom-color: var(--daybreak);
}

.nav__toggle {
  display: none;
}

/* ------------------------------------------------------------
   Altimeter — the signature element.

   A fixed rail reporting how high you have climbed and which
   section you are in. It reports real state; it is not decoration.
   ------------------------------------------------------------ */

.altimeter {
  position: fixed;
  top: 50%;
  right: clamp(1rem, 2.4vw, 2.4rem);
  z-index: 30;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  pointer-events: none;
}

.altimeter__readout {
  text-align: right;
  color: var(--muted);
  line-height: 1.4;
}

.altimeter__index {
  display: block;
  color: var(--daybreak);
}

.altimeter__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: opacity var(--dur) var(--ease-soft);
}

.altimeter__rail {
  position: relative;
  width: 1px;
  height: 34vh;
  min-height: 12rem;
  background: var(--rule);
}

/* Tick marks, one per section. */
.altimeter__tick {
  position: absolute;
  right: 0;
  width: 7px;
  height: 1px;
  background: var(--rule);
  transition:
    width var(--dur) var(--ease-out),
    background-color var(--dur) var(--ease-soft);
}

.altimeter__tick[data-active="true"] {
  width: 15px;
  background: var(--daybreak);
}

/* The marker rides the rail in proportion to scroll. */
.altimeter__marker {
  position: absolute;
  right: -3px;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--daybreak);
  /* Rides on page progress, not absolute altitude — on a page that
     begins high up the marker should still travel the full rail. */
  transform: translate3d(0, calc(var(--progress, 0) * (34vh - 7px)), 0);
  will-change: transform;
}

@media (max-width: 900px) {
  .altimeter {
    display: none;
  }
}

/* ------------------------------------------------------------
   Contact band + footer
   ------------------------------------------------------------ */

/* The climb resolves onto solid ground above the clouds. A real
   surface rather than more sky — it guarantees contrast for the
   contact details, and gives the ascent somewhere to arrive. */
.summit-plate {
  position: relative;
  margin-top: var(--s-8);
  background: var(--summit);
  color: var(--ink-soft);
}

/* Warm dawn light spilling over the leading edge. */
.summit-plate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 6rem;
  background: linear-gradient(
    to bottom,
    rgba(227, 183, 127, 0.55),
    rgba(245, 243, 238, 0) 92%
  );
  pointer-events: none;
}

.contact {
  padding-block: var(--section-y) var(--s-6);
}

.contact__tagline {
  max-width: 20ch;
  margin-bottom: var(--s-6);
}

.contact__grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
}

.contact__label {
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-2);
}

.contact__value {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 28, "WONK" 1;
  font-size: var(--step-1);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--strong);
  text-decoration: none;
  /* break-word, not anywhere: an address should only split when it
     genuinely cannot fit, never mid-word by default. */
  overflow-wrap: break-word;
  transition: color var(--dur-fast) var(--ease-soft);
}

.contact__value:hover {
  color: var(--daybreak-deep);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

.socials a {
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.25em;
  transition:
    color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft);
}

.socials a:hover {
  color: var(--strong);
  border-bottom-color: var(--daybreak);
}

.site-foot {
  padding-block: var(--s-4) var(--s-5);
  font-size: var(--step--1);
  color: var(--muted);
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: baseline;
  justify-content: space-between;
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

/* ------------------------------------------------------------
   Reveal on scroll
   ------------------------------------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Never hide content when motion is reduced or JS never runs. */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   Small screens
   ------------------------------------------------------------ */

@media (max-width: 640px) {
  .nav {
    gap: var(--s-3);
  }

  .nav__link {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
  }

  .site-head__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }
}
