/* GoodFellaz — reset, typography, document rhythm. SCAFFOLD.
   References tokens.css only. No literal colour or size values below this line. */

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 800; }

h1 {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--t-section);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-section);
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-display);
  font-size: var(--t-36);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-section);
  text-transform: uppercase;
}

p { margin: 0; }
p + p { margin-top: var(--s-16); }

a { color: inherit; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.skip {
  position: absolute;
  z-index: 300;
  top: var(--s-16);
  left: var(--gutter);
  padding: var(--s-8) var(--s-16);
  background: var(--ground);
  color: var(--bone);
  font-family: var(--font-data);
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  transform: translateY(calc(-100% - var(--s-16)));
  transition: transform var(--dur-micro) var(--ease-out);
}
.skip:focus { transform: translateY(0); }

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

/* ------------------------------------------------------------------ *
 *  Document rhythm                                                    *
 * ------------------------------------------------------------------ */

/* Every numbered section holds a full viewport and breathes at --s-128.
   Sections that pin or run horizontally override height in sections.css.
   Descendant, not child: GSAP wraps pinned sections (.hero, .ritual) in a
   .pin-spacer, and `main > section` silently stopped matching them — Das
   Ritual lost its numeral and every later numeral ran two short. */
main section {
  min-height: 100vh;
  padding: var(--section-pad) var(--gutter);
}

.wrap {
  width: 100%;                 /* explicit, so .wrap also behaves as a flex/grid item */
  max-width: var(--wrap);
  margin-inline: auto;
}

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

/* ------------------------------------------------------------------ *
 *  Type roles                                                         *
 * ------------------------------------------------------------------ */

/* label — the Ritchie device: factual text rendered as machine output.
   Eyebrows, stat lines, prices, opening hours, SEIT 2017. */
.label {
  font-family: var(--font-data);
  font-size: var(--t-label);
  line-height: var(--lh-ui);
  font-weight: 600;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--muted);
}

/* quote — the shop speaking in its own voice. Manifesto only. */
.quote {
  font-family: var(--font-quote);
  font-size: var(--t-quote);
  line-height: var(--lh-quote);
  letter-spacing: var(--tr-quote);
  color: var(--bone);
  max-width: var(--measure-quote);
  font-weight: 500;
}

/* Section numerals. The page is built on chapter cards, so the sections
   between them should be numbered like reel cans. Space Mono in tungsten —
   the Ritchie device again: factual data rendered as machine output. */
main { counter-reset: sec; }
main section { counter-increment: sec; }
main section h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: var(--s-16);
  font-family: var(--font-data);
  font-size: var(--t-label);
  line-height: var(--lh-ui);
  letter-spacing: var(--tr-label);
  color: var(--tungsten);          /* 10.87:1 on ground */
}

/* ------------------------------------------------------------------ *
 *  Media — every frame is letterboxed to 2.39:1, bars included        *
 * ------------------------------------------------------------------ */

.letterbox {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--letterbox);
  background: var(--ground);   /* the bars: ground, held while media loads */
}
.letterbox > img,
.letterbox > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------------ *
 *  Calls to action                                                    *
 * ------------------------------------------------------------------ */

.cta {
  display: inline-block;
  font-family: var(--font-data);
  font-size: var(--t-24);          /* size floor: bone-on-red is 4.22:1 — legal only as large text (>=24px). DESIGN.md § Colour */
  line-height: var(--lh-ui);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--s-16) var(--s-32);
  border: var(--rule) solid transparent;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out);
}
.cta--primary {
  background: var(--red);
  color: var(--bone);              /* 4.22:1 — legal because .cta is locked to >=24px */
}
.cta--primary:hover { background: var(--tungsten); color: var(--ground); }

.cta--secondary {
  background: transparent;
  color: var(--bone);
  border-color: var(--bone);       /* 16.27:1 */
}
.cta--secondary:hover { background: var(--bone); color: var(--ground); }

/* Text link inside body copy — tungsten, never crimson (3.85:1 fails). */
.link { color: var(--tungsten); text-decoration: none; }
.link:hover, .link:focus-visible { text-decoration: underline; text-underline-offset: var(--s-8); }

/* ------------------------------------------------------------------ *
 *  Grain — REQUIRED. Hides the 1.4x upscale softness across the page. *
 *  Verbatim from IMPLEMENTATION-SPEC Phase 2; the literals are the    *
 *  spec's, not drift.                                                 *
 * ------------------------------------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: overlay;
  /* Its own compositor layer: a full-screen blended overlay that is not
     promoted gets repainted with anything that animates beneath it. */
  transform: translateZ(0);
  will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ *
 *  Reduced motion — the static path is the real page                  *
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }   /* overlay is a texture, not information */
}
