/* =========================================================
   LinesheetPro: Reset, typography, textures, utilities
   ========================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* header offset for in-page anchors */
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* A display rule on a component must never beat the hidden attribute. */
[hidden] { display: none !important; }

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

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

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

:where(:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection { background: var(--pink); color: var(--cocoa-deep); }

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.015em; }

h4, h5 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1.32;
}

p { text-wrap: pretty; }

em, .italic { font-style: italic; }

/* the little tracked-out mono labels used throughout */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  line-height: 1;
  color: var(--cocoa-soft);
  font-weight: 400;
}
.label--ink { color: var(--cocoa); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.48;
  color: var(--cocoa-mid);
  letter-spacing: -0.011em;
  max-width: 46ch;
}

.prose p + p { margin-top: 1.15em; }
.prose { max-width: var(--maxw-text); color: var(--cocoa-mid); }

/* numbered section eyebrow: "01 / Process" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  opacity: .45;
}

/* ---------------------------------------------------------
   Layout helpers
   --------------------------------------------------------- */

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

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3.5rem, 7vw, 7rem); }

.band-warm  { background: var(--shell-warm); }
.band-deep  { background: var(--shell-deep); }
.band-cocoa {
  background: var(--cocoa-deep);
  color: #F0E6DA;
}
.band-cocoa .label      { color: rgba(240, 230, 218, .5); }
.band-cocoa .label--ink { color: #F0E6DA; }
.band-cocoa .lead,
.band-cocoa .prose      { color: rgba(240, 230, 218, .72); }

.hr {
  height: 1px;
  border: 0;
  background: var(--cocoa-line);
}
.band-cocoa .hr { background: rgba(240, 230, 218, .17); }

/* ---------------------------------------------------------
   Texture: a whisper of press grain so flat colour fields
   read as printed paper rather than screen fill.
   --------------------------------------------------------- */

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 900;
  background-image: var(--tex-grain);
  opacity: .026;
  mix-blend-mode: multiply;
}

/* ---------------------------------------------------------
   Motion primitives
   --------------------------------------------------------- */

/* generic scroll reveal, JS adds .is-in */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--reveal-y, 26px), 0);
  transition:
    opacity   var(--t-slow) var(--e-out) var(--reveal-delay, 0ms),
    transform var(--t-slow) var(--e-out) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* line-by-line masked text reveal */
.reveal-lines .line { display: block; overflow: hidden; }
.reveal-lines .line > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1.05s var(--e-out) var(--d, 0ms);
  will-change: transform;
}
.reveal-lines.is-in .line > span { transform: none; }

/* image mask wipe */
.wipe { overflow: hidden; }
.wipe > * {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.15s var(--e-out) var(--d, 0ms),
              transform 1.4s var(--e-out) var(--d, 0ms);
  transform: scale(1.08);
}
.wipe.is-in > * { clip-path: inset(0 0 0 0); transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .reveal-lines .line > span { transform: none; }
  .wipe > * { clip-path: none; transform: none; }
}

/* ---------------------------------------------------------
   Accessibility
   --------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  top: .75rem; left: .75rem;
  z-index: 1000;
  padding: .7rem 1.1rem;
  background: var(--cocoa);
  color: var(--shell);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--t-fast) var(--e-out);
}
.skip-link:focus-visible { transform: none; }
