/* =========================================================
   EQNX — site styles
   DM Sans. Thin (100) for dark grey. Extra light (200) for gold.
   ========================================================= */

:root {
  /* Palette (from EQNX_Colour_Palette) */
  --eqnx-dark:    #2F2F2F;
  --eqnx-light:   #EFEFEF;
  --eqnx-silver:  #B5B5B5;
  --eqnx-gold:    #B5A475;
  --eqnx-gold-soft: #C9BC93;

  /* Type */
  --font-sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Weights */
  --w-body: 200;   /* DM Sans extra light — for dark grey */
  --w-gold: 300;   /* DM Sans light       — for gold */

  /* Scale */
  --fs-body:    1.0625rem;   /* 17px */
  --fs-prose:   1.125rem;    /* 18px */
  --fs-caption: 0.9375rem;   /* 15px */
  --fs-small:   0.875rem;    /* 14px */
  --fs-tiny:    0.75rem;     /* 12px — labels */

  --line-prose: 1.7;
  --line-tight: 1.3;

  --measure: 42rem;
  --measure-wide: 50rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--eqnx-light);
  color: var(--eqnx-dark);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--w-body);
  line-height: var(--line-prose);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

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

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 240ms ease, border-color 240ms ease;
}
a:hover { color: var(--eqnx-gold); border-color: var(--eqnx-gold); }

/* =========================================================
   Gold rule — extra light, gold tone.
   Apply with class="is-gold" on any element.
   ========================================================= */
.is-gold {
  color: var(--eqnx-gold);
  font-weight: var(--w-gold);
}

/* =========================================================
   Page sections
   ========================================================= */

.page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

/* =========================================================
   01 & 02 — clock pages
   ========================================================= */

.page--clock .stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5rem;
}

.clock {
  width: clamp(280px, 38vw, 460px);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.caption {
  font-size: var(--fs-prose);
  color: var(--eqnx-dark);
  letter-spacing: 0.02em;
  margin: 0;
  font-weight: var(--w-body);
}

/* =========================================================
   03 & 04 — text pages
   ========================================================= */

.page--text { text-align: center; }

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: var(--fs-prose);
  line-height: var(--line-prose);
  font-weight: var(--w-body);
  color: var(--eqnx-dark);
}

.prose p {
  margin: 0 0 1.4em 0;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* On page 4, give the gold lede a touch more breathing room */
.prose__lede {
  margin-bottom: 2.4em !important;
}

/* =========================================================
   05 — in situ — inset, sits within 100vh
   ========================================================= */

.page--insitu {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5rem 2rem 4rem;
  background: var(--eqnx-light);
  gap: 3rem;
  min-height: 100vh;
}

.insitu__image {
  width: min(1080px, 88%);
  aspect-ratio: 16 / 9;
  margin: 0;
  background-color: #1a1612;
  overflow: hidden;
  position: relative;
}

.lobby-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.insitu__controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

/* slider */
.slider { width: min(720px, 90%); }

.slider__track {
  position: relative;
  height: 1px;
  background: var(--eqnx-silver);
  margin: 0 0 1.25rem;
}

.slider__handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--eqnx-gold);
  transform: translate(-50%, -50%);
}

.slider__labels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  font-size: var(--fs-tiny);
  letter-spacing: 0.06em;
  color: var(--eqnx-dark);
  font-weight: var(--w-body);
}

.slider__labels li {
  text-align: center;
  opacity: 0.75;
}
.slider__labels li:first-child { text-align: left; }
.slider__labels li:last-child  { text-align: right; }

.slider__labels li.is-active {
  color: var(--eqnx-gold);
  opacity: 1;
  font-weight: var(--w-gold);
}

/* speed buttons */
.speed {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font-family: var(--font-sans);
  font-size: var(--fs-tiny);
  letter-spacing: 0.1em;
  padding: 0.85rem 1.85rem;
  border: 1px solid var(--eqnx-silver);
  background: transparent;
  color: var(--eqnx-dark);
  cursor: pointer;
  font-weight: var(--w-gold);
  min-width: 110px;
  transition: all 240ms ease;
}

.btn--play {
  background: var(--eqnx-gold);
  border-color: var(--eqnx-gold);
  color: #FFFFFF;
}

/* =========================================================
   06 — the terms
   ========================================================= */

.page--terms {
  flex-direction: column;
  justify-content: center;
  gap: 4.5rem;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.prose--centered {
  text-align: center;
  max-width: var(--measure-wide);
}

.phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  max-width: 980px;
  width: 100%;
  text-align: center;
}

.phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.phase__img {
  width: clamp(140px, 18vw, 220px);
  height: auto;
}
/* Phase clock canvases — match phase__img sizing */
.phase__canvas {
  width: clamp(161px, 20.7vw, 253px);
  height: clamp(161px, 20.7vw, 253px);
  display: block;
}


.phase__title,
.phase__sub {
  font-size: var(--fs-tiny);
  letter-spacing: 0.12em;
  margin: 0;
  font-weight: var(--w-body);
}

.phase__title { margin-top: 0.5rem; }

/* Labels hidden until clocks settle, then fade in */
.phase__title,
.phase__sub {
  opacity: 0;
  transition: opacity 1.4s ease;
}
.phase__title.is-revealed,
.phase__sub.is-revealed {
  opacity: 1;
}

.phase__note {
  font-size: var(--fs-tiny);
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: var(--w-body);
  color: var(--eqnx-dark);
  opacity: 0.7;
}

/* =========================================================
   07 — the makers — left-ranged text in a centred block
   ========================================================= */

.page--makers { align-items: center; }

.bios {
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.bio {
  text-align: left;
}

.bio__title {
  font-size: var(--fs-prose);
  font-weight: var(--w-gold);
  color: var(--eqnx-gold);
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
}

.bio__body {
  font-size: var(--fs-prose);
  line-height: var(--line-prose);
  font-weight: var(--w-body);
  margin: 0;
}

/* =========================================================
   08 — enquiries
   ========================================================= */

.page--enquiries {
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
}

.enquiries-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.enquiries__logo {
  height: 52px;
  width: auto;
  max-width: clamp(234px, 29vw, 364px);
  opacity: 0.95;
}

.enquiries {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.enquiries__lead {
  font-size: var(--fs-prose);
  margin: 0;
  font-weight: var(--w-body);
  color: var(--eqnx-dark);
}

.enquiries__email {
  font-size: var(--fs-prose);
  margin: 0;
  font-weight: var(--w-gold);
  color: var(--eqnx-gold);
}

.enquiries__email a {
  color: var(--eqnx-gold);
  border-bottom-color: transparent;
}
.enquiries__email a:hover { border-bottom-color: var(--eqnx-gold); }

.closing-line {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-prose);
  font-weight: var(--w-body);
  color: var(--eqnx-dark);
  margin: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 720px) {
  .page { padding: 3rem 1.5rem; }

  .clock { width: clamp(220px, 70vw, 320px); }

  .insitu__image       { width: 96%; aspect-ratio: 16 / 9; }
  .insitu__controls { gap: 1.25rem; }

  .slider__labels {
    grid-template-columns: repeat(5, 1fr);
    font-size: 0.65rem;
  }
  .slider__labels li:nth-child(2),
  .slider__labels li:nth-child(4),
  .slider__labels li:nth-child(6),
  .slider__labels li:nth-child(8) { display: none; }

  .speed { gap: 0.5rem; }
  .btn { padding: 0.7rem 1.2rem; min-width: 80px; }

  .phases { grid-template-columns: 1fr; gap: 3rem; }
  .phase__img { width: clamp(180px, 45vw, 260px); }

  .bios { gap: 2.5rem; }
}

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

/* =========================================================
   Animations — scroll-triggered reveals
   ========================================================= */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1400ms ease, transform 1400ms ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1200ms ease, transform 1200ms ease;
}

.stagger-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* If the visitor prefers reduced motion, skip the entrance entirely. */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .stagger-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   Canvas clocks
   ========================================================= */

/* Landing — replaces .page--clock + .clock with a canvas */
.page--landing {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  scroll-snap-align: start;
}

.page--landing .stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5rem;
}

.clock-canvas {
  width: clamp(280px, 38vw, 460px);
  height: clamp(280px, 38vw, 460px);
  display: block;
  user-select: none;
}

.caption--landing {
  opacity: 0;
  transition: opacity 1400ms ease;
}

.caption--landing.is-visible {
  opacity: 1;
}

/* Page 5 — canvas fills the lobby container; no overlay positioning needed */

/* Slider input — invisible but functional */
.slider {
  position: relative;
}

.slider__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  top: -10px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.slider__labels li {
  cursor: pointer;
  transition: color 200ms ease, opacity 200ms ease;
}

.slider__labels li:hover {
  color: var(--eqnx-gold);
  opacity: 1;
}

/* Active speed button */
.btn[data-speed].is-active {
  background: var(--eqnx-gold);
  border-color: var(--eqnx-gold);
  color: #FFFFFF;
}

/* Active play button */
.btn--play {
  cursor: pointer;
}

.btn[data-speed] {
  cursor: pointer;
}

/* =========================================================
   Scroll chevron
   ========================================================= */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.32;
}
.scroll-arrow svg {
  width: 52px;
  height: 26px;
  display: block;
}

/* ── Phase scrub bar ─────────────────────────────────────── */
.phase__scrub {
  width: clamp(161px, 20.7vw, 253px);
  display: flex;
  align-items: center;
  margin: 0.85rem 0 0.3rem;
  box-sizing: border-box;
  padding: 6px 0;         /* touch target */
}

/* Range input: transparent background so only track & thumb show */
.phase__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;           /* tall enough to centre thumb without jank */
  background: transparent;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
}

/* Track — single hairline */
.phase__slider::-webkit-slider-runnable-track {
  height: 1px;
  background: rgba(47,47,47,0.22);
  border-radius: 0;
}
.phase__slider::-moz-range-track {
  height: 1px;
  background: rgba(47,47,47,0.22);
  border-radius: 0;
}

/* Thumb — gold dot, perfectly centred on track */
.phase__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #B5A475;
  cursor: pointer;
  border: none;
  box-shadow: none;
  margin-top: -5px;       /* (11px - 1px) / 2 = 5px up to centre on 1px track */
}
.phase__slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #B5A475;
  cursor: pointer;
  border: none;
  box-shadow: none;
}

/* ── Time ticker (p6) ───────────────────────────────────── */
/* is-ticking: shows during animation before is-revealed fires */
.phase__sub.is-ticking {
  opacity: 1 !important;
  transition: none;
}

.phase__ticker {
  min-height: 1.2em;
}
