:root {
  --bg: #05090B;
  --sand: #F8EBDA;
  --cyan: #00B3D9;
  --teal: #1F7A93;
  --navy: #0E3B4A;
  --deep: #176A80;
  --green: #2FA39A;
  /* R31 (client D5): Cormorant Garamond for the headline, section headings, kicker, wordmark and quotes; Figtree for
     body, buttons, stats and small headings. Faces: fonts.css (vendor/fonts). Cormorant runs small for its size
     (low x-height), so its sizes below are a step up from the pre-R31 ones. */
  --sans: "Figtree", "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", Georgia, serif;

  /* R18: oil-sheen palette P-c (docs/sheen-catalog.md). The only place the sheen's hex values are written.
     raw = the stops as chosen (no rule reads them yet). lift = raised to hold 4.75:1 against near-black: the
     button fill under its dark label, sheen text, ring and underline on dark. deep = lowered so sand holds
     4.75:1: ring and underline on sand. */
  --sheen-1: #7143B9; --sheen-2: #595BBE; --sheen-3: #3578C2; --sheen-4: #1197BC; --sheen-5: #0FB5BA; --sheen-6: #23D3B9;
  --sheen-lift-1: #9065DD; --sheen-lift-2: #6E72D7; --sheen-lift-3: #3B7EC9; --sheen-lift-4: #1197BC; --sheen-lift-5: #0FB5BA; --sheen-lift-6: #23D3B9;
  --sheen-deep-1: #7143B9; --sheen-deep-2: #595BBE; --sheen-deep-3: #2569B2; --sheen-deep-4: #07718D; --sheen-deep-5: #037276; --sheen-deep-6: #047565;
  /* Not in the catalog: the first three lift stops raised again by the same rule (OKLCH lightness only) until
     they hold 3:1 against navy #0E3B4A (3.25 computed), where lift measures 2.8. Used only by the ring and the
     underline where the ground is or can be navy. */
  --sheen-navy-1: #986DE7; --sheen-navy-2: #767BE1; --sheen-navy-3: #4588D3;
  --sheen-lift: var(--sheen-lift-1), var(--sheen-lift-2), var(--sheen-lift-3), var(--sheen-lift-4), var(--sheen-lift-5), var(--sheen-lift-6);
  --sheen-deep: var(--sheen-deep-1), var(--sheen-deep-2), var(--sheen-deep-3), var(--sheen-deep-4), var(--sheen-deep-5), var(--sheen-deep-6);
  --sheen-navy: var(--sheen-navy-1), var(--sheen-navy-2), var(--sheen-navy-3), var(--sheen-lift-4), var(--sheen-lift-5), var(--sheen-lift-6);
  /* R20: the lift ramp there and back, so a drifting fill has no seam. */
  --sheen-lift-loop: var(--sheen-lift), var(--sheen-lift-5), var(--sheen-lift-4), var(--sheen-lift-3), var(--sheen-lift-2), var(--sheen-lift-1);
  /* R24 (N9): the sheen dividing line between sections (thirds.css says where). Full width, the navy-raised ramp
     (it sits on navy and deep teal), faded out at both ends so it reads as an edge between grounds, not a control. */
  --divider-h: 2px;
  --divider: linear-gradient(90deg, transparent, var(--sheen-navy-1) 14%, var(--sheen-navy-2), var(--sheen-navy-3), var(--sheen-lift-4), var(--sheen-lift-5), var(--sheen-lift-6) 86%, transparent);
  /* R24 (N6): the sheen emphasis underline (.em-sheen): thicker than the link underline (2 px) and set lower. */
  --em-h: 4px;
  --em-drop: 0.32em;   /* the band's top edge then sits about 1.5 px under the glyph box: it never touches a letter */

  /* R20: the hero's scroll travel, as a multiple of 300vh. R23: the short hero, 0.4 viewport heights (0.4 / 3; main.js
     set this until R30). Everything keyed to the hero scroll reads the height of .scroll-space. */
  --travel: 0.13333;
}
/* R20: registered so they can be animated and added together inside background-position (the button drift). */
@property --drift { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --hov { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--sand); }
body { font-family: var(--serif); }

/* Fixed full-viewport stage; the page itself scrolls via .scroll-space. The hero ground is CSS now
   (the canvas is transparent outside the oil). */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #05090B;
}
.scroll-space { height: calc(100vh + var(--travel) * 300vh); } /* travel = --travel x 300vh: the stage is fixed */
html:not(.has-canvas) .scroll-space { height: 0; }
/* No canvas (reduced motion / no WebGL): the stage is an ordinary first screen, then the page follows. */
html:not(.has-canvas) .stage {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(#05090B 70%, #0E3B4A);
}
html:not(.has-canvas) .hero { height: auto; min-height: 100vh; }

/* R9: the canvas is transparent outside the oil and rides above the page, below the header bar.
   It never takes a click. */
#drop-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 4;
  pointer-events: none;
}

/* R20: the ribbon (ribbon.js adds the canvas first in .stage): below the hero text. It takes no clicks. ribbon.js sets its opacity and hides it when it is not drawn. */
#ribbon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
}
/* Frame one: the text block's centre sits at about 58 % of the viewport height. */
.has-canvas .hero-copy {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 46rem);
}
.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.3rem;
}
html:not(.has-canvas) .hero { padding: 16vh 16px 12vh; }
.kicker {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;   /* R31: the italic face is 400 only (no synthesis) */
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  letter-spacing: 0.02em;
  color: var(--sand);
  opacity: 0.9;   /* R31: was 0.8; Cormorant's italic hairlines need the extra strength at phone size */
}
/* R22: the proof line under the hero button. */
.hero-proof {
  margin: 0;
  max-width: 40rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--sand);
  opacity: 0.88;
}
.hero-proof strong { font-weight: 700; }
.sub {
  margin: 0;
  max-width: 34rem;
  font-family: var(--sans);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--sand);
  opacity: 0.88;
}

h1 {
  margin: 0;
  max-width: min(22ch, 100%);
  font-weight: 600;
  font-size: clamp(2.1rem, 6.2vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--sand);
  text-wrap: balance;
}
/* R18, T2: one phrase of the headline takes the sheen (lift ramp). Sand, inherited from the h1, unless the
   browser can clip a background to the glyphs. */
/* R22: the phrase "energy and mining" stays on one line. */
.sheen-text { white-space: nowrap; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .sheen-text {
    background: linear-gradient(100deg, var(--sheen-lift));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* R18, B1: the main button. Lift-ramp fill, dark label; hover and keyboard focus slide the gradient. */
.cta {
  position: relative;
  display: inline-block;
  padding: 0.8rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--sheen-lift)) 0% 50% / 140% 100% border-box;
  color: var(--bg);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: background-position 0.9s ease;
}
.cta:hover, .cta:focus-visible { background-position: 100% 50%; }
@media (prefers-reduced-motion: reduce) { .cta { transition: none; } }
/* R20: the hero's own button, larger (type and padding about 1.4 times). The header button (.cta-sm) and the
   closing button keep their sizes. */
.cta-lg { padding: 1.1rem 2.7rem; font-size: 1.45rem; }
/* R20: drift (the sampler's D variants, 8 s a loop) on the full-size buttons; the header button stays static.
   One loop moves the there-and-back ramp three button-widths. Hover and keyboard focus slide the gradient a
   further 0.4 button-widths over 0.9 s while the drift keeps running (two registered properties, added).
   Only where motion is allowed, and only where main.js found @property working (.sheen-drift): otherwise
   the rules above apply unchanged. */
@media (prefers-reduced-motion: no-preference) {
  .sheen-drift .cta:not(.cta-sm) {
    background: linear-gradient(100deg, var(--sheen-lift-loop)) calc(var(--drift) + var(--hov)) 50% / 300% 100% border-box;
    animation: cta-drift 8s linear infinite;
    transition: --hov 0.9s ease;
  }
  .sheen-drift .cta:not(.cta-sm):hover, .sheen-drift .cta:not(.cta-sm):focus-visible { --hov: -20%; }
}
@keyframes cta-drift { to { --drift: -150%; } }

/* R18, S2: the one focus treatment. A 2px gradient ring, clear of the control, in place of the browser's outline.
   Lift ramp by default (near-black grounds); see the page rules further down for navy, the teal grounds and sand. */
a, button { position: relative; }
a:focus-visible, button:focus-visible { outline: none; }
a:focus-visible::after, button:focus-visible::after {
  content: "";
  position: absolute;
  inset: -6px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--sheen-lift));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* Forced colours drop backgrounds: give back a system outline and plain text. */
@media (forced-colors: active) {
  a:focus-visible, button:focus-visible { outline: 2px solid Highlight; outline-offset: 3px; }
  .sheen-text { background: none; -webkit-text-fill-color: currentColor; color: inherit; }
}

/* Still composition: a small drop shape, CSS only. Hidden once a canvas is mounted. */
.still-drop {
  display: block;
  width: 28px;
  height: 28px;
  background: radial-gradient(circle at 35% 30%, var(--cyan), var(--teal) 55%, var(--navy));
  border-radius: 0 50% 50% 50%;
  transform: rotate(45deg);
}
.has-canvas .still-drop { display: none; }

/* R5: mark, header */
/* The still composition's mark (no canvas only), above the headline block. */
.mark {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.mark svg, .mark-final svg, .bar-mark svg { width: 100%; height: 100%; display: block; }
.has-mark .still-drop { display: none; }
.bar { display: none; }
.has-canvas .bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  background: linear-gradient(#05090B, rgba(5, 9, 11, 0));
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-mark { display: block; width: 26px; height: 26px; flex: none; }
/* The marks are sand on the dark grounds: only the white shapes change colour; mark.svg itself is untouched. */
.bar-mark [fill="#ffffff"], .mark-final [fill="#ffffff"] { fill: var(--sand); }
.wordmark { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: 0.02em; color: var(--sand); }
.cta-sm { padding: 0.3rem 1rem; font-size: 0.95rem; }
.cta, .wordmark { white-space: nowrap; }
@media (max-width: 360px) { .wordmark { font-size: 1.1rem; } .cta-sm { padding: 0.3rem 0.8rem; font-size: 0.9rem; } .brand { gap: 7px; } }

/* R8/R9: header over the page. Once the page begins the ground is fully opaque navy. */
.bar { transition: background-color 0.25s; }
.has-canvas .bar.on-page {
  background: var(--navy);
  box-shadow: 0 1px 0 rgba(248, 235, 218, 0.14);
}

/* R8: the page below the hero. Opaque curtain over the fixed stage; ground eases navy > teals > sand > navy. */
.page {
  position: relative;
  z-index: 3;
  background: var(--navy);
  color: var(--sand);
  font-family: var(--sans);
  font-size: 1.1rem;
  line-height: 1.6;
  overflow-x: clip;
}
:where(.page) section { position: relative; padding: clamp(3.5rem, 7vw, 6rem) 16px; }
.wrap { max-width: 42rem; margin: 0 auto; }
.page h2 {
  margin: 0 0 1.6rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
}
.page h3 {
  margin: 0 0 0.6rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
}
.page p { margin: 0 0 1.25rem; }
.page p:last-child { margin-bottom: 0; }

/* R18, S3: text links in the reading sections (not the buttons): the sheen underline. By ground, with the ring:
   navy = the lift ramp with its first three stops raised for navy; sand = the deep ramp. On the teal grounds
   (.s-problem eases navy to teal, .s-does is teal) no ramp holds 3:1, so there both are the text colour.
   The header button sits on near-black, on the plates and on navy in turn: its ring takes the navy ramp throughout. */
.page a:not(.cta) {
  color: inherit;
  text-decoration: none;
  padding-bottom: 3px;
  background: linear-gradient(90deg, var(--sheen-navy)) 0 100% / 100% 2px no-repeat;
}
.page [data-ground="light"] a:not(.cta) { background-image: linear-gradient(90deg, var(--sheen-deep)); }
.page :is(.s-problem, [data-ground="mid"]) a:not(.cta) { background-image: linear-gradient(currentColor, currentColor); }
.page a:focus-visible::after, .bar a:focus-visible::after { background: linear-gradient(100deg, var(--sheen-navy)); }
.page [data-ground="light"] a:focus-visible::after { background: linear-gradient(100deg, var(--sheen-deep)); }
.page :is(.s-problem, [data-ground="mid"]) a:not(.cta):focus-visible::after { background: currentColor; }

.s-problem { background: linear-gradient(var(--navy), var(--deep)); }
.s-does {
  background: linear-gradient(var(--deep) calc(100% - 20rem), var(--teal) calc(100% - 15rem), #3C9A9C calc(100% - 9rem), var(--sand) 100%);
  padding-bottom: 21rem;
}
.two { max-width: 42rem; margin: 0 auto; }
.two > .l > :last-child:not(h2), .two > .r > :last-child { margin-bottom: 0; }
.s-does .d-body { margin: 2.6rem 0; }
.cols { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.cols p { margin: 0; }
.note { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; line-height: 1.3; }

/* R24 (N6): sheen emphasis in copy. <span class="em-sheen">phrase</span>; nothing else to add. The text keeps its
   colour (contrast unchanged); a sheen band under it, the ramp by ground as the link underline (navy-raised on dark and
   teal grounds, deep on sand). It is not a link: a plain span (no pointer, not focusable), and the band is 4 px, its
   top about 1.5 px under the glyph box, where a link's line is 2 px directly under it. The band runs on across a line break (one ramp per phrase). */
.em-sheen {
  padding-bottom: var(--em-drop);
  background: linear-gradient(90deg, var(--sheen-navy)) 0 100% / 100% var(--em-h) no-repeat;
}
[data-ground="light"] .em-sheen { background-image: linear-gradient(90deg, var(--sheen-deep)); }
@media (forced-colors: active) { .em-sheen { background: none; text-decoration: underline 3px; text-underline-offset: 0.2em; } }

/* Light sections: navy text on sand */
.s-fractional, .s-when, .s-track, .s-who { background: var(--sand); color: var(--navy); }
.s-when, .s-track, .s-who { border-top: 1px solid rgba(14, 59, 74, 0.14); }
.s-when ul { margin: 0; padding-left: 1.3rem; }
.s-when li { margin-bottom: 0.7rem; }
/* R22: the new body buttons (after "Call when" and after the track record): the existing .cta, left-aligned in the column. */
.mid-cta { margin-top: 2.2rem; }
.misses ul { margin: 0; padding-left: 1.3rem; }
.misses li { margin-bottom: 0.7rem; }
.misses li:last-child { margin-bottom: 0; }
.quote-by { margin: 0.9rem 0 0; font-family: var(--sans); font-size: 1rem; line-height: 1.4; }
.s-when h3 { margin-top: 2rem; }
.proof {
  list-style: none;
  margin: 2.4rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem 1.2rem;
}
.proof .num {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.1vw, 1.9rem);
  white-space: nowrap;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}
.proof .lbl { display: block; font-size: 1rem; line-height: 1.45; }
blockquote {
  margin: 2.6rem 0 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--deep);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1.35;
}
blockquote p { margin: 0; }
/* R24: the testimonials (slot 8a), the page's quote pattern: one column, then three side by side from 1100 px.
   Base ground sand; thirds.css paints it dark. R26/R30: the heading "What clients say" shows (OQ-31). */
.s-voices { background: var(--sand); color: var(--navy); border-top: 1px solid rgba(14, 59, 74, 0.14); }
.voices { max-width: 40rem; margin: 0 auto; display: grid; gap: 2.4rem; }
.voices blockquote { margin: 0; font-size: 1.4rem; }   /* the 1998 quote is 1.5rem: three client quotes read a step below Ralph's own */
.voices .quote-by { font-size: 0.95rem; }
@media (min-width: 1100px) { .voices { max-width: 72rem; grid-template-columns: repeat(3, 1fr); gap: 3rem; } }

/* Closing: sand eases back to navy in the top padding, where no text sits */
.s-close {
  background: linear-gradient(var(--sand), #3C9A9C 4rem, var(--teal) 8rem, var(--navy) 12rem);
  padding-top: 16rem;
  text-align: center;
  --mark: 160px;
}
.s-close p { margin-bottom: 2rem; }
.close-stage { position: relative; height: calc(var(--mark) + 2rem); margin-bottom: 1.5rem; }
.mark-final {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--mark);
  height: var(--mark);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.mark-final svg { overflow: visible; }

@media (max-width: 760px) {
  .page { font-size: 1.05rem; }
  .proof .num { font-size: 1.5rem; white-space: normal; }
  .proof .lbl { font-size: 0.95rem; }
  .s-does { padding-bottom: 15rem; background: linear-gradient(var(--deep) calc(100% - 14rem), var(--teal) calc(100% - 10rem), #3C9A9C calc(100% - 5rem), var(--sand) 100%); }
}
@media (max-width: 480px) { .s-close { --mark: 110px; } }

/* ---------------------------------------------------------------------------------------------
   R10. With a canvas only: the long joins (no text on them; the drop hovers over them) and the closing
   section's room for the mark to scroll up to the hovering drop.
   ------------------------------------------------------------------------------------------- */
.has-canvas :where(.page) section { padding-block: clamp(4.5rem, 10vh, 7.5rem); }
.has-canvas .s-does {
  padding-bottom: 66vh;
  background: linear-gradient(
    #176A80 calc(100% - 66vh),
    #1A7088 calc(100% - 58vh),
    #1F7A93 calc(100% - 48vh),
    #2B8A9A calc(100% - 38vh),
    #3C9A9C calc(100% - 28vh),
    #8DBFB8 calc(100% - 17vh),
    #CFE0CF calc(100% - 8vh),
    #F8EBDA 100%);
}
.has-canvas .s-close {
  padding-top: 66vh;
  padding-bottom: 44vh;
  background:
    linear-gradient(
      #F8EBDA 0,
      #CFE0CF 8vh,
      #8DBFB8 17vh,
      #3C9A9C 28vh,
      #2B8A9A 38vh,
      #1F7A93 48vh,
      #176A80 58vh,
      #0E3B4A 66vh) top / 100% 66vh no-repeat,
    var(--navy);
}

/* The dock: only with a canvas, at every width. A fixed strip along the bottom of the viewport; the page
   beneath is blurred and faded, with a mask so the top edge has no hard line. main.js sets its height (a fraction
   of the canvas box, so it follows the mobile URL bar), opacity and tint (--dock: r, g, b). It takes no clicks. */
.dock { display: none; }
.has-canvas .dock {
  display: block;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 16vh;   /* fallback; main.js sets it in px */
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  --dock: 14, 59, 74;
  background: linear-gradient(to top, rgba(var(--dock), 0.82), rgba(var(--dock), 0.5) 55%, rgba(var(--dock), 0));
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--dock-mask, 45%));
  mask-image: linear-gradient(to bottom, transparent, #000 var(--dock-mask, 45%));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .has-canvas .dock { background: linear-gradient(to top, rgba(var(--dock), 0.97), rgba(var(--dock), 0.85) 55%, rgba(var(--dock), 0)); }
}
/* R24 (N3): the hero block in the columns layout. It is anchored by its top, not centred at 58 %: the top sits 24 px
   plus a little air under the forming drop (its lowest point at rest is 11.2 % of the height: centre 8.2 %, radius
   3 %), so the block uses the space that was empty above it and the ribbon (fitted below the block) has room. The
   gaps grow a little around the button so it stays the focus; the proof line sits close under it. */
.layout-thirds.has-canvas .hero-copy { top: calc(11.2% + 24px + 2.5%); transform: translateX(-50%); }
.layout-thirds .hero .cta-lg { margin-top: 0.5rem; }
.layout-thirds .hero .hero-proof { margin-top: -0.3rem; }
/* Phones: the block no longer needs the room under it that the centred block left, so the headline is a size up. */
@media (max-width: 480px) { .layout-thirds.has-canvas .hero h1 { font-size: clamp(2.1rem, 10vw, 2.65rem); } }

/* One centred reading column at every width (>= 900 px: a comfortable measure, a little more air). */
@media (min-width: 900px) {
  :where(.page) section { padding-inline: 24px; }
  .two, .wrap { max-width: 40rem; }
  .page h2 { font-size: clamp(2.4rem, 3.5vw, 3.2rem); }
  .proof { gap: 2rem 2rem; }
}
