/* ==========================================================================
   Reset, typography, layout primitives, reveal states
   ========================================================================== */

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

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

body {
  background: var(--bone);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

::selection { background: var(--signal); color: #fff; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ------------------------------------------------------------- Headings */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--text);
}
h1 { font-size: var(--fs-xl); letter-spacing: -0.045em; line-height: 0.9; }
h2 { font-size: var(--fs-lg); letter-spacing: -0.04em; }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

p { text-wrap: pretty; }

/* ------------------------------------------------------------- Utility */
.mono {
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 400;
}

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-2); max-width: 52ch; }
.grey { color: var(--grey); }
.signal { color: var(--signal); }
.upper { text-transform: uppercase; }

.stroke-text {
  color: transparent;
  -webkit-text-stroke: 1.4px currentColor;
  paint-order: stroke fill;
}

/* Headline with imagery showing through the letters.
   A light dark wash keeps the letters legible on the bone canvas without
   killing the photo's colour. Raise the alpha to darken, lower to show more
   colour — 0 removes it entirely. */
.media-text {
  background-image:
    linear-gradient(rgba(13, 13, 15, 0.22), rgba(13, 13, 15, 0.22)),
    var(--media, linear-gradient(120deg, var(--signal), #FF9A3D 55%, #FFD166));
  background-size: cover;
  background-position: center;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mediaDrift 18s var(--ease-io) infinite alternate;
}
@keyframes mediaDrift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

/* ---------------------------------------------------------- Containers */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 1180px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--bone2 { background: var(--bone-2); }
.section--white { background: var(--white); }

/* Full-bleed ink panels — the contrast half of the mixed theme */
.panel-ink {
  background: var(--ink);
  color: var(--on-ink-2);
  position: relative;
  overflow: hidden;
}
.panel-ink h1, .panel-ink h2, .panel-ink h3, .panel-ink h4 { color: var(--on-ink); }
.panel-ink .lead { color: var(--on-ink-2); }
.panel-ink .label { color: var(--on-ink-2); }
.panel-ink .label::before { background: var(--signal); }
.panel-ink .rule { background: var(--line-ink); }

/* Numbered section label: (01) — WHAT WE DO */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
}
.label::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--signal);
  flex: none;
}

.head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.panel-ink .head-row { border-color: var(--line-ink); }

.rule { height: 1px; background: var(--line); border: 0; }

/* ------------------------------------------------------------- Reveals */
.rv-line { display: block; overflow: hidden; }
.rv-line > span { display: block; will-change: transform; }

[data-fade] { opacity: 0; }
.no-motion [data-fade],
html:not(.js) [data-fade] { opacity: 1; }

/* --------------------------------------------------------- Grain layer */
.grain {
  position: fixed;
  inset: -120%;
  z-index: 6000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  animation: grainShift 0.8s steps(3) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-2%, 2%); }
  66%  { transform: translate(2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------ Scroll counter */
.scroll-count {
  position: fixed;
  left: var(--gutter);
  bottom: clamp(1rem, 2.5vw, 2rem);
  z-index: 600;
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity var(--t), color var(--t);
  pointer-events: none;
}
.scroll-count.is-on { opacity: 1; }
.scroll-count b { color: var(--signal); font-weight: 400; }
.scroll-count i { display: block; width: 46px; height: 1px; background: var(--line-2); position: relative; }
.scroll-count i::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: var(--signal);
}

/* ------------------------------------------------------ Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grain, .media-text { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-head, .site-foot, .grain, .cursor, .cursor-txt, .loader, .scroll-count, .menu { display: none !important; }
}
