/* ==========================================================================
   BASE · reset, surface, type, grain
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns scrolling; native smooth would fight it. */
}

body {
  background: var(--ink);
  color: var(--c-type);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--c-signal);
  color: var(--char);
}

/* --- Focus: visible, coral, never removed --------------------------------- */
:focus-visible {
  outline: 2px solid var(--c-signal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--c-signal);
  color: var(--char);
  font-size: var(--fs-mono);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
}

.skip-link:focus {
  top: 1rem;
}

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

/* ==========================================================================
   TYPE PRIMITIVES
   ========================================================================== */

.display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-weight: 300;
  font-style: italic;
  letter-spacing: var(--tr-display);
  line-height: 0.86;
}

.headline {
  font-family: var(--font-headline);
  font-weight: 400;
  letter-spacing: var(--tr-headline);
  line-height: 0.88;
  text-transform: uppercase;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--c-type-dim);
}

.label--strong {
  color: var(--c-signal);
}

.label--strong::after {
  content: "—";
  margin-left: 0.3em;
  opacity: 0.7;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--c-type-soft);
}

.body-caps {
  font-size: var(--fs-mono);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-type-dim);
  line-height: 1.7;
}

/* ==========================================================================
   GRAIN · one fixed SVG noise overlay. Paint-once, no JS, no animation cost.
   ========================================================================== */

.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   LAYOUT SHELL
   ========================================================================== */

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

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

/* Structural sections sit on ink; editorial ones override. */
.section--ink {
  background: var(--ink);
}

.section--char {
  background: var(--char);
}

/* ==========================================================================
   REVEALS · the base state. JS adds .is-in; CSS carries the motion.
   Elements stay visible if JS never runs — progressive enhancement.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity var(--dur-slow) var(--ease-signature),
    transform var(--dur-slow) var(--ease-signature);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

/* ==========================================================================
   ACCESSIBILITY · reduced motion kills the marquee, kills reveals,
   neutralises transitions. Content arrives instantly.
   ========================================================================== */

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
