/* =====================================================================================
   Homepage — the approved design (RP Digital — Homepage, version 1794069323-643c), built on the design system (1794158049-2d7d palette).
   Ported from the design source's b3.css (Homepage/Prototype B3.2 (V5.4)/project/b3.css), which stays the
   reference for every value. Loaded on the front page only, after the system styles; nothing here is a system rule.

   Production differences from b3.css, all without changing the approved result:
   - Name font: Natom Pro Title Bold from the Adobe Fonts kit (natom-pro-title, swap), with a metric-matched
     fallback. Its line boxes are trimmed to the capitals with text-box; browsers without text-box get the
     measured offset instead (font checkpoint, 8 Nov 2026).
   - Markup comes from blocks: the role and location are two paragraphs in a group; the featured frames come from
     the Featured projects block, whose slots are positional (tr, bl, br) rather than named after projects.
   - The hero section clips horizontal overflow, so a complete font failure can never cause sideways scrolling.

   Mobile-first: the base rules are the typography-only hero (4 and 8 columns); the desktop composition applies
   when the site frame is at least 64rem wide. Breakpoints are in rem, measured on the site frame (container
   queries on pf-section): at the default text size they are the system's 600 and 1024px; when a reader enlarges
   text they move up with it, so large text gets the typography-only hero.

   Approved homepage exceptions to the design system (design source README):
   - Natom Pro Title Bold for the name, sized from the frame, outside the pf-fs scale
   - Desktop hero: 12 × 12 grid with three project frames overlapping the name
   - Uppercase intro, role and "View all projects"
   - The featured-project preview: dialog shadow, its own timing, two-layer depth, opacity-only reduced motion
   - Index label "All projects" with a top rule, no count
   ===================================================================================== */

/* ---------------------------------------------------------------- Name font
   Stack: the kit's Natom, then the kit's Sofia Pro Bold (within 2% of Natom's width), then a local Arial or
   Helvetica Bold scaled to Natom's width, then any sans. Measured on the production font (8 Nov 2026):
   Natom RACHELLE 4.745em untracked; Arial and Helvetica Bold 5.444em, so 87.2%. */
@font-face {
	font-family: "rp-name-fallback";
	src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold");
	font-weight: 700;
	size-adjust: 87.2%;
}

/* ---------------------------------------------------------------- Shared measures
   --w   site-frame width in use (the section's content box, capped at 1600px)
   --n   name size. Natom Pro Title Bold at −0.05em tracking: RACHELLE's letters are 4.283em wide
         (its line box, with side-bearings, 4.345em); POTIER's period reaches 0.229em past its R.
         Phone and tablet: line box + hanging period = frame width, so n = width / 4.574.
         Verified identical in the production font (font checkpoint). */
.b3-hero-section { padding-block: var(--pf-space-moderate) !important; overflow-x: clip; }
.b3-hero { --w: min(100cqi, var(--pf-frame-max)); --n: calc(var(--w) / 4.574); row-gap: 0 !important; position: relative; }

/* ---------------------------------------------------------------- Tablet and phone (base): typography only
   The name fills the frame with its period inside it: both lines are right-aligned 0.229em in from
   the frame edge, so the final E and the R share an edge and the period ends at the frame edge.
   Each line box is exactly the capitals (line-height 0.7) and the small lines are trimmed to cap height
   and baseline, so every gap in the stack is the grid gap between visible letterforms. */
.b3-name { grid-column: 1 / -1; margin: 0; font-weight: 400; }
.b3-intro { display: block; font-size: var(--pf-fs-heading); line-height: 1.2; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; text-box: trim-both cap alphabetic; }
.b3-l { display: block; width: max-content; margin: var(--pf-grid-gap) 0.229em 0 auto; font-family: "natom-pro-title", "sofia-pro", "rp-name-fallback", sans-serif; font-weight: 700; font-size: calc(var(--n) * var(--b3-fit, 1)); line-height: 0.7; letter-spacing: -0.05em; text-transform: uppercase; white-space: nowrap; color: var(--pf-color-ink); text-box: trim-both cap alphabetic; }
/* Without text-box, the production font's ascent (1.177em, against the demo file's 0.917em) draws the capitals
   0.129em below their line box. Moving them up by that amount puts them where trimming does (within 0.3px at
   1600px). Relative positioning moves only the ink, so the grid and every other measure are unchanged. */
@supports not (text-box: trim-both cap alphabetic) {
	.b3-l { position: relative; top: -0.129em; }
}
.b3-hang { display: inline-block; width: 0; }
/* --b3-fit is 1 unless a reader's own text spacing (WCAG 1.4.12) makes a name line wider than its space; then
   assets/js/home-name.js sets the ratio that brings it back, so the name stays on one line, whole, without the
   section's clip cutting it. Nothing changes at the design's own tracking. */

.b3-meta { grid-column: 1 / -1; margin: var(--pf-grid-gap) 0 0; display: flex; flex-direction: column; gap: var(--pf-space-xs); }
.b3-meta > p { margin: 0; }
.b3-role { font-size: var(--pf-fs-heading); line-height: 1.2; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; text-box: trim-both cap alphabetic; }
.b3-loc { font-size: var(--pf-fs-lead); line-height: 1.35; font-weight: 400; color: var(--pf-color-ink-muted); text-box: trim-both cap alphabetic; }

.b3-desc { grid-column: 1 / -1; margin-top: var(--pf-space-group); }
/* Phone: no jump link — the project index follows the introduction directly. */
.b3-cta { display: none; margin: 0; }
.b3-cta .pf-link { display: inline-flex; align-items: center; gap: var(--pf-space-2xs); min-height: var(--pf-target); font-size: var(--pf-fs-body); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

/* Frames exist only in the desktop composition. */
.b3-featured, .b3-frags, .b3-ix-base { display: none; }

/* Phone (4 columns): the intro and role step down to the lead size so the role stays on one line;
   the location steps down to body size to stay subordinate. */
@container pf-section (width < 37.5rem) {
	.b3-intro, .b3-role { font-size: var(--pf-fs-lead); }
	.b3-loc { font-size: var(--pf-fs-body); }
}

/* Tablet (8 columns) and up: description left, action right, on one baseline. */
@container pf-section (min-width: 37.5rem) {
	.b3-desc { grid-column: 1 / 6; align-self: last baseline; }
	.b3-cta { display: block; grid-column: 6 / -1; justify-self: end; align-self: last baseline; }
}

/* ---------------------------------------------------------------- Desktop (frame ≥ 64rem)
   12 columns × 12 rows with the grid gap between them. Row 1 is a half-row, so the composition sits a little
   higher and keeps breathing room at the bottom when the viewport is short (1280 × 720).
   Height: the hero fills the viewport below the 77px homepage header, but never taller than half the frame width.
   Content-safe: rows are 1fr with an automatic minimum, so if the name or text needs more room than the viewport
   gives, all twelve rows grow evenly and the page scrolls. */
@container pf-section (min-width: 64rem) {
	.b3-hero { --col: calc((var(--w) - 11 * var(--pf-grid-gap)) / 12);
		--n: calc((9 * var(--col) + 8 * var(--pf-grid-gap)) / 4.283);   /* RACHELLE spans nine columns */
		grid-template-rows: 0.5fr repeat(11, 1fr); row-gap: var(--pf-grid-gap) !important;
		min-height: min(calc(100svh - 77px - 2 * var(--pf-space-moderate)), calc(var(--w) * 0.5)); }

	/* The h1 is a subgrid over rows 3–9. Both name lines are right-aligned to the end of column 9;
	   the period takes no width and hangs past that edge. */
	.b3-name { grid-row: 3 / 10; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; position: relative; z-index: 2; pointer-events: none; }
	/* Intro and role scale with the name; (1rem − 16px) grows them with the reader's text setting. Never below lead. */
	.b3-intro, .b3-role { font-size: max(var(--pf-fs-lead), calc(var(--n) * 0.12 + 1.75 * (1rem - 16px))); }
	.b3-intro { grid-column: 1 / 7; grid-row: 1; align-self: end; }
	.b3-l { grid-column: 1 / 10; justify-self: end; margin: 0; pointer-events: auto; }
	.b3-l1 { grid-row: 2 / 5; align-self: center; margin-block: calc(var(--pf-grid-gap) * -0.25); }
	.b3-l2 { grid-row: 5 / 8; align-self: start; margin-bottom: calc(var(--pf-grid-gap) * -0.5); }

	/* Role and location: right edge on the name's edge, within columns 5–9; 8px below POTIER. */
	.b3-meta { grid-column: 5 / 10; grid-row: 10 / 12; justify-self: end; align-self: start; margin-top: var(--pf-space-2xs); position: relative; z-index: 3; }

	/* Description and action share the baseline of row 12. The action keeps its 44px target through padding
	   offset by negative margin, so the target never makes row 12 taller than the others. */
	.b3-desc { grid-column: 1 / 9; grid-row: 12; align-self: last baseline; margin: 0; position: relative; z-index: 3; }
	.b3-cta { grid-column: 9 / 13; grid-row: 12; justify-self: end; align-self: last baseline; position: relative; z-index: 3; }
	.b3-cta .pf-link { min-height: 0; padding-block: calc((var(--pf-target) - 1.6em) / 2); margin-block: calc((1.6em - var(--pf-target)) / 2); }

	/* ------------------------------------------------------------ Project frames
	   Each slot has two layers:
	     .b3-ix-base  its resting frame: a static, decorative image BEHIND the name (z 1). It never changes.
	     .b3-ix       its interactive layer IN FRONT of the name (z 4; z 5 while open). The layer occupies the
	                  project's open area and contains the resting frame; at rest it is transparent and only the
	                  resting frame responds to the pointer.
	   Open areas never cover another slot's resting frame:
	     tr  rests columns 9–11 × rows 2–5;   opens 6 × 7, columns 7–12 × rows 2–8,  growing left and down.
	     bl  rests columns 1–4  × rows 8–11;  opens 6 × 7, columns 1–6  × rows 5–11, growing up and right.
	     br  rests columns 10–12 × rows 9–11; opens 6 × 6, columns 7–12 × rows 6–11, growing up and left.
	   Each slot declares its open area in tracks (--cols × --rows), where its resting frame sits inside it
	   (--rc, --rr: tracks in; --rcs × --rrs: tracks spanned) and the growth corner (--ax, --ay). */
	.b3-featured, .b3-frags { display: contents; }
	.b3-ix-base { display: block; position: relative; z-index: 1; contain: size; align-self: stretch; overflow: hidden; background: var(--pf-color-surface); }
	.b3-ix-base--tr { grid-column: 9 / 12;  grid-row: 2 / 6; }
	.b3-ix-base--bl { grid-column: 1 / 5;   grid-row: 8 / 12; }   /* behind POTIER's P */
	.b3-ix-base--br { grid-column: 10 / 13; grid-row: 9 / 12; }   /* under the hanging period */
	.b3-ix { list-style: none; position: relative; z-index: 4; contain: size; align-self: stretch; container-type: size; pointer-events: none; --o: 0; }
	.b3-ix--tr { grid-column: 7 / 13; grid-row: 2 / 9;  --cols: 6; --rows: 7; --rc: 2; --rr: 0; --rcs: 3; --rrs: 4; --ax: 0; --ay: 0; }
	.b3-ix--bl { grid-column: 1 / 7;  grid-row: 5 / 12; --cols: 6; --rows: 7; --rc: 0; --rr: 3; --rcs: 4; --rrs: 4; --ax: 0; --ay: 1; }
	.b3-ix--br { grid-column: 7 / 13; grid-row: 6 / 12; --cols: 6; --rows: 6; --rc: 3; --rr: 3; --rcs: 3; --rrs: 3; --ax: 1; --ay: 1; }

	/* Everything that moves is laid out once at its OPEN size and animated with transform and opacity only.
	     .b3-ix-hit    the open card's hit area, hidden until the card starts to open.
	     .b3-ix-plate  the card's opaque body and shadow.
	     .b3-ix-rest   the resting fragment at the resting frame; fades out before the preview fades in.
	     .b3-ix-full   the expanded preview with its label.
	   Plate and preview share one uniform-scale transform, starting as large as fits inside the resting frame at
	   its growth corner. tan(atan2(a, b)) = a ÷ b for two lengths. State is one number, --o (0 resting, 1 open). */
	.b3-ix > * {
		--g: var(--pf-grid-gap);
		--cw: calc((100cqw - (var(--cols) - 1) * var(--g)) / var(--cols));
		--rh: calc((100cqh - (var(--rows) - 1) * var(--g)) / var(--rows));
		--rest-x: calc(var(--rc) * (var(--cw) + var(--g)));
		--rest-y: calc(var(--rr) * (var(--rh) + var(--g)));
		--rest-w: calc(var(--rcs) * var(--cw) + (var(--rcs) - 1) * var(--g));
		--rest-h: calc(var(--rrs) * var(--rh) + (var(--rrs) - 1) * var(--g));
		--s0: min(tan(atan2(var(--rest-w), 100cqw)), tan(atan2(var(--rest-h), 100cqh)));
		--x0: calc(var(--rest-x) + var(--ax) * (var(--rest-w) - 100cqw * var(--s0)));
		--y0: calc(var(--rest-y) + var(--ay) * (var(--rest-h) - 100cqh * var(--s0)));
		--k: calc(var(--s0) + (1 - var(--s0)) * var(--o)); }

	/* Motion (Glide). Open: geometry 440ms cubic-bezier(0.2, 0.7, 0.2, 1); front layer 0–120ms; resting fragment
	   out 40–120ms; preview in 100–300ms; shadow 0–352ms. Close: geometry 320ms cubic-bezier(0.4, 0, 0.2, 1);
	   preview out 0–120ms; resting fragment back 100–220ms; front layer out 200–320ms; shadow 0–240ms.
	   Hover intent 180ms; keyboard focus opens immediately. */
	.b3-ix { --in: 0ms; --rm-snap: 150ms;
		--geo-t: 320ms; --geo-e: cubic-bezier(0.4, 0, 0.2, 1);
		--front-t: 120ms; --front-d: 200ms;
		--pv-t: 120ms; --pv-d: 0ms;
		--rest-t: 120ms; --rest-d: 100ms;
		--sh-t: 240ms; }
	.b3-ix:has(.b3-ix-link:is(:focus-visible, .is-open):not(.is-dismissed)) { --o: 1; --in: 0ms; z-index: 5;
		--geo-t: 440ms; --geo-e: cubic-bezier(0.2, 0.7, 0.2, 1);
		--front-t: 120ms; --front-d: 0ms; --pv-t: 200ms; --pv-d: 100ms; --rest-t: 80ms; --rest-d: 40ms; --sh-t: 352ms; --rm-snap: 0ms; }
	@media (hover: hover) {
		.b3-ix:has(.b3-ix-link:hover:not(.is-dismissed):not(:focus-visible)) { --o: 1; --in: 180ms; z-index: 5;
			--geo-t: 440ms; --geo-e: cubic-bezier(0.2, 0.7, 0.2, 1);
			--front-t: 120ms; --front-d: 0ms; --pv-t: 200ms; --pv-d: 100ms; --rest-t: 80ms; --rest-d: 40ms; --sh-t: 352ms; --rm-snap: 0ms; }
	}

	.b3-ix-link { position: absolute; inset: 0; display: block; pointer-events: none; color: var(--pf-color-ink); text-decoration: none; outline: none;
		opacity: var(--o); transition: opacity var(--front-t) var(--pf-ease-out) calc(var(--in) + var(--front-d)); }
	.b3-ix-hit { position: absolute; inset: 0; pointer-events: auto; visibility: hidden; transition: visibility 0s linear 0s; }
	.b3-ix:has(.b3-ix-link:is(:focus-visible, .is-open):not(.is-dismissed)) .b3-ix-hit { visibility: visible; }
	@media (hover: hover) {
		.b3-ix:has(.b3-ix-link:hover:not(.is-dismissed):not(:focus-visible)) .b3-ix-hit { visibility: visible; transition-delay: var(--in); }
	}
	.b3-ix-plate { position: absolute; inset: 0; background: var(--pf-color-surface);
		transform-origin: 0 0; transform: translate(calc(var(--x0) * (1 - var(--o))), calc(var(--y0) * (1 - var(--o)))) scale(var(--k)); will-change: transform;
		transition: transform var(--geo-t) var(--geo-e) var(--in); }
	.b3-ix-plate::after { content: ""; position: absolute; inset: 0; box-shadow: var(--pf-shadow-dialog);
		opacity: var(--o); transition: opacity var(--sh-t) var(--pf-ease-out) var(--in); }
	.b3-ix-rest { position: absolute; top: var(--rest-y); left: var(--rest-x); width: var(--rest-w); height: var(--rest-h); overflow: hidden; pointer-events: auto;
		opacity: calc(1 - var(--o)); transition: opacity var(--rest-t) var(--pf-ease-out) calc(var(--in) + var(--rest-d)); }
	.b3-ix-full { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none;
		transform-origin: 0 0; transform: translate(calc(var(--x0) * (1 - var(--o))), calc(var(--y0) * (1 - var(--o)))) scale(var(--k)); will-change: transform, opacity;
		opacity: var(--o); transition: transform var(--geo-t) var(--geo-e) var(--in), opacity var(--pv-t) var(--pf-ease-out) calc(var(--in) + var(--pv-d)); }
	.b3-ix-media { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
	/* Each placement sets its own --pf-focus on its img (default centre). A resting fragment's two copies carry
	   the same value, written once by the block. */
	.b3-ix-base img, .b3-ix img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pf-focus, 50% 50%); }
	.b3-ix-label { flex: none; background: var(--pf-color-page); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: var(--pf-space-s); padding: var(--pf-space-xs) var(--pf-space-s) var(--pf-space-s); border-top: 1px solid var(--pf-color-line); }
	.b3-ix-title { font-size: var(--pf-fs-card); line-height: 1.3; font-weight: 500; color: var(--pf-color-accent); }
	.b3-ix-kind { grid-row: 2; grid-column: 1 / -1; font-size: var(--pf-fs-caption); line-height: 1.45; color: var(--pf-color-ink-muted); }
	.b3-ix-go { font-size: var(--pf-fs-card); color: var(--pf-color-accent); }

	/* Focus: two static rings, one on the resting frame and one on the open card, so the 2px outline is never
	   scaled and nothing is laid out during the animation. */
	.b3-ix-ring { position: absolute; outline: var(--pf-focus-width) solid var(--pf-color-accent); outline-offset: 2px; opacity: 0; pointer-events: none; transition: opacity 120ms linear; }
	.b3-ix-ring--rest { top: var(--rest-y); left: var(--rest-x); width: var(--rest-w); height: var(--rest-h); }
	.b3-ix-ring--open { inset: 0; }
	.b3-ix:has(.b3-ix-link:focus-visible.is-dismissed) .b3-ix-ring--rest,
	.b3-ix:has(.b3-ix-link:focus-visible:not(.is-dismissed)) .b3-ix-ring--open { opacity: 1; transition-delay: calc(var(--geo-t) * 0.6); }

	/* Reduced motion: nothing moves or scales; after the same hover-intent pause the states swap with a short fade.
	   Opening, the card takes its open size while invisible and then fades in; closing, it fades out first. */
	@media (prefers-reduced-motion: reduce) {
		.b3-ix-plate { transition: transform 0s calc(var(--in) + var(--rm-snap)) !important; }
		.b3-ix-full { transition: transform 0s calc(var(--in) + var(--rm-snap)), opacity 150ms linear var(--in) !important; }
		.b3-ix-link, .b3-ix-rest, .b3-ix-plate::after { transition: opacity 150ms linear var(--in) !important; }
	}

	/* Forced colours: the open card keeps an edge and the focus ring uses the system highlight. */
	@media (forced-colors: active) {
		.b3-ix-plate { border: 1px solid CanvasText; }
		.b3-ix-label { border-top-color: CanvasText; }
		.b3-ix-ring { outline-color: Highlight; }
	}
}

/* ---------------------------------------------------------------- Into the index */
.b3-hero-section + .b3-index-section { margin-top: var(--pf-space-group); }
.b3-index-section:focus { outline: none; }
.b3-index-head { margin: 0 0 var(--pf-space-moderate); display: flex; align-items: baseline; justify-content: space-between; padding-top: var(--pf-space-s); border-top: 1px solid var(--pf-color-line); }
