/* ============================================================
   resamp — Base / style.css
   Reset · typography · layout · shared UI · loader · cursor
   ============================================================ */

/* ---------- Modern reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
:where(a):focus-visible,
:where(button):focus-visible,
:where(input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- Document ------------------------------------- */
:root { color-scheme: light; }
html { scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--fg);
  background-color: var(--bg);
  min-height: 100dvh;
  overflow-x: clip;
}
/* Belt-and-braces against any sideways drag on mobile. `clip` (not `hidden`)
   is used so it never turns html/body into a scroll container that would
   disable position:sticky on the pinned process section. */
html { overflow-x: clip; }
::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* Grain overlay — adds analog texture, kills the "flat AI" look */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Smooth-scroll transform container (populated by JS; degrades gracefully) */
.scroll-content { will-change: transform; }

/* ---------- Typography ----------------------------------- */
h1, h2, h3, h4, h5, h6, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-head);
  text-wrap: balance;
}
.display, h1 { font-weight: 500; letter-spacing: var(--tracking-display); }

.display-xl { font-size: var(--step-6); line-height: 0.92; letter-spacing: var(--tracking-display); }
.display-lg { font-size: var(--step-5); line-height: 0.95; letter-spacing: var(--tracking-display); }
.display-md { font-size: var(--step-4); }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }
h5 { font-size: var(--step-1); }

p { max-width: 72ch; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--fg); font-weight: 300; }
.muted { color: var(--fg-muted); }
strong, b { font-weight: 500; }

/* Inline accent treatments for headlines */
.tx-lime   { color: var(--lime); }
.tx-violet { color: var(--violet); }
.tx-outline {
  color: transparent;
  -webkit-text-stroke: 1.4px currentColor;
  paint-order: stroke fill;
}
.tx-italic { font-style: italic; font-family: var(--font-body); font-weight: 500; }

/* ---------- Layout --------------------------------------- */
.container { width: var(--container); margin-inline: auto; }
.container-tight { width: var(--container-tight); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.section--flush { padding-block: 0; }
.stack > * + * { margin-top: var(--flow, 1.5rem); }
.grid { display: grid; gap: var(--gutter); }
.hidden { display: none !important; }

/* Eyebrow / kicker label — reused everywhere */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}
.eyebrow--dot::before {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); opacity: 1;
}

/* Section intro block (asymmetric heading + copy) */
.section-head { display: grid; gap: 1.4rem; max-width: 68ch; }
.section-head .eyebrow { margin-bottom: .2rem; }

/* Index number tag (01 / 02 …) */
.index-tag {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
  color: var(--fg-faint);
  letter-spacing: 0;
}

/* ---------- Clover motif (brand mark from the logo) ------- */
.clover {
  display: inline-block;
  width: 1em; height: 1em;
  color: var(--lime);
  flex: none;
}
.clover svg { width: 100%; height: 100%; display: block; }
.clover--spin svg { animation: clover-spin 9s linear infinite; }

/* ---------- Media frames & masks ------------------------- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bone-200);
  isolation: isolate;
}
.on-dark .frame { background: var(--ink-700); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--tall  { aspect-ratio: 3 / 4; }
.frame--wide  { aspect-ratio: 16 / 10; }
.frame--square{ aspect-ratio: 1 / 1; }

/* Placeholder art — elegant gradient + label until real images land */
.ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 15% 15%, rgba(139, 255, 115,.20), transparent 55%),
    radial-gradient(120% 120% at 85% 85%, rgba(153, 129, 247,.22), transparent 55%),
    linear-gradient(135deg, #d8d6cd, #b9b7ad);
  color: rgba(11,11,12,.5);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.ph::after {
  content: attr(data-label);
  padding: .4rem .8rem;
}
.on-dark .ph {
  background:
    radial-gradient(120% 120% at 15% 15%, rgba(139, 255, 115,.24), transparent 55%),
    radial-gradient(120% 120% at 85% 85%, rgba(153, 129, 247,.34), transparent 55%),
    linear-gradient(135deg, #232329, #16161a);
  color: rgba(244,243,238,.5);
}

/* ---------- Marquee -------------------------------------- */
.marquee { overflow: hidden; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; width: max-content; will-change: transform; animation: marquee var(--marquee-dur, 32s) linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: 1.4rem; padding-inline: 1.4rem; white-space: nowrap; }
.marquee--reverse .marquee__track { animation-direction: reverse; }

/* Big kinetic wordmark strip */
.wordstrip {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-6);
  letter-spacing: var(--tracking-display);
  line-height: 1;
  text-transform: none;
}

/* ---------- Tags / pills --------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  letter-spacing: 0;
  color: var(--fg);
}
.pill--status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(139, 255, 115,.7);
  animation: pulse 2.4s var(--ease-out-quart) infinite;
}
.tag {
  display: inline-block;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  color: var(--fg-muted);
}

/* ---------- Scroll progress bar -------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: var(--z-progress);
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--lime), var(--violet));
  pointer-events: none;
}

/* ---------- Back-to-top ---------------------------------- */
.to-top {
  position: fixed; right: clamp(1rem, 3vw, 2.4rem); bottom: clamp(1rem, 3vw, 2.4rem);
  z-index: var(--z-sticky);
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bone);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out-expo), transform var(--dur-2) var(--ease-out-expo), background var(--dur-2);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--violet); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Skip link / a11y ----------------------------- */
.skip-link {
  position: absolute; left: 1rem; top: -100%;
  z-index: var(--z-loader);
  background: var(--ink); color: var(--bone);
  padding: .7rem 1.1rem; border-radius: var(--r-sm);
  transition: top var(--dur-1);
}
.skip-link:focus { top: 1rem; }
.u-visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Page loader ---------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  display: grid; place-items: center;
  background: var(--ink); color: var(--bone);
}
.loader__inner { display: grid; gap: 1.4rem; justify-items: center; text-align: center; }
.loader__mark { width: 74px; height: 74px; color: var(--lime); }
.loader__mark svg { width: 100%; height: 100%; animation: clover-spin 1.6s var(--ease-in-out) infinite; }
.loader__word {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-2); letter-spacing: var(--tracking-display);
}
.loader__bar { width: 180px; height: 2px; background: rgba(255,255,255,.16); overflow: hidden; border-radius: 2px; }
.loader__bar span { display: block; height: 100%; width: 0%; background: var(--lime); }
.loader__count { font-variant-numeric: tabular-nums; font-size: var(--step--1); color: rgba(244,243,238,.6); letter-spacing: .1em; }
/* Curtain reveal panels */
.loader.is-done { pointer-events: none; }
.loader__panels { position: fixed; inset: 0; z-index: calc(var(--z-loader) - 1); display: flex; pointer-events: none; }
.loader__panels span { flex: 1; background: var(--ink); transform: translateY(0); }

/* When JS is unavailable, never trap the page behind the loader */
.no-js .loader, .no-js .loader__panels { display: none; }

/* ---------- Utility ------------------------------------- */
.text-center { text-align: center; }
.max-60 { max-width: 60ch; }
.max-46 { max-width: 46ch; }
.mt-auto { margin-top: auto; }
.divider { height: 1px; background: var(--line); border: 0; width: 100%; }
.nowrap { white-space: nowrap; }
