/* =========================================================================
   Homepage — Figma "Home page" (1048:24, 1728) and "HOME" (1253:2320, 440).
   ========================================================================= */

/* =========================================================================
   Intro — mobile: title y239 400w 36/40 300 +2%, mark 392×80 y502, hero y602 440×506
           desktop: title y329 775w 56/64 300, mark 1598×328 x65 y771, hero y1139 1728×925
   ========================================================================= */

.intro { padding-top: calc(239 * var(--u)); }

.intro__title {
	max-width: calc(400 * var(--u));
	font-size: max(calc(36 * var(--u)), var(--fs-min));
	font-weight: 300;
	line-height: calc(40 / 36);
	letter-spacing: 0;
}

.brandmark--hero { width: calc(392 * var(--u)); margin-top: calc(143 * var(--u)); }
/* Ink halo (modules/halo.js): the canvas over the black mark, cut to the same SVG so the ink stays in the letters. */
.brandmark--hero[data-halo] { position: relative; }
.brandmark__halo {
	position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
	-webkit-mask: url('../../img/brand/ruh-mark.svg') 0 0 / 100% 100% no-repeat;
	mask: url('../../img/brand/ruh-mark.svg') 0 0 / 100% 100% no-repeat;
}

.hero { margin-top: calc(20 * var(--u)); }
.hero__frame { position: relative; overflow: hidden; aspect-ratio: 440 / 506; will-change: clip-path; } /* square at full width (Figma; client 2026-10-27), rounded only while opening — hero.js */
.hero__img--desktop { display: none; } /* Site Content hero: a video + a phone version — CSS shows one */
.hero__frame picture { display: block; width: 100%; height: 100%; }
.hero__img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%; }
/* Content width (Site Content → Display & motion, client 2026-11-04; no Figma frame): the container's edges, as the
   logo above; corners stay round (hero.js's start radius, 10 / 14px) since the frame never meets the screen's sides. */
.hero--contained { max-width: 1920px; margin-inline: auto; padding-inline: var(--gutter); }
.hero--contained .hero__frame { border-radius: 10px; }

@media (min-width: 1024px) {
	/* The mark in full on load at most screen heights (client feedback v2, 2026-10-25), ending 39 above the
	   screen's bottom — the header logo's gap from the top (y39; client round 2, 2026-10-27 — Figma's
	   1728×1117 frame has 18, so there the mark sits 21 higher and the title 7: deviation, home.json checks
	   x/w/h only). --intro-shift = the screen's height less 1138 (1099 mark bottom + 39); the mark moves by it
	   and the title by a third ("a little"). Clamped (RUH values, no Figma source): up to 320 up — title and
	   mark still 107 apart, below that the mark crops ("crop is fine") — and 200 down, past which tall
	   screens keep the space below. */
	.intro { --intro-shift: clamp(calc(-320 * var(--u)), calc(100svh - var(--wp-bar, 0px) - 1138 * var(--u)), calc(200 * var(--u))); padding-top: calc(329 * var(--u) + var(--intro-shift) / 3); }
	.intro__title { max-width: calc(775 * var(--u)); font-size: max(calc(56 * var(--u)), var(--fs-min)); line-height: calc(64 / 56); letter-spacing: 0; }
	.brandmark--hero { width: calc(1600 * var(--u)); margin: calc(314 * var(--u) + var(--intro-shift) * 2 / 3) 0 0; } /* content edges 64–1664 = the sticky bar (Figma 65–1663) */
	.hero { margin-top: calc(40 * var(--u)); }
	/* Figma 1728×925, never taller than the screen (Habib 2026-10-28: at 1080p, ~1920×960 in the browser, it was
	   1028 tall — no scroll position showed it whole). Capped: the picture fills the screen (cover, centred). */
	.hero__frame { width: 100%; aspect-ratio: 1728 / 925; max-height: 100svh; } /* width pinned: a max-height would carry over to the width through the ratio */
	.hero__img--desktop { display: block; }
	.hero__img--phone { display: none; }
	.hero--contained .hero__frame { border-radius: 14px; }
}

/* =========================================================================
   Statement — mobile y1188 400w 20/28; desktop x741 y2203 923w 32/45 +2%
   ========================================================================= */

.statement { padding-top: calc(80 * var(--u)); }
.statement__text { font-size: max(calc(20 * var(--fu)), var(--fs-min)); line-height: calc(28 / 20); }

@media (min-width: 1024px) {
	.statement { padding-top: calc(139 * var(--u)); }
	.statement__text {
		margin-left: calc(677 * var(--u));
		max-width: calc(923 * var(--u));
		font-size: max(calc(32 * var(--u)), var(--fs-min));
		line-height: calc(45 / 32);
		letter-spacing: 0;
	}
}

/* =========================================================================
   Projects — mobile: 400×283 r2, caption +16 (24/30 + tag), next card +32
              desktop: 1600×905, contiguous; first r10 top, last r10 bottom;
              title x+64 y+100 56/64 300, gap 12, arrow 41 + 13 + "Branding" 32/45
   ========================================================================= */

.projects { display: grid; row-gap: calc(32 * var(--u)); padding-top: calc(40 * var(--u)); }

.project-card__link { display: block; }

.project-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 400 / 283;
	border-radius: 2px;
	background: var(--card-bg, #111);
}
.project-card__img { display: block; width: 100%; height: 100%; object-fit: cover; } /* image, GIF or video (ruh_media) */
.project-card__img--desktop { display: none; } /* a separate phone file (ruh_thumb_home_m) */

.project-card__overlay { display: none; }

.project-card__caption {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: calc(16 * var(--u));
	font-size: max(calc(24 * var(--fu)), var(--fs-min));
	line-height: calc(30 / 24);
}

@media (min-width: 1024px) {
	/* Stacking cards (studiomodular.be c-stacking-items): every card sticks just below the
	   sticky header, each one a step lower than the last (source: translate n × 1.25rem), so
	   the cards underneath show a strip. The height is capped to the room left in the viewport,
	   so each card is seen whole; the thumbnail fills it (cover, centred). The width follows
	   down to 2:1 at most — Figma's own 1728×1117 look — so a short window (1080p screen,
	   ~1920×960 inside the browser) gets a narrower, centred card, not a 2.9:1 strip that cuts
	   the thumbnail in half (Habib 2026-10-28). Figma width 1600 wherever it fits. */
	.projects {
		/* Top of the stack: the band under the sticky bar is the cards' while the bar is hidden (scrolling
		   down) — they stick 24 from the top, the bar's own y — and the whole stack slides down with the bar
		   when it comes back on a scroll up (bar y24 + 74, + 16 air = 114), its 0.5s ease (Habib 2026-10-28;
		   was a fixed 152 for the v1 bar). The whole stack, not the stuck card alone: moving only that one
		   opened a gap under it above the next card. The height is sized for the hidden-bar room. */
		--stack-top: calc(24 * var(--u));
		--stack-push: 0px;
		--stack-gap: calc(24 * var(--u));         /* source 20px @1440 */
		--stack-n: 6;
		--card-room: calc(100svh - var(--stack-top) - var(--stack-n) * var(--stack-gap) - 16px);
		--card-W: min(calc(1600 * var(--u)), var(--card-room) * 2);
		display: grid;
		row-gap: var(--stack-gap);
		padding-top: calc(80 * var(--u));
		margin-top: calc(var(--stack-gap) * -1);
		padding-bottom: calc(var(--stack-n) * var(--stack-gap));
		translate: 0 var(--stack-push);
		transition: translate 0.5s var(--ease-out);
	}

	.project-card {
		position: sticky;
		top: var(--stack-top);
		z-index: var(--stack-i);
		width: var(--card-W);
		margin-inline: auto;
		translate: 0 calc(var(--stack-i, 1) * var(--stack-gap));
	}

	body:has(.site-header.is-sticky:not(.is-hidden)) .projects { --stack-push: calc(90 * var(--u)); }

	.project-card {
		--card-H: min(calc(var(--card-hd, 905) * var(--u)), var(--card-room));
	}
	.project-card__media {
		aspect-ratio: auto;
		width: 100%;
		height: var(--card-H);
		border-radius: 10px;
	}
	.project-card__img--desktop { display: block; }
	.project-card__img--phone { display: none; }
	/* Depth (stack.js, RUH.motion.settle.depth): a card being covered shrinks toward its top edge and darkens. */
	.project-card__media { transform-origin: 50% 0; }
	.project-card__media::after { content: ""; position: absolute; inset: 0; z-index: 2; background: #000; opacity: var(--depth, 0); pointer-events: none; }

	.project-card__overlay {
		display: grid;
		gap: calc(12 * var(--u));
		position: absolute;
		top: calc(100 * var(--u));
		left: calc(64 * var(--u));
		z-index: 1;
		color: var(--card-fg, #fff);
	}
	.project-card__title { font-size: max(calc(56 * var(--u)), var(--fs-min)); font-weight: 300; line-height: calc(64 / 56); }
	/* No service pill on the homepage cards (Habib 2026-11-17); Work Grid/List keep theirs. */
	.project-card__caption { display: none; }
	.project-card__img { transition: transform 1.2s var(--ease-out); }
	@media (hover: hover) { .project-card:hover .project-card__img { transform: scale(1.02); } }
}

/* =========================================================================
   About — mobile (inside the black block): media 400×395 +70, text +32 24/30 300,
           button +60 cyan r37 pad 9/21 Plex 16/24 gap 9, pad-bottom 70
           desktop: full-bleed 1728×964, text y+96 x64 677w 56/64 300,
           button 50 tall, 179 from bottom, outline white 50%, Plex 20/30 gap 15
           overlay #000 40% on the media (both)
   ========================================================================= */

.about { padding: calc(70 * var(--u)) var(--gutter) calc(70 * var(--u)); }
.about__media { position: relative; aspect-ratio: 400 / 395; overflow: hidden; background: #222; }
.about__media::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / 0.4); }
.about__video { width: 100%; height: 100%; object-fit: cover; }
.about__content { padding: 0; }
.about__text {
	margin-top: calc(32 * var(--u));
	max-width: calc(387 * var(--u));
	font-size: max(calc(24 * var(--fu)), var(--fs-min));
	font-weight: 300;
	line-height: calc(30 / 24);
	letter-spacing: 0;
}

.pill-button {
	display: inline-flex;
	align-items: center;
	gap: calc(9 * var(--u));
	margin-top: calc(60 * var(--u));
	padding: calc(9 * var(--u)) calc(21 * var(--u));
	border-radius: 37px;
	background: var(--cyan);
	color: var(--black);
	font-family: var(--plex);
	font-size: max(calc(16 * var(--fu)), var(--fs-min));
	line-height: calc(24 / 16);
	letter-spacing: -0.01em;
	transition: gap 0.4s var(--ease-out);
}
.pill-button .arrow-inline { width: calc(24 * var(--u)); }
@media (hover: hover) { .pill-button:hover { gap: calc(15 * var(--u)); } }

@media (min-width: 1024px) {
	.about { position: relative; padding: 0; }
	.about__media { aspect-ratio: 1729 / 964; }
	.about__content {
		position: absolute;
		inset: 0;
		z-index: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: calc(96 * var(--u)) var(--gutter) calc(179 * var(--u));
	}
	.about__text { margin-top: 0; max-width: calc(677 * var(--u)); font-size: max(calc(56 * var(--u)), var(--fs-min)); line-height: calc(64 / 56); letter-spacing: 0; }
	.pill-button {
		align-self: flex-start;
		margin: 0 0 0 calc(1 * var(--u));
		gap: calc(15 * var(--u));
		background: transparent;
		color: var(--white);
		border: 1px solid rgb(255 255 255 / 0.5);
		font-size: max(calc(20 * var(--fu)), var(--fs-min));
		line-height: calc(30 / 20);
	}
	.pill-button .arrow-inline { width: calc(24 * var(--u)); }
	@media (hover: hover) { .pill-button:hover { gap: calc(22 * var(--u)); } }
}

/* Display & motion → stacked cards off: the cards scroll as a plain list */
.m-off-stack .project-card { position: relative !important; top: auto !important; translate: none !important; }

@media (prefers-reduced-motion: reduce) {
	.project-card { position: relative !important; top: auto !important; translate: none !important; } /* source: no stacking with reduced motion */
	.projects { --card-room: 100000px; }
}

/* Very short desktop windows: not enough room to stack (source only stacks when a card fits) — cards simply scroll. */
@media (min-width: 1024px) and (max-height: 560px) {
	.projects { --card-room: 100000px; margin-top: 0; padding-bottom: 0; } /* full Figma height */
	.project-card { position: relative; top: auto; translate: none; }
}
