/* ==========================================================================
   Base — reset, typography ladder, layout primitives, reveal choreography
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-2));
}

body {
  margin: 0;
  background: var(--c-void);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-heading);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--t-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); letter-spacing: var(--ls-wide); }

p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

a { color: inherit; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: var(--bw-2) solid var(--c-accent);
  outline-offset: 3px;
}

::selection { background: var(--c-accent); color: var(--c-accent-ink); }

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

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

.section {
  position: relative;
  padding-block: var(--section-pad-y);
  background: var(--c-surface);
  color: var(--c-text);
}

.section--void { background: var(--c-void); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-4);
}

/* ---- Utilities ---- */

.lead {
  font-size: var(--t-lg);
  color: var(--c-text-dim);
  max-width: var(--measure-lead);
}

.small { font-size: var(--t-sm); color: var(--c-text-dim); }

.skip-link {
  position: absolute;
  top: 0;
  left: var(--s-2);
  z-index: calc(var(--z-drawer) + 1);
  padding: var(--s-2) var(--s-3);
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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

/* ---- The recurring angle-cut tick: nav marker, eyebrow, quote mark ---- */

.tick {
  display: inline-block;
  width: 1.125rem;
  height: 0.375rem;
  background: var(--c-accent);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  flex: none;
}

/* ---- Section header pattern — identical on every section, every page ---- */

.sec-head { max-width: var(--measure); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: var(--fw-display);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  line-height: var(--lh-ui);
  color: var(--c-accent);
}

.sec-head .lead { margin-top: var(--s-3); }

/* ---- Section divider — a full-bleed hairline that marks a seam between
   two sections sharing the same ground color, so the gap between them reads
   as a deliberate pause rather than an empty accident. The terminal end is
   mitred on the brand angle, echoing the mark's cut edges at hairline scale. ---- */
.divider {
  position: relative;
  height: var(--bw-1);
  background: var(--c-line);
}
.divider::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 3rem;
  height: 100%;
  background: var(--c-text-dim);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* ---- Angle-cut edges — the one slope, reused ---- */

.cut-top    { clip-path: polygon(0 var(--cut, 4vw), 100% 0, 100% 100%, 0 100%); }
.cut-bottom { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut, 4vw)), 0 100%); }

/* ---- Grain: the shared static texture behind every fallback ---- */

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../img/grain.svg');
  background-size: 180px 180px;
  opacity: 0.045;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ---- Scroll reveal — translate along the angle's vector, then settle.
   Gated on html.js so that with JavaScript off the content is simply
   visible rather than stuck at opacity 0. ---- */

.js .reveal {
  opacity: 0;
  transform: translate(-16px, 12px);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Images assemble via an angle-oriented wipe rather than a plain fade. */
.js .reveal-wipe {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal-wipe.is-in { clip-path: inset(0 0 0 0); }

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

  /* Elements land in their final composed position with no motion vector. */
  .js .reveal { transform: none; transition-duration: var(--dur-fast); }
  .js .reveal-wipe { clip-path: none; transition: none; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
