/* Front page only (enqueued on is_front_page()).
   The page is a director's notebook: ink on cream paper, a red pencil for the marks,
   and real footage developing through the sketches. Motion lives in assets/js/home.js;
   everything here reads correctly with no JavaScript and with Reduce Motion on. */

:root { --rmh-head: 82px; } /* replaced with the real sticky-header height by home.js */

.rmh-hero, .rmh-clients, .rmh-work, .rmh-beyond, .rmh-close {
  --rmh-paper: var(--wp--preset--color--background, #FAFAF7);
  --rmh-sheet: var(--wp--preset--color--cream, #F2EDE3);
  --rmh-ink: #1d1b17;
  --rmh-night: var(--wp--preset--color--ink, #161613);
  --rmh-muted: var(--wp--preset--color--muted, #6B6B68);
  --rmh-rule: var(--wp--preset--color--subtle, #E9E5DC);
  --rmh-pencil: #B4432F;
  --rmh-display: var(--wp--preset--font-family--display, Fraunces, Georgia, serif);
  --rmh-sans: var(--wp--preset--font-family--body, Inter, Arial, sans-serif);
  --rmh-mono: var(--wp--preset--font-family--mono, "JetBrains Mono", monospace);
  --rmh-gutter: clamp(1rem, 4vw, 3rem);
  box-sizing: border-box;
}
.rmh-hero *, .rmh-clients *, .rmh-work *, .rmh-beyond *, .rmh-close * { box-sizing: border-box; }

.rmh-wrap { max-width: 1320px; margin-inline: auto; padding-inline: var(--rmh-gutter); }
.rmh-h2 { font-family: var(--rmh-display); font-weight: 300; font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.rmh-h3 { font-family: var(--rmh-display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 1rem; text-wrap: balance; }
.rmh-lede { font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.6; color: var(--rmh-muted); max-width: 56ch; margin: 1.4rem 0 0; }
.rmh-note { font-family: var(--rmh-display); font-style: italic; font-weight: 300; font-size: 1.02rem; line-height: 1.4; color: var(--rmh-pencil); margin: 0; }

/* Text link with a hand-drawn underline that grows on hover */
.rmh-link { position: relative; display: inline-block; font-weight: 500; color: inherit; text-decoration: none; padding-bottom: 4px; background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; transition: background-size .45s cubic-bezier(.65,.05,.36,1); }
.rmh-link::after { content: " \2192"; }
.rmh-link:hover { background-size: 30% 1px; }
.rmh-link--light { color: #FAF8F3; }

/* Button: a plain label with a pen box drawn round it, no pill */
.rmh-btn { position: relative; display: inline-flex; align-items: center; min-height: 56px; padding: 0 1.9rem; font-family: var(--rmh-display); font-size: 1.2rem; font-weight: 400; text-decoration: none; color: var(--rmh-ink); }
.rmh-btn svg { position: absolute; inset: -3px -6px; width: calc(100% + 12px); height: calc(100% + 6px); overflow: visible; pointer-events: none; }
.rmh-btn::after { content: ""; position: absolute; inset: 7px 9px; background: currentColor; opacity: 0; transition: opacity .3s; }
.rmh-btn:hover::after { opacity: .08; }
.rmh-btn--light { color: #FAF8F3; }
.rmh-btn:focus-visible, .rmh-link:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }

/* Words circled or underlined in red pencil */
.rmh-mark { position: relative; display: inline-block; white-space: nowrap; }
.rmh-mark > svg { position: absolute; left: -6%; top: -18%; width: 112%; height: 136%; color: var(--rmh-pencil); overflow: visible; pointer-events: none; }
.rmh-mark--under > svg { left: -2%; top: auto; bottom: -0.22em; width: 104%; height: 0.32em; }

/* ---------------- Hero ---------------- */
.rmh-hero { position: relative; height: calc(100svh - var(--rmh-head)); min-height: 640px; overflow: hidden; color: #FAF8F3; background: var(--rmh-night); display: flex; align-items: flex-end; }
.rmh-hero__plate { position: absolute; inset: -8% 0 -8% 0; will-change: transform; }
.rmh-hero__still { position: absolute; inset: 0; background-size: cover; background-position: center; }
.rmh-hero__video { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100vw; height: 56.25vw; min-height: 100%; min-width: 177.78vh; border: 0; pointer-events: none; }
@media (max-width: 760px) { .rmh-hero__video, .rmh-hero__marks .rmh-ink--faint { display: none; } }
.rmh-hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,9,8,.35) 0%, rgba(10,9,8,0) 30%, rgba(10,9,8,.15) 55%, rgba(10,9,8,.82) 100%); }
.rmh-hero__marks { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(250,248,243,.78); will-change: transform; }
.rmh-hero__marks .rmh-ink--faint { color: rgba(250,248,243,.32); }
.rmh-hero__marks path { vector-effect: non-scaling-stroke; }
.rmh-hero__copy { position: relative; z-index: 2; width: 100%; padding: 0 var(--rmh-gutter) clamp(2.6rem, 7vw, 5.5rem); }
.rmh-hero__note { font-family: var(--rmh-display); font-style: italic; font-weight: 300; font-size: clamp(1rem, 1.4vw, 1.2rem); margin: 0 0 1rem; color: rgba(250,248,243,.85); }
.rmh-hero__title { font-family: var(--rmh-display); font-weight: 300; font-size: clamp(2.6rem, 7.4vw, 7.2rem); line-height: .98; letter-spacing: -0.02em; margin: 0; max-width: 16ch; }
.rmh-hero__title .rmh-line { display: block; }
.rmh-hero__sub { margin: 1.5rem 0 0; max-width: 50ch; font-weight: 300; font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.6; color: rgba(250,248,243,.88); }
.rmh-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.2rem; margin-top: 2rem; }
.rmh-hero__slate { position: absolute; z-index: 2; right: var(--rmh-gutter); bottom: clamp(2.6rem, 7vw, 5.5rem); margin: 0; display: grid; gap: .3rem; text-align: right; font-family: var(--rmh-mono); font-size: .72rem; color: rgba(250,248,243,.7); }
@media (max-width: 900px) { .rmh-hero__slate { display: none; } }

/* ---------------- Clients sentence ---------------- */
.rmh-clients { padding: clamp(3.5rem, 8vw, 7rem) var(--rmh-gutter) clamp(1rem, 3vw, 2rem); }
.rmh-clients__text { max-width: 1320px; margin: 0 auto; font-family: var(--rmh-display); font-weight: 300; font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1.28; letter-spacing: -0.012em; color: var(--rmh-ink); text-wrap: pretty; }
.rmh-clients__text .rmh-mark { white-space: normal; }

/* ---------------- The work ---------------- */
.rmh-work { padding-top: clamp(4rem, 9vw, 8rem); color: var(--rmh-ink); }
.rmh-work__intro { margin-bottom: clamp(2.5rem, 6vw, 5rem); }

/* VIOW: the storyboard develops into film. The section is tall; the stage sticks. */
.rmh-board { position: relative; height: 320vh; }
.rmh-board__stage { position: sticky; top: var(--rmh-head); height: calc(100vh - var(--rmh-head)); display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: center; padding-inline: var(--rmh-gutter); max-width: 1600px; margin-inline: auto; }
.rmh-board__frame { position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: calc(100vh - var(--rmh-head) - 4rem); background: var(--rmh-sheet); outline: 1px solid var(--rmh-rule); outline-offset: 10px; }
.rmh-board__film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.rmh-board__sketch { position: absolute; inset: 0; color: var(--rmh-ink); pointer-events: none; }
.rmh-board__sketch svg { width: 100%; height: 100%; display: block; }
.rmh-board__sketch path { stroke-width: 1.8; }
.rmh-board__note { position: absolute; left: 4%; bottom: -3.2rem; max-width: 36ch; }
.rmh-board__copy p { color: var(--rmh-muted); line-height: 1.65; margin: 0; }

/* RT: scroll wipes the camera log into the grade */
.rmh-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, .62fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: end; padding-block: clamp(5rem, 10vw, 9rem); }
.rmh-grade__copy p { color: var(--rmh-muted); line-height: 1.65; margin: 0 0 1rem; }
.rmh-grade__hint { color: var(--rmh-pencil); }
.rmh-grade__wipe { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #222; }
.rmh-grade__wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rmh-grade__after { clip-path: inset(0 0 0 50%); }
.rmh-grade__seam { position: absolute; top: -2%; bottom: -2%; left: 50%; width: 20px; margin-left: -10px; color: #FAF8F3; pointer-events: none; }
.rmh-grade__seam svg { width: 100%; height: 100%; }
.rmh-grade__label { position: absolute; bottom: .9rem; font-family: var(--rmh-display); font-style: italic; font-size: 1rem; color: #FAF8F3; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.rmh-grade__label--a { left: 1rem; }
.rmh-grade__label--b { right: 1rem; }
.rmh-grade__reel { margin: 0; }
.rmh-grade__reel video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: #222; }
.rmh-grade__reel figcaption { margin-top: .7rem; }

/* Hornbeam: reels slide past like plates on the pass */
.rmh-pan { position: relative; height: 280vh; background: var(--rmh-sheet); }
.rmh-pan__stage { position: sticky; top: var(--rmh-head); height: calc(100vh - var(--rmh-head)); overflow: hidden; display: flex; align-items: center; }
.rmh-pan__track { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); padding-inline: var(--rmh-gutter); will-change: transform; }
.rmh-pan__lead { flex: 0 0 min(520px, 80vw); }
.rmh-pan__lead p { color: var(--rmh-muted); line-height: 1.65; margin: 0 0 1.4rem; }
.rmh-pan__sketch { color: var(--rmh-ink); width: 100%; aspect-ratio: 16 / 9; }
.rmh-pan__sketch svg { width: 100%; height: 100%; display: block; }
.rmh-pan__sketch path { stroke-width: 2.2; }
.rmh-pan__reel { flex: 0 0 auto; margin: 0; width: min(300px, 62vw); }
.rmh-pan__reel:nth-of-type(even) { transform: translateY(5vh); }
.rmh-pan__reel video { width: 100%; aspect-ratio: 9 / 16; max-height: calc(100vh - var(--rmh-head) - 9rem); object-fit: cover; display: block; background: #2a2622; box-shadow: 0 18px 40px -22px rgba(30,20,10,.55); }
.rmh-pan__reel figcaption { margin-top: .7rem; font-family: var(--rmh-mono); font-size: .74rem; color: var(--rmh-muted); }
.rmh-pan__aside { flex: 0 0 13ch; align-self: flex-start; margin-top: 18vh; }

.rmh-more { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 3rem; padding-block: clamp(3rem, 6vw, 5rem); border-bottom: 1px solid var(--rmh-rule); }
.rmh-more p { margin: 0; max-width: 70ch; font-family: var(--rmh-display); font-weight: 300; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.45; }
.rmh-more p a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---------------- After the shoot ---------------- */
.rmh-beyond { padding-block: clamp(5rem, 10vw, 9rem); color: var(--rmh-ink); }
.rmh-beyond__intro { margin-bottom: clamp(3rem, 7vw, 6rem); }
.rmh-beyond__route { position: relative; display: grid; gap: clamp(4rem, 10vw, 8rem); padding-left: clamp(2.6rem, 6vw, 5rem); }
.rmh-beyond__line { position: absolute; left: 0; top: 0; width: clamp(28px, 4vw, 52px); height: 100%; color: var(--rmh-pencil); overflow: visible; }
.rmh-beyond__line path { vector-effect: non-scaling-stroke; }
.rmh-stop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(1.5rem, 4vw, 4.5rem); align-items: center; }
.rmh-stop--flip .rmh-stop__copy { order: 2; }
.rmh-stop__copy p { color: var(--rmh-muted); line-height: 1.65; margin: 0 0 1.3rem; max-width: 48ch; }
.rmh-stop__media { margin: 0; position: relative; }
.rmh-stop__media video, .rmh-stop__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--rmh-sheet); outline: 1px solid var(--rmh-rule); }
.rmh-stop__media--square video { aspect-ratio: 1; max-width: 560px; }
.rmh-stop__media figcaption { margin-top: .7rem; }

/* ---------------- Close ---------------- */
.rmh-close { background: var(--rmh-night); color: #FAF8F3; padding-block: clamp(6rem, 13vw, 12rem); }
.rmh-close__title { font-family: var(--rmh-display); font-weight: 300; font-size: clamp(2.8rem, 8vw, 7.6rem); line-height: 1; letter-spacing: -0.02em; margin: 0; max-width: 14ch; }
.rmh-close__sub { margin: 1.8rem 0 0; max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6; color: rgba(250,248,243,.75); }
.rmh-close__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.4rem; margin-top: 2.6rem; }

/* Older homepage sections: drop the spaced-capital labels on this page only */
body.home .rm-wdx { display: none; }
.rmh-work p, .rmh-beyond p, .rmh-close p, .rmh-hero p { text-wrap: pretty; }

/* ---------------- Phones and tablets ---------------- */
@media (max-width: 900px) {
  .rmh-board { height: 240vh; }
  .rmh-board__stage { grid-template-columns: 1fr; align-content: center; gap: 3.6rem; }
  .rmh-board__note { bottom: -2.8rem; font-size: .92rem; }
  .rmh-grade { grid-template-columns: 1fr; }
  .rmh-grade__reel { max-width: 300px; }
  .rmh-pan { height: auto; padding-block: 4rem; }
  .rmh-pan__stage { position: static; height: auto; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 1rem; }
  .rmh-pan__track { align-items: flex-start; }
  .rmh-pan__track > * { scroll-snap-align: start; }
  .rmh-pan__reel:nth-of-type(even) { transform: none; }
  .rmh-pan__reel video { max-height: none; }
  .rmh-pan__aside { margin-top: 3rem; }
  .rmh-stop, .rmh-stop--flip { grid-template-columns: 1fr; }
  .rmh-stop--flip .rmh-stop__copy { order: 0; }
}

/* ---------------- Reduce Motion: show the finished state, nothing pins ---------------- */
@media (prefers-reduced-motion: reduce) {
  .rmh-board { height: auto; padding-block: 2rem 5rem; }
  .rmh-board__stage { position: static; height: auto; }
  .rmh-board__film { opacity: 1; }
  .rmh-board__sketch { color: #FAF8F3; opacity: .35; }
  .rmh-pan { height: auto; padding-block: 4rem; }
  .rmh-pan__stage { position: static; height: auto; overflow-x: auto; }
  .rmh-grade__after { clip-path: inset(0 0 0 50%); }
}


/* The Albion: banner film inside a pen-drawn browser window */
.rmh-site { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4.5rem); align-items: center; padding-block: clamp(5rem, 10vw, 9rem) clamp(2rem, 4vw, 3rem); color: var(--rmh-ink); }
.rmh-site__browser { position: relative; margin: 0; padding: 7.2% 2.2% 2.2%; }
.rmh-site__frame { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--rmh-ink); overflow: visible; pointer-events: none; }
.rmh-site__frame path { vector-effect: non-scaling-stroke; }
.rmh-site__url { position: absolute; top: 2.3%; left: 30%; width: 40%; text-align: center; font-family: var(--rmh-mono); font-size: clamp(.6rem, .9vw, .78rem); color: var(--rmh-muted); line-height: 2.2; }
.rmh-site__browser video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #23313a; }
.rmh-site__copy p { color: var(--rmh-muted); line-height: 1.65; margin: 0 0 1rem; }
.rmh-site__copy .rmh-note { color: var(--rmh-pencil); }

/* Video stop: three storyboard panels traced from the banner */
.rmh-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.6rem, 1.4vw, 1.2rem); }
.rmh-strip__panel { display: grid; gap: .5rem; }
.rmh-strip__sketch { aspect-ratio: 16 / 9; max-width: 100%; background: var(--rmh-sheet); outline: 1px solid var(--rmh-rule); color: var(--rmh-ink); }
.rmh-strip__sketch svg { width: 100%; height: 100%; display: block; }
.rmh-strip__panel span { font-family: var(--rmh-mono); font-size: .72rem; color: var(--rmh-muted); }
.rmh-stop__links { display: flex; flex-wrap: wrap; gap: .8rem 2rem; }
.rmh-stop__copy p + p { margin-top: 0; }

@media (max-width: 900px) {
  .rmh-site { grid-template-columns: 1fr; }
  .rmh-strip { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 520px) {
  .rmh-site__url { display: none; }
  .rmh-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
  .rmh-strip__panel { scroll-snap-align: start; }
}

.rmh-clients__text a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rmh-rule); text-underline-offset: 6px; transition: text-decoration-color .3s; }
.rmh-clients__text a:hover { text-decoration-color: var(--rmh-pencil); }
.rmh-clients__text a.rmh-mark { text-decoration: none; }
.rmh-board__copy .rmh-link, .rmh-site__copy .rmh-link, .rmh-grade__copy .rmh-link { margin-top: 1.2rem; }
