/* ============================================================
   RESULTS PAGE
   1. Hero: navy with a soft light-blue glow.
   2. Client spotlight: one row of light cards of mixed widths
      (big number / client quote / wide statement), heading and
      intro on the left, outlined pill top right.
   3. Case study pages (one per story): the story in navy, white or
      dark, then "More results" with the other two spotlight cards.
   4. Calm reveal (only when js/results-page.js adds .rp-anim):
      cards rise in turn, pictures rise and straighten.
   The final banner comes from css/closing.css.
   (css/results.css is the homepage's results section.)
   ============================================================ */

/* --- 1. Hero --- */
.rp-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 96px) 0 110px;
  background: linear-gradient(180deg, var(--dark) 0%, #112652 55%, var(--navy) 100%);
  color: var(--white);
}
.rp-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 48% 75% at 82% 0%, rgba(123, 159, 212, 0.42) 0%, rgba(123, 159, 212, 0) 70%),
    radial-gradient(ellipse 60% 60% at 30% 115%, rgba(166, 196, 240, 0.4) 0%, rgba(46, 101, 184, 0.18) 45%, rgba(46, 101, 184, 0) 75%);
  pointer-events: none;
}
.rp-hero-inner { position: relative; z-index: 1; }
.rp-hero .section-label { color: var(--light-blue); }
.rp-hero h1 { max-width: 14ch; margin: 0; font-size: clamp(2.5rem, 6vw, 4.8rem); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; color: var(--white); }
.rp-hero-line { max-width: 34rem; margin: 1.5rem 0 0; font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6; color: rgba(255, 255, 255, 0.82); }

/* --- 2. Client spotlight --- */
.rp-spot { padding: 90px 0 100px; background: var(--white); }
.rp-spot-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; margin-bottom: 2.25rem; }
.rp-spot-head h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.025em; }
.rp-spot-head p { margin: 0.6rem 0 0; font-size: 1.05rem; color: var(--text-muted); }

.rp-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  transition: background var(--transition), color var(--transition), gap var(--transition);
}
.rp-pill:hover,
.rp-pill:focus-visible { gap: 0.8rem; background: var(--navy); color: var(--white); }
.rp-arrow { width: 1rem; height: 1rem; flex: none; }

.rp-spot-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 1rem; }
.rp-spot-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 1.6rem 1.5rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--off-white);
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.rp-spot-card:hover,
.rp-spot-card:focus-visible { transform: translateY(-4px); border-color: var(--light-blue); background: #eef3fa; }
.rp-spot-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* A card with a photo behind it on hover, under a light wash so the text still reads */
.rp-spot-card--photo { position: relative; isolation: isolate; overflow: hidden; }
.rp-spot-card--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(244, 247, 251, 0.4), rgba(244, 247, 251, 0.6)), var(--photo) var(--photo-pos, center) / cover no-repeat;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.rp-spot-card--photo-ppe { --photo: url("../images/ppe-aerial.webp"); }
.rp-spot-card--photo-ppe1 { --photo: url("../images/ppe-aerial-mournes.webp"); }
.rp-spot-card--photo-ff { --photo: url("../images/fisher-fisher-office.webp"); }
.rp-spot-credit { display: block; margin-top: 0.6rem; font-size: 0.7rem; font-weight: 600; color: var(--navy); opacity: 0; transition: opacity 0.4s ease; }
.rp-spot-card--photo:hover .rp-spot-credit,
.rp-spot-card--photo:focus-visible .rp-spot-credit { opacity: 1; }
.rp-spot-card--photo:hover::before,
.rp-spot-card--photo:focus-visible::before { opacity: 1; }
.rp-spot-label { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.5; color: var(--blue); }
/* "More results" at the end of a case study: the other two cards */
.rp-spot--more { background: var(--white); }
.rp-spot-row--more { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.rp-spot-sub { margin: 0.2rem 0 0; font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.rp-spot-num { margin: auto 0 0.4rem; font-size: clamp(2.8rem, 4.4vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--navy); }
.rp-spot-text { margin: 0; font-size: 0.95rem; line-height: 1.45; color: var(--text-muted); }
.rp-spot-quote { margin: 0; }
.rp-spot-quote p { margin: 0; font-size: clamp(1.05rem, 1.4vw, 1.2rem); font-weight: 600; line-height: 1.5; color: var(--navy); }
.rp-spot-name { margin: auto 0 0; padding-top: 1.25rem; font-size: 0.88rem; color: var(--text-muted); }
.rp-spot-name strong { display: block; font-weight: 700; color: var(--navy); }
.rp-spot-statement { margin: auto 0 0; font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; color: var(--navy); }
.rp-spot-more { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1.4rem; font-size: 0.85rem; font-weight: 700; color: var(--blue); transition: gap var(--transition); }
.rp-spot-card:hover .rp-spot-more { gap: 0.75rem; }

/* --- 3. Chapters --- */
.rp-chapter { --ch-text: var(--text); --ch-muted: var(--text-muted); --ch-head: var(--navy); --ch-accent: var(--blue); --ch-num: var(--light-blue); --ch-line: var(--border);
  padding: 110px 0; background: var(--white); color: var(--ch-text); scroll-margin-top: var(--nav-height); }
.rp-chapter--navy,
.rp-chapter--dark { --ch-text: rgba(255, 255, 255, 0.86); --ch-muted: rgba(255, 255, 255, 0.7); --ch-head: var(--white); --ch-accent: var(--light-blue); --ch-num: rgba(123, 159, 212, 0.75); --ch-line: rgba(255, 255, 255, 0.18); }
.rp-chapter--navy { background: var(--navy); }
.rp-chapter--dark { background: var(--dark); }
.rp-chapter--white { background: var(--off-white); }

/* case study page: the story sits straight under the menu bar */
.rp-chapter--page { padding-top: calc(var(--nav-height) + 64px); }
.rp-back { display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 1.75rem; font-size: 0.88rem; font-weight: 700; color: var(--ch-accent); transition: gap var(--transition); }
.rp-back:hover,
.rp-back:focus-visible { gap: 0.75rem; }
.rp-ch-label { margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.5; color: var(--ch-accent); }
.rp-chapter h1 { max-width: 22ch; margin: 0; font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.12; letter-spacing: -0.025em; color: var(--ch-head); }
.rp-ch-intro { max-width: 44rem; margin: 1.1rem 0 0; font-size: 1.08rem; line-height: 1.7; color: var(--ch-text); }
/* :where keeps these weak so the labels and numbers below keep their own colours */
:where(.rp-chapter) h3 { color: var(--ch-head); }
:where(.rp-chapter) p { color: var(--ch-text); }

.rp-ch-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem 4.5rem; align-items: center; margin-top: 3.75rem; }
.rp-ch-media { display: flex; justify-content: center; }
/* website showcase: devices across the full width, ticks underneath in two columns */
.rp-ch-main--wide { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.rp-ch-main--wide .rp-pic--devices { max-width: 1080px; padding: 2.5rem 3rem; }
.rp-ch-main--wide .rp-ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* the big number and the facts */
.rp-big { display: flex; flex-direction: column; margin: 0 0 2rem; }
.rp-big-num { font-size: clamp(4.5rem, 10vw, 8rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.05em; color: var(--ch-head); }
.rp-big-label { margin-top: 0.6rem; font-size: 1.05rem; font-weight: 600; color: var(--ch-accent); }
.rp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0; }
.rp-facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding-left: 1rem; border-left: 2px solid var(--light-blue); }
.rp-facts dd { margin: 0 0 0.35rem; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--ch-head); }
.rp-facts dt { font-size: 0.88rem; line-height: 1.45; color: var(--ch-muted); }

/* Fisher & Fisher: four ticked lines */
.rp-ticks { display: grid; gap: 1.1rem; margin: 0; padding: 0; list-style: none; }
.rp-ticks li { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border: 1px solid var(--ch-line); border-radius: var(--radius-lg); background: var(--white); }
.rp-tick { flex: none; width: 2.2rem; height: 2.2rem; padding: 0.5rem; border-radius: 50%; background: var(--blue); color: var(--white); }
.rp-ticks span { font-size: 1rem; line-height: 1.4; color: var(--text-muted); }
.rp-ticks strong { margin-right: 0.45rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.rp-chapter .rp-source { margin: 1.25rem 0 0; font-size: 0.8rem; line-height: 1.55; color: var(--ch-muted); }

.rp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--light-blue);
  font-weight: 700;
  color: var(--blue);
  transition: gap var(--transition), color var(--transition), border-color var(--transition);
}
.rp-link .rp-arrow { width: 1.1rem; height: 1.1rem; }
.rp-link:hover,
.rp-link:focus-visible { gap: 0.8rem; border-color: var(--navy); color: var(--navy); }

/* Campaign 1 against Campaign 2 */
.rp-compare { margin-top: 2.5rem; }
.rp-compare h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.rp-compare p { margin: 0; font-size: 0.92rem; color: var(--ch-muted); }
.rp-table { width: 100%; margin-top: 0.75rem; border-collapse: collapse; font-size: 0.95rem; }
.rp-table th,
.rp-table td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--ch-line); text-align: left; color: var(--ch-muted); }
.rp-table thead th { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ch-accent); }
.rp-table tbody th { font-weight: 700; color: var(--ch-head); }
.rp-table td:nth-child(3),
.rp-table td:nth-child(4) { font-weight: 800; color: var(--ch-head); }
.rp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the pictures */
.rp-pic { margin: 0; }
.rp-pic--video { position: relative; width: min(100%, 340px); }
.rp-pic--video img { display: block; width: 100%; height: auto; aspect-ratio: 406 / 722; object-fit: cover; border-radius: 22px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); }
.rp-pic--video figcaption { margin-top: 1rem; text-align: center; font-size: 0.8rem; color: var(--ch-muted); }
.rp-pic--video figcaption a { color: var(--white); border-bottom: 1px solid var(--light-blue); }

/* Planning Permission Experts: aerial still from the video ad, with the credit under it */
.rp-pic--aerial { width: min(100%, 460px); }
.rp-pic--aerial img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); }
.rp-pic--aerial figcaption { margin-top: 1rem; text-align: center; font-size: 0.8rem; color: var(--ch-muted); }
.rp-pic--aerial figcaption a { color: var(--ch-head); border-bottom: 1px solid var(--light-blue); }

/* laptop + phone: the hero's device frames, screens cut out as percentages */
.rp-pic--devices { container-type: inline-size; width: 100%; padding: 1.5rem 1.25rem; border-radius: 20px; background: var(--white); border: 1px solid var(--border); }
.rp-devices { --dev-h: calc(100cqw / 2.0774); display: flex; align-items: flex-start; height: var(--dev-h); }
.rp-device { position: relative; flex: none; margin: 0; }
.rp-device-frame { position: relative; z-index: 1; display: block; width: 100%; height: auto; pointer-events: none; }
.rp-device-screen { position: absolute; overflow: hidden; background: #10131c; }   /* dark like the bezel, so no white shows at the screen edges */
.rp-device-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rp-device--mac { order: 2; width: calc(var(--dev-h) * 1.7709); }
/* shadows sit on the frames only: a filter on the whole device made the browser flatten (and blur) the screenshot inside */
.rp-device--mac .rp-device-frame { filter: drop-shadow(0 18px 28px rgba(13, 31, 66, 0.22)); }
.rp-device--phone .rp-device-frame { filter: drop-shadow(0 14px 22px rgba(13, 31, 66, 0.28)); }
.rp-device--mac .rp-device-screen { left: 11.1%; top: 3.7%; width: 77.8%; height: 86.3%; }   /* a hair bigger than the cut-out, tucked under the frame */
.rp-device--phone { order: 1; z-index: 2; width: calc(var(--dev-h) * 0.5021); margin-right: calc(var(--dev-h) * -0.1956); }
.rp-device--phone .rp-device-screen { left: 5.8%; top: 2.2%; width: 88.4%; height: 95.6%; border-radius: 9% / 4.2%; }

/* Campaign 1 has no photo: day 1 against day 30, in type */
.rp-pic--days {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.5rem 1.75rem;
  width: 100%;
  padding: 3rem 2.75rem;
  border-radius: 22px;
  background: var(--light-blue) url("../images/mountains-mark.svg") right -30px bottom -24px / 52% auto no-repeat;
  color: var(--dark);
}
.rp-pic--days span { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rp-pic--days strong { font-size: clamp(4.5rem, 10vw, 8rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.05em; }
.rp-pic--days strong:first-of-type { color: rgba(13, 31, 66, 0.35); }

/* the story in short parts */
.rp-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2.5rem 3.5rem; margin-top: 4.5rem; padding-top: 3rem; border-top: 1px solid var(--ch-line); }
.rp-part h3 { margin: 0 0 0.7rem; font-size: 1.2rem; }
.rp-part p { margin: 0 0 0.8rem; line-height: 1.7; }
.rp-part p:last-child { margin-bottom: 0; }

/* How it was built: numbered steps 01, 02, 03... */
.rp-steps-title { margin: 4rem 0 0; font-size: 1.2rem; }
.rp-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2.25rem 2.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: rp-step; }
.rp-steps li { counter-increment: rp-step; padding-top: 1.1rem; border-top: 1px solid var(--ch-line); font-size: 0.95rem; line-height: 1.65; color: var(--ch-muted); }
.rp-steps li::before { content: counter(rp-step, decimal-leading-zero); display: block; margin-bottom: 0.7rem; font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--ch-num); }
.rp-steps strong { display: block; margin-bottom: 0.25rem; font-size: 1.02rem; font-weight: 700; color: var(--ch-head); }

/* --- 4. Calm reveal (js adds .rp-anim; reduced motion never gets it) --- */
@keyframes rp-glow { from { opacity: 0; transform: translateY(8%); } }
@keyframes rp-up { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: no-preference) {
  .rp-hero-glow { animation: rp-glow 2.2s cubic-bezier(.2, .7, .2, 1) 0.1s backwards; }   /* "backwards", not "both": a held glow animation stopped Chromium painting after scrolling (About page) */
  .rp-hero-inner > * { animation: rp-up 0.9s cubic-bezier(.2, .8, .2, 1) backwards; }
  .rp-hero-inner > :nth-child(2) { animation-delay: 0.12s; }
  .rp-hero-inner > :nth-child(3) { animation-delay: 0.3s; }
}

.rp-anim .rp-spot-card,
.rp-anim .rp-rise { --d: 0s; transition-property: opacity, translate, transform, border-color, background; transition-duration: 0.8s, 0.8s, 0.25s, 0.25s, 0.25s; transition-timing-function: cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d), var(--d), 0s, 0s, 0s; }
.rp-anim .rp-spot-card:not(.is-in),
.rp-anim .rp-rise:not(.is-in) { opacity: 0; translate: 0 32px; }
.rp-anim .rp-spot-card:nth-child(2),
.rp-anim .rp-steps li:nth-child(4n + 2) { --d: 0.12s; }
.rp-anim .rp-spot-card:nth-child(3),
.rp-anim .rp-steps li:nth-child(4n + 3) { --d: 0.24s; }
.rp-anim .rp-spot-card:nth-child(4),
.rp-anim .rp-steps li:nth-child(4n + 4) { --d: 0.36s; }
.rp-anim .rp-part:nth-child(2) { --d: 0.12s; }
.rp-anim .rp-part:nth-child(3) { --d: 0.24s; }

/* pictures rise and straighten */
.rp-anim .rp-pic { transition: opacity 1s ease, translate 1.2s cubic-bezier(.2, .8, .2, 1), rotate 1.2s cubic-bezier(.2, .8, .2, 1); }
.rp-anim .rp-pic:not(.is-in) { opacity: 0; translate: 0 56px; rotate: -4deg; }
.rp-anim .rp-pic--devices:not(.is-in) { rotate: 3deg; }

/* ============ Smaller screens ============ */
@media (max-width: 1100px) {
  .rp-spot-row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
  .rp-spot-card--wide { grid-column: 1 / -1; }   /* the two number cards share a row, the wide card sits under them */
  .rp-spot-card { min-height: 260px; }
}
@media (max-width: 900px) {
  .rp-hero { padding: calc(var(--nav-height) + 56px) 0 72px; }
  .rp-spot { padding: 64px 0 72px; }
  .rp-spot-head { flex-direction: column; align-items: flex-start; }
  .rp-chapter { padding: 72px 0; }
  .rp-chapter--page { padding-top: calc(var(--nav-height) + 40px); }
  .rp-ch-main { grid-template-columns: minmax(0, 1fr); margin-top: 2.5rem; }
  .rp-parts { margin-top: 3rem; padding-top: 2.25rem; }
  .rp-steps-title { margin-top: 3rem; }
}
@media (max-width: 640px) {
  .rp-spot-row { grid-template-columns: minmax(0, 1fr); }
  .rp-spot-card { min-height: 0; }
  .rp-spot-num { margin-top: 1.25rem; }
  .rp-spot-statement { margin-top: 1rem; }
  .rp-facts { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .rp-pic--video { width: min(100%, 280px); }
  .rp-pic--devices { padding: 1.5rem 1rem; }
  .rp-pic--days { padding: 2.25rem 1.75rem; }
  .rp-table { font-size: 0.85rem; }
  .rp-ticks li { padding: 0.95rem 1rem; }
  .rp-ch-main--wide .rp-ticks { grid-template-columns: minmax(0, 1fr); }
  .rp-ch-main--wide .rp-pic--devices { padding: 1.5rem 1rem; }
}
