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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

html,
body {
  background: var(--ink-100);
  color: var(--bone-200);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* clip, not hidden.

     `overflow-x: hidden` with a visible y axis makes the used value of
     overflow-y `auto`, which turns <body> into a scroll container. The
     page still scrolls on the viewport, so every `position: sticky`
     inside it silently stops working — that is what was dropping the
     editor preview off screen the moment you scrolled.

     `clip` suppresses horizontal overflow the same way without
     creating a scroll container, so sticky keeps working. */
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

/* Inline icons (partials/icons.php). Sized to the text they sit in, so
   an icon can never render at its intrinsic 300px outside a container
   that happens to size it. */
.ico {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.125em;
}

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

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

::selection {
  background: var(--gold-300);
  color: var(--ink-100);
}

/* ---------- Focus: visible, and in-brand ---------- */
:focus-visible {
  outline: 1px solid var(--gold-300);
  outline-offset: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: var(--ink-000);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-400);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-500);
}

/* =========================================================
   TYPOGRAPHY PRIMITIVES
   ========================================================= */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  color: var(--gold-200);
}

.h-sec {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 0.94;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.lede {
  font-family: var(--font-serif);
  font-size: var(--step-1);
  line-height: 1.55;
  font-weight: 300;
  color: var(--bone-300);
  text-wrap: pretty;
}

.body {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.72;
  color: var(--bone-300);
  text-wrap: pretty;
}

/* The small technical label — geological survey annotation */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-300);
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
}

.eyebrow::before {
  content: "";
  width: 1.9em;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.eyebrow--bare::before {
  display: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-400);
}

.gold {
  color: var(--gold-200);
}

/* =========================================================
   LAYOUT PRIMITIVES
   ========================================================= */

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

.section {
  position: relative;
  padding-block: var(--section-y);
  background: var(--bg);
  color: var(--fg);
  /* `clip`, not `hidden`: hidden would make every section a scroll
     container and quietly break sticky positioning inside it. */
  overflow-x: clip;
}

.rule {
  height: 1px;
  width: 100%;
  background: var(--rule);
  transform-origin: left center;
}

/* =========================================================
   MOTION PRIMITIVES
   Text reveal masks. The child moves; the parent clips.
   ========================================================= */

.mask {
  display: block;
  overflow: hidden;
}

.mask > * {
  display: block;
  will-change: transform;
}

/* Elements JS will animate start hidden, but only once JS is alive,
   so no-JS visitors still see content. */
html.js-ready [data-anim="rise"],
html.js-ready [data-anim="fade"] {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html.js-ready [data-anim] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   THE CHISELLED BUTTON
   A hard-edged slab with a gold fill that rises from the base,
   the way a plaque is set into stone.
   ========================================================= */

.btn {
  --btn-fg: var(--ink-100);
  --btn-bg: var(--gold-300);
  --btn-sheen: linear-gradient(
    167deg,
    #f0dda8 0%,
    #d9b856 22%,
    #c9a227 52%,
    #a8831c 82%,
    #c2a04a 100%
  );
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  padding: 1.05em 1.9em;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--btn-fg);
  /* Gold leaf reads as a struck metal surface: a bright top edge falling
     to a shadowed base. A flat fill of the same hue reads as highlighter. */
  background: var(--btn-bg);
  background-image: var(--btn-sheen, none);
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}

.btn__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bone-100);
  transform: translate3d(0, 101%, 0);
  transition: transform 0.62s var(--ease-chisel);
}

.btn:hover .btn__fill,
.btn:focus-visible .btn__fill {
  transform: translate3d(0, 0, 0);
}

.btn__arrow {
  display: inline-block;
  transition: transform 0.5s var(--ease-chisel);
}

.btn:hover .btn__arrow {
  transform: translateX(0.35em);
}

/* Ghost variant — an outline cut into the dark */
.btn--ghost {
  --btn-fg: var(--bone-200);
  --btn-bg: transparent;
  --btn-sheen: none;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--ink-100);
}

.btn--ghost .btn__fill {
  background: var(--gold-200);
}

/* Circular play trigger */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-300);
}

.btn-play__disc {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  overflow: hidden;
  flex: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.btn-play__disc::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold-300);
  transform: scale(0);
  border-radius: 50%;
  transition: transform 0.55s var(--ease-chisel);
}

.btn-play:hover .btn-play__disc {
  color: var(--ink-100);
}

.btn-play:hover .btn-play__disc::after {
  transform: scale(1);
}

.btn-play__disc svg {
  position: relative;
  z-index: 1;
}

/* =========================================================
   SURFACES
   ========================================================= */

/* A hairline grid that reads as survey paper */
.strata-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  opacity: 0.5;
}

.strata-lines span {
  border-left: 1px solid var(--rule);
}

.strata-lines span:last-child {
  border-right: 1px solid var(--rule);
}

@media (max-width: 860px) {
  .strata-lines {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Image treatment: archival photographs, warmed and settled */
.plate {
  position: relative;
  overflow: hidden;
  background: var(--ink-300);
}

.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.06) brightness(0.94);
  transition: transform 1.2s var(--ease-out), filter 1.2s var(--ease-out);
  will-change: transform;
}

.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 10, 9, 0.05) 0%,
    rgba(11, 10, 9, 0.42) 100%
  );
  pointer-events: none;
}

.plate:hover img {
  filter: saturate(1) contrast(1.02) brightness(1);
}

.u-hide {
  display: none !important;
}

@media (max-width: 860px) {
  .u-desktop {
    display: none !important;
  }
}

@media (min-width: 861px) {
  .u-mobile {
    display: none !important;
  }
}

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