/* ==========================================================================
   BASE — reset, typography, shared primitives
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--c-mid);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Lenis drives scrolling; it needs the native scrollbar out of the way. */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

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

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

h1, h2, h3, h4, p, figure { margin: 0; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

::selection {
  background: var(--c-bone);
  color: var(--c-deep);
}

/* --- Type primitives ------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: var(--leading-display);
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.4;
}

.measure { max-width: 42ch; }

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

.section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding: var(--section-y) 0;
}

.container {
  padding-inline: var(--pad-x);
  width: 100%;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* --- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.7em 1.6em;
  border-radius: var(--radius-pill);
  background: var(--c-deep);
  color: var(--c-bone);
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

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

/* On a deep section the default pill is the same colour as the ground and
   vanishes into it, so it inverts. */
.is-deep .btn,
.scene--deep .btn {
  background: var(--c-bone);
  color: var(--c-ink);
}

.btn--ghost {
  background: transparent;
  color: currentColor;
  border: 1px solid var(--rule);
}

.btn--ghost:hover {
  background: var(--c-deep);
  color: var(--c-bone);
}

/* --- Link with underline wipe ---------------------------------------- */

.link-u {
  position: relative;
  font-size: var(--fs-label);
  letter-spacing: var(--track-label);
  text-transform: lowercase;
}

.link-u::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-fast) var(--ease-out);
}

.link-u:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --- Preloader -------------------------------------------------------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  display: grid;
  place-content: center;
  gap: 5rem;
  justify-items: center;
  background: var(--c-mid);
}

/* The logo artwork carries its own white background, so it sits on a white
   tile rather than directly on the brand colour. */
.preloader__mark {
  width: clamp(110px, 13vw, 170px);
  height: auto;
  border-radius: 50%;
  background: var(--c-white);
  padding: 0.6rem;
}

.preloader__bar {
  width: clamp(140px, 16vw, 220px);
  height: 1px;
  background: var(--rule);
  position: relative;
}

.preloader__fill {
  position: absolute;
  inset: 0;
  background: var(--c-ink);
  transform: scaleX(0);
  transform-origin: left;
}

.preloader__count {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  opacity: 0.8;
}

/* --- Custom droplet cursor -------------------------------------------- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-cursor);
  width: 14px;
  height: 18px;
  margin: -9px 0 0 -7px;
  pointer-events: none;
  color: var(--c-deep);
  mix-blend-mode: difference;
  transition: opacity var(--dur-fast) var(--ease-out);
  will-change: transform;
}

.cursor.is-hidden { opacity: 0; }

/* Fine pointers only — leave touch devices alone. */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, .is-interactive { cursor: none; }
}

@media not all and (hover: hover) {
  .cursor { display: none; }
}

/* --- Scroll cue -------------------------------------------------------- */

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2.2rem;
  translate: -50% 0;
  width: 1px;
  height: 46px;
  background: var(--rule);
  overflow: hidden;
}

.scroll-cue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-ink);
  animation: cue 2.2s var(--ease-in-out) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

/* --- Reveal-on-scroll base state -------------------------------------- */

.reveal { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor { display: none; }
  body { cursor: auto; }
}
