/* =========================================================================
   RUH — base: tokens, reset, shared utilities, reveal states.
   Load order: base.css → components.css → pages/{page}.css
   Values come from the Figma file "RUH Agency Website (Copy)":
     mobile  = 440px frames  → --u = 1 design px of 440 (<1024px; capped at 640px wide, centred)
     desktop = 1728px frames → --u = 1 design px of 1728 (≥1024px — iPad landscape and small laptops get the desktop layout, scaled; was 1200 until 2026-10-23)
   Comments show the Figma value (y = distance from the frame top).
   Motion only animates transform/opacity (+ clip-path on the hero).
   ========================================================================= */

:root {
	--black: #000;
	--white: #fff;
	--teal: #00d9bf;      /* brand green: active client, menu panel, dots, site cursor */
	--cyan: #00ffe1;      /* mobile menu "Work", mobile About button */
	--grey-text: #565656; /* insights description */
	--tag-text: #626262;
	--tag-line: #808080;
	--dot: #d9d9d9;
	--copy-grey: #9c9c9c;

	--font: var(--wp--preset--font-family--inter-tight, "Inter Tight", system-ui, sans-serif);
	--mono: var(--wp--preset--font-family--azeret-mono, "Azeret Mono", ui-monospace, monospace);
	--plex: var(--wp--preset--font-family--ibm-plex-mono, "IBM Plex Mono", ui-monospace, monospace);
	/* Figma: Neue Haas Grotesk Display Pro 55 Roman (Figma labels it 500). Stand-in: Geist (OFL, variable)
	   at 450 — same stroke weight as Neue Haas 55 (ink within 0.3%), width within ~1.5%. */
	--nhg: var(--wp--preset--font-family--geist, Geist), var(--font);
	--nhg-weight: 450;

	/* Phones scale the 440 design to the screen; portrait tablets (up to 1023px) keep the phone layout but stop
	   growing at 640px (×1.45) — the content column centres, full-width backgrounds still bleed. */
	/* --vw (functions.php head script): 100vw without a classic scrollbar, so units and containers agree. */
	--u: calc(min(var(--vw, 100vw), 640px) / 440);
	/* Readability floor (RISK-REVIEW.md): text never renders under 12px. Figma's smallest size is 12 and the
	   frames have --u = 1 (1728 / 440), so the frames are unchanged; only the in-between widths (1024–1727,
	   320–439) gain. Site Content → Display & motion can switch it off (0px). */
	--fs-min: 0.75rem; /* 12px at the default text size; follows the browser's font-size setting */
	/* --fu: the text unit = --u × the browser's font-size setting (--fs-scale, head script: root font ÷ 16).
	   Default setting → exactly --u, so the design is unchanged; "Large" text → reading text (Figma ≤ 24px:
	   body, labels, links, tags, small headings) grows with it (WCAG 1.4.4; 2026-10-24). Display titles (≥ 32)
	   are already large and stay on --u, as do widths, gaps and images — they'd leave their rows/columns. */
	--fs-scale: 1;
	--fu: calc(var(--u) * var(--fs-scale));
	--gutter: max(calc(20 * var(--u)), calc((var(--vw, 100vw) - 400 * var(--u)) / 2));
	--header-h: calc(118 * var(--u));
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 1024px) {
	:root {
		--u: calc(min(var(--vw, 100vw), 1920px) / 1728);
		--gutter: calc(64 * var(--u));
		--header-h: calc(108 * var(--u));
	}
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font);
	font-weight: 400;
	color: var(--black);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Effects that draw past the page edge (water.js canvas margin) never add sideways scroll. On the
   page wrapper, not body: body's overflow passes up to the viewport, where clip turns into hidden
   (still scrollable). clip, unlike hidden, makes no scroll container, so position: sticky still works. */
.wp-site-blocks { overflow-x: clip; }

[hidden] { display: none !important; } /* a display rule on a component must never unhide it */
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; font-weight: inherit; }
ul { padding: 0; list-style: none; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

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

.wp-site-blocks > * { margin-block: 0 !important; }

.arrow-inline { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.arrow-inline svg { display: block; width: 100%; height: auto; }

/* Pill / tag — Feedback V2 25 Oct 2026 (Dev Feedback 2063:2): Azeret Mono 300 uppercase, 1px #808080, radius 6, pad 8/2.
   Phones 12/18, desktop 14/20. Every pill is outlined; brand green (black text) is the HOVER state only -
   client 2026-11-17: "the colour version is a hover-state, not the first one in the list of pills". */
.tag {
	display: inline-flex;
	align-items: center;
	padding: calc(2 * var(--u)) calc(8 * var(--u));
	border: 1px solid var(--tag-line);
	border-radius: 6px;
	font-family: var(--mono);
	font-size: max(calc(12 * var(--fu)), var(--fs-min));
	font-weight: 300;
	line-height: calc(18 / 12);
	text-transform: uppercase;
	letter-spacing: 0.006em; /* our Azeret Mono file sets ~.07px/char narrower than Figma (ls 0) — keeps the pill widths on the design's */
	color: var(--tag-text);
}
.tag { transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), color 0.3s var(--ease-out); }
@media (hover: hover) { .tag:hover { border-color: var(--teal); background: var(--teal); color: var(--black); } } /* border kept (teal): no 2px jump */
@media (min-width: 1024px) {
	.tag { font-size: max(calc(14 * var(--fu)), var(--fs-min)); line-height: calc(20 / 14); }
}

.brandmark svg { display: block; width: 100%; height: auto; }
.nowrap { white-space: nowrap; }

/* ---------- Reveal states (only when JS is running) ---------- */

.js [data-reveal="rise"],
.js [data-reveal="fade"] { opacity: 0; }
.js [data-reveal="lines"],
.js [data-reveal="type"] { visibility: hidden; }
/* Opened by the page transition: the hero is already there inside the growing window (as the reference) */
.js.pt-in [data-reveal-once] [data-reveal], .js.pt-in [data-reveal-once][data-reveal] { opacity: 1; visibility: visible; }
.js.pt-in [data-reveal-once] [data-reveal="type"] { visibility: hidden; } /* the type-on still plays (after the transition) */
/* Type-on caret (reveal.js): absolute inside the last typed character, so it never moves the text */
.type-caret { position: absolute; top: 0.08em; left: 100%; width: 0.06em; height: 0.84em; margin-left: 0.04em; background: currentColor; animation: type-caret 1s steps(1) infinite; }
.type-caret.is-start { left: 0; margin-left: 0; }
.type-caret.is-typing { animation: none; }
@keyframes type-caret { 50% { opacity: 0; } }
/* Line masks get room for descenders (tight line-heights like the 175px project title clipped the "g"); net layout change 0. */
[data-reveal="lines"] { display: flow-root; min-width: min-content; } /* flow-root: keeps the masks' negative margin inside the heading (no collapse). min-width: a word longer than the design max-width (client text) widens the box instead of being cut by the line masks */
[data-reveal="lines"] .line-mask { padding-bottom: 0.2em; margin-bottom: -0.2em; }

@media (prefers-reduced-motion: reduce) {
	.js [data-reveal] { opacity: 1 !important; visibility: visible !important; }
	.roll > span, .roll > span::after { transition: none; }
	.js .site-header .wordmark svg path,
	.js .site-header .menu-toggle__icon svg path,
	.js .site-header .menu-toggle__icon svg rect { transform: none; }
	.js [data-header-item] { opacity: 1; }
	*, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Video thumbnails / heroes (ruh_media): fill their frame like images do */
.ruh-video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Site Content image + phone version with a video involved (ruh_picture): CSS shows one */
.ruh-only-desktop { display: none !important; }
@media (min-width: 1024px) {
	.ruh-only-desktop { display: block !important; }
	.ruh-only-phone { display: none !important; }
}

/* Site Content → Display & motion: effects switched off (html.m-off-*) — the still version, nothing hidden */
.js.m-off-reveal [data-reveal], .js.m-off-reveal .ruh-reveal-lines, .js.m-off-reveal .ruh-reveal-rise { opacity: 1 !important; visibility: visible !important; }
.m-off-roll .roll > span { transform: none !important; transition: none !important; }
.m-off-roll .roll > span::after { display: none; }

/* Site Content "Hide on the site": a hidden text prints an empty element — drop it so it leaves no gap. */
[data-reveal]:empty,
.site-footer__copy:empty { display: none; }
