/* Corrections on top of the ported prototype styles (not generated by scripts/port-prototype.py). */

/* Transaction CFO: the heading the word field resolves into is orange in the design. */
.service-page .wordfield h2,.wordfield h2{color:var(--orange)}

/* Cred detail hero: same icon and Rive animation as the cred's card. */
.cred-hero-art{display:flex;align-items:center;justify-content:center}
.cred-hero-art>svg{display:block;flex:none;width:76%;height:auto}
.cred-hero-art.is-tall>svg{width:auto;height:76%}
.cred-hero-art .rive-icon-overlay canvas{width:165%;height:165%}
.cred-hero-art .rive-icon-overlay[data-rive-icon="editorial-1219"] canvas{width:170%;height:170%}
.cred-hero-art .rive-icon-overlay:is([data-rive-artboard="4"],[data-rive-artboard="7"],[data-rive-artboard="11"]) canvas{width:220%;height:220%}

/* Lenis smooth scrolling (replaces the native smooth behaviour while it is active). */
html.lenis,html.lenis body{height:auto}
html.lenis,.lenis.lenis-smooth{scroll-behavior:auto!important}
.lenis.lenis-smooth [data-lenis-prevent]{overscroll-behavior:contain}
.lenis.lenis-stopped{overflow:clip}
.lenis.lenis-smooth iframe{pointer-events:auto}

/* Brand scrollbar: slim ink thumb on a cream track. The standard properties are used
   everywhere because current Chrome ignores ::-webkit-scrollbar styling once they are set,
   and without them macOS shows only its default overlay bar. The pseudo-elements below
   cover older Safari. */
html{scrollbar-width:thin;scrollbar-color:#2e1f00 #edeade}
@supports not (scrollbar-color:auto){
 ::-webkit-scrollbar{width:10px;height:10px}
 ::-webkit-scrollbar-track{background:#edeade}
 ::-webkit-scrollbar-thumb{background:#2e1f00;border:2px solid #edeade}
 ::-webkit-scrollbar-thumb:hover{background:#f6641a}
}

/* Until the entrance script runs, content is not painted (see Layout.astro). */
html.entrance-pending main,html.entrance-pending nav{opacity:0}

/* Desktop nav spacing that the nav script otherwise only applies once it has run
   (.has-shared-panel), which made the Services item shift after load. */
@media(min-width:901px){
 nav .navlinks{align-items:center;gap:14px}
 nav .navlinks>details>summary{padding:8px 10px;margin:-8px -4px;border-radius:0;white-space:nowrap}
}

/* Services dropdown: the "Go to all services" arrow nudges forward on hover, like the buttons. */
.all-services img{transition:translate .5s cubic-bezier(.22,1,.36,1)}
.all-services:hover img,.all-services:focus-visible img{translate:3px 0}
@media(prefers-reduced-motion:reduce){.all-services img{transition:none}}

/* Services catalogue: the "learn more" circle fills on hover, as on the work cards. */
.catalog-row .learn .circle{transition:background .3s ease,border-color .3s ease}
.catalog-row .learn .link-arrow{transition:filter .3s ease}
.catalog-row .learn:hover .circle,.catalog-row .learn:focus-visible .circle{background:var(--ink);border-color:var(--ink);transform:none}
.catalog-row .learn:hover .link-arrow,.catalog-row .learn:focus-visible .link-arrow{filter:brightness(0) invert(1)}

/* The closing CTA line and the footer column titles are not headings (kept out of the
   document outline); they keep the heading typography. :where keeps specificity at the
   level the old h2/h3 element rules had. */
:where(.cta-title){font-family:'Sentient Light',serif;font-weight:300;font-synthesis:none}

/* Card hover colours. Some pieces of a card changed colour at once while its background was
   still fading (text on the work cards, rules and tags on the cred cards, the Rive art
   everywhere). Every card now fades background, text and border together and its inner
   pieces follow at the same pace. */
.main-service-card{--card-fade:.45s}
.cred-card,.accounting-tile{--card-fade:.4s}
.work-card,.client-type-card,.industry-related-card{--card-fade:.3s}
.main-service-card,a.work-card,.cred-card,.accounting-tile,.client-type-card,.industry-related-card{
  transition:background-color var(--card-fade) ease,color var(--card-fade) ease,border-color var(--card-fade) ease}
.cred-card>div,.cred-card .cred-card-meta span,.work-card .work-meta span,.accounting-tile p,.client-type-card p{
  transition:background-color var(--card-fade) ease,color var(--card-fade) ease,border-color var(--card-fade) ease,opacity var(--card-fade) ease}
.main-service-card .circle,.cred-card .circle,.work-card .circle{
  transition:background-color var(--card-fade) ease,border-color var(--card-fade) ease,transform .7s cubic-bezier(.22,1,.36,1)}
.main-service-card .link-arrow,.cred-card .link-arrow,.work-card .link-arrow{transition:filter var(--card-fade) ease}
/* Mouse drag on the sideways rails (script.js dragScroll). Snapping is off while a drag and
   its throw are running; nothing in a rail is selectable or natively draggable. */
@media (hover:hover) and (pointer:fine){
  .rail-window{cursor:grab}
  .rail-window,.creds-filter-scroll{-webkit-user-select:none;user-select:none}
  .rail-window img,.creds-filter-scroll img{-webkit-user-drag:none}
}
.rail-window.is-dragging,.creds-filter-scroll.is-dragging{scroll-snap-type:none;scroll-behavior:auto;cursor:grabbing}
.rail-window.is-dragging *,.creds-filter-scroll.is-dragging *{cursor:grabbing}
/* Text inherits the card's colour as it fades; a colour fade of its own would restart on
   every frame of the card's and trail behind it. */
.client-type-card p{transition:opacity var(--card-fade) ease}
/* Card hover colours run from ONE number. `--hover-p` goes 0 -> 1 on hover and the card's
   background and the colour of the Rive art are both computed from it, so they can never be
   out of step or snap back separately when a hover is cut short.

   Text (and the button beside it) fades in step with the background from the first frame.
   It uses a plain colour transition with the same duration and curve rather than a colour
   computed from --hover-p: Chrome does not always repaint text whose inherited colour comes
   from an animating custom property, and then the text only changed when the fade ended.
   The Rive art keeps its contrast instead: while the background darkens the art darkens
   with it, then it switches to its light colour in a narrow band (41-51%) around the
   background's mid-tone. */
@property --hover-p{syntax:'<number>';inherits:true;initial-value:0}
.rive-icon-overlay:not([data-rive-icon="page-10230"]) canvas{filter:brightness(0) invert(.508) sepia(.47)}
.main-service-card,.cred-card{--hover-p:0}
.main-service-card:hover,.main-service-card:focus-visible,.cred-card:hover,.cred-card:focus-visible{--hover-p:1}
.cred-card.cred-card-pending:hover{--hover-p:0}
@supports (color:color-mix(in srgb,red 50%,blue)){
  .main-service-card,.cred-card{
    /* pre: 0->1 before the band, flip: 0->1 inside it, post: 0->1 after it */
    --hover-pre:clamp(0,calc(var(--hover-p)/.41),1);
    --hover-flip:clamp(0,calc((var(--hover-p) - .41)*10),1);
    --hover-post:clamp(0,calc((var(--hover-p) - .51)/.49),1)}
  .main-service-card,.main-service-card:hover,.main-service-card:focus-visible{
    background-color:color-mix(in srgb,#2e1f00 calc(var(--hover-p)*100%),#f4f2eb);
    transition:--hover-p var(--card-fade) ease,color var(--card-fade) ease}
  .cred-card,.cred-card:hover,.cred-card:focus-visible{
    background-color:color-mix(in srgb,#2e1f00 calc(var(--hover-p)*100%),#f4f2eb);
    transition:--hover-p var(--card-fade) ease,color var(--card-fade) ease}
  /* The cred card's text sits inside these blocks. Their own colour fade restarted on every
     frame of the card's colour change and trailed it, so the title stayed dark well into the
     dark background. They now take the card's colour as it is. */
  .cred-card>div,.cred-card .cred-card-meta span{
    transition:background-color var(--card-fade) ease,border-color var(--card-fade) ease,opacity var(--card-fade) ease}
  :is(.main-service-card,.cred-card) .rive-icon-overlay:not([data-rive-icon="page-10230"]) canvas{
    filter:brightness(0) invert(calc(.508 - .178*var(--hover-pre) + .52*var(--hover-flip) + .15*var(--hover-post))) sepia(calc(.47 - .47*var(--hover-flip)));transition:none}
}
@media(prefers-reduced-motion:reduce){
  .main-service-card,a.work-card,.cred-card,.accounting-tile,.client-type-card,.industry-related-card,
  .cred-card>div,.cred-card .cred-card-meta span,.work-card .work-meta span,.accounting-tile p,.client-type-card p,
  .main-service-card .circle,.cred-card .circle,.work-card .circle,
  .main-service-card .link-arrow,.cred-card .link-arrow,.work-card .link-arrow,
  .main-service-card .rive-icon-overlay canvas,.cred-card .rive-icon-overlay canvas{transition:none}
}

/* Decorative art (Rive canvases, contour lines) may reach past the page edge; it must not
   give the page a sideways scroll. `clip` keeps position:sticky working. */
html,body{overflow-x:clip}

/* Philosophy hero: the orbit rings come in one after another as the illustration scales in. */
@keyframes orbit-ring-in{from{opacity:0}to{opacity:1}}
.philosophy-orbit.entrance path{opacity:0}
.philosophy-orbit.entrance.is-visible path{opacity:1;animation:orbit-ring-in 1.1s ease backwards}
.philosophy-orbit.entrance.is-visible path:nth-child(1){animation-delay:.1s}
.philosophy-orbit.entrance.is-visible path:nth-child(2){animation-delay:.19s}
.philosophy-orbit.entrance.is-visible path:nth-child(3){animation-delay:.28s}
.philosophy-orbit.entrance.is-visible path:nth-child(4){animation-delay:.37s}
.philosophy-orbit.entrance.is-visible path:nth-child(5){animation-delay:.46s}
.philosophy-orbit.entrance.is-visible path:nth-child(6){animation-delay:.55s}
.philosophy-orbit.entrance.is-visible path:nth-child(7){animation-delay:.64s}
.philosophy-orbit.entrance.is-visible path:nth-child(8){animation-delay:.73s}
.philosophy-orbit.entrance.is-visible path:nth-child(9){animation-delay:.82s}
.philosophy-orbit.entrance.is-visible [data-orbit-dot]{animation-delay:1s}
@media(prefers-reduced-motion:reduce){.philosophy-orbit.entrance.is-visible path{animation:none}}

/* The Rive canvas is larger than its icon; on the last card of a rail it reached past the
   card and added a few pixels of extra sideways scroll after the last step. */
.rail-track>*{overflow:clip}

/* Mobile menu button: the icon stays 24px, the touch target grows to 44px. */
nav .menu::after{content:'';position:absolute;inset:-10px}
/* Home hero fills 95% of the screen, so a strip of the next section shows below it. The copy
   is centred in the space under the nav with the design's slight downward offset: at 800px
   tall it sits exactly where the Figma frame puts it (top 265px). Short screens stop at a
   height the copy still fits in. */
.homepage .main-hero{height:95vh;height:95svh;min-height:560px}
@media(min-width:601px){.homepage .main-hero-copy{top:calc(50% + 54px);transform:translateY(-50%)}}
@media(max-width:600px){.homepage .main-hero{height:95vh;height:95svh;min-height:680px}}

/* ---- Client review (Paul & Andrew), November 2026 ---- */

/* 1. Sticky nav on every page. The bar keeps its place over the top of each page, as before
   (it was positioned absolutely, so nothing below it moves), and takes the page colour with a
   hairline once the page has scrolled. Things that pin while scrolling now pin below it. */
:root{--nav-h:74px}
@media(max-width:600px){:root{--nav-h:56px}}
nav,nav.has-shared-panel{position:fixed;top:0;left:0;right:0;width:auto;z-index:60;transition:background-color .3s ease,box-shadow .3s ease}
nav.is-scrolled{background:var(--paper);box-shadow:0 1px 0 #2e1f0014}
@media(max-width:600px){nav.is-scrolled{box-shadow:none}}
html{scroll-padding-top:calc(var(--nav-h) + 16px)}
.cred-sidebar,.article-toc,.article-share{top:calc(var(--nav-h) + 40px)}
.catalog-index{top:calc(var(--nav-h) - 40px)}
.motion-scroll .wordfield{top:var(--nav-h)}
@media(min-width:601px){.motion-scroll .wordfield{height:calc(100vh - var(--nav-h))}}

/* 2-3. Desktop nav links: a little larger, spread so the group ends about 40% across the page
   (links start after the logo at 265px). Narrower screens keep a 20px minimum gap. */
@media(min-width:901px){
 nav .navlinks,.has-shared-panel .navlinks{flex:0 1 auto;width:calc(40% - 225px);min-width:max-content;justify-content:space-between;gap:20px;font-size:16px}
 nav .navbuttons{margin-left:auto}
}

/* 4. Cred card icons: drawn at the screen's resolution (rive-illustrations.js) and given the
   design's line weight with the same thickening filter the "Faster" icon uses, so the hairline
   strokes stay solid and complete instead of breaking up. */
:is(.work-card,.cred-card,.credential) .rive-icon-overlay:not([data-rive-icon="page-10230"]) canvas{filter:url(#fervent-rive-faster) brightness(0) invert(.508) sepia(.47)}
@supports (color:color-mix(in srgb,red 50%,blue)){
 .cred-card .rive-icon-overlay:not([data-rive-icon="page-10230"]) canvas{
   filter:url(#fervent-rive-faster) brightness(0) invert(calc(.508 - .178*var(--hover-pre) + .52*var(--hover-flip) + .15*var(--hover-post))) sepia(calc(.47 - .47*var(--hover-flip)))}
}

/* 6B. Home, mobile: the icon, title and subtitle of each approach are centred over its
   Fervent / Legacy pair. */
@media(max-width:600px){
 .approach-columns figure{margin-inline:auto;justify-content:center}
 .approach-columns h3,.approach-columns .approach-subtitle{text-align:center}
}

/* 9. Services hero: the rings are drawn whole and sized with the page, right-aligned with the
   content and centred in the space below the nav, so no edge of the drawing is ever visible. */
.all-hero>img{top:calc(50% + var(--nav-h)/2);right:40px;width:auto;height:clamp(260px,29vw,380px);transform:translateY(-50%)}
@media(min-width:1600px){.all-services-page .all-hero>img{right:calc(var(--service-edge) + 40px)}}
@media(max-width:700px){.all-hero>img{opacity:1;top:calc(var(--nav-h) + 20px);right:16px;height:150px;transform:none}}

/* 10. Financial Due Diligence: the Buyside / Sellside divider runs to the end of the longer
   column (the panels' bottom edge), not a fixed 125px short of the section's. */
@media(min-width:1101px){.diligence-sides:after{bottom:88px}}

/* 11. Transaction CFO hero: the art is drawn about 15% smaller, so its hover animation stays
   clear of the grey section below. */
@media(min-width:601px){.service-hero--tcfo>.hero-symbol svg{transform:scale(3.4)}}

/* 12. Transaction CFO: "What is TCFO?" opens the grey section, with a cue to scroll on to the
   word cloud. */
.wordfield-intro{display:flex;flex-direction:column;align-items:center;gap:24px;padding:80px 24px 8px;background:var(--cream);text-align:center}
.wordfield-intro h2{margin:0;color:var(--orange);font-size:56px;line-height:1.1;letter-spacing:-2.8px}
.scroll-cue{display:block;width:28px;height:44px;color:var(--orange);animation:scroll-cue 1.8s cubic-bezier(.45,0,.55,1) infinite}
.scroll-cue svg{display:block}
@keyframes scroll-cue{0%,100%{transform:translateY(0)}50%{transform:translateY(9px)}}
@media(max-width:700px){.wordfield-intro{padding:64px 16px 0;gap:20px}.wordfield-intro h2{font-size:38px;letter-spacing:-1.5px}}
@media(min-width:1600px){.service-detail-page .wordfield-intro{max-width:1512px;margin-inline:auto}}
@media(prefers-reduced-motion:reduce){.scroll-cue{animation:none}}

/* 15. Creds hero: hovering the outlines sends a wave through them from the innermost outward,
   each one swelling from the shared base line and settling back, like the hero art on the other
   pages. It loops while the pointer stays and finishes its last swell when it leaves
   (editorial.js). */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .creds-pattern picture{pointer-events:auto}
 /* The heading's full-width row sits above the outlines; only the heading itself takes the pointer. */
 .creds-page .creds-heading .editorial-wide{pointer-events:none}
 .creds-page .creds-heading .editorial-wide>*{pointer-events:auto}
 .creds-pattern img{transform-origin:50% 100%}
 .creds-pattern img.is-waving{animation:creds-wave 2.4s cubic-bezier(.45,0,.55,1) infinite}
 .creds-pattern picture:nth-child(1) img{animation-delay:0s}
 .creds-pattern picture:nth-child(2) img{animation-delay:.09s}
 .creds-pattern picture:nth-child(3) img{animation-delay:.18s}
 .creds-pattern picture:nth-child(4) img{animation-delay:.27s}
 .creds-pattern picture:nth-child(5) img{animation-delay:.36s}
 .creds-pattern picture:nth-child(6) img{animation-delay:.45s}
 .creds-pattern picture:nth-child(7) img{animation-delay:.54s}
 .creds-pattern picture:nth-child(8) img{animation-delay:.63s}
}
@keyframes creds-wave{0%,100%{transform:scale(1)}45%{transform:scale(1.07)}}

/* 19. Article closing panel without a description line: heading and button sit on one line. */
.qoe-cta-panel:not(:has(.qoe-cta-description)){align-items:center}

/* Blog with only the published articles (placeholders removed): the list no longer holds the
   design's two full rows of cards, so it sizes to its content instead of a fixed 1789px. */
.blog-page .blog-list{min-height:0}

/* Final client feedback (November 2026): bigger CTAs. "Get in touch" sits right after the nav links,
   nearer the middle of the bar, instead of the far right, and stays visible down to 901px now that it
   no longer competes for the right edge. Every hero "Schedule a meeting" is the same orange button. */
nav .navbuttons .button,a.button.hero-cta,.homepage .main-hero-copy>a.button.hero-cta{gap:12px;padding:14px 22px;font-size:14px;line-height:1.4}
nav .navbuttons .button .arrow,a.button.hero-cta .arrow{width:12px;height:8px}
@media(min-width:901px){
 nav .navbuttons{margin-left:0}
 nav .navbuttons .button:first-child{display:inline-flex}
}

/* Feedback round 2 clean-up (19 November 2026). */

/* 1. Home hero lines on phones. What a phone draws is the Rive canvas, not the SVG behind it
   (the SVG only shows with reduced motion or when Rive fails). The Rive lines are hairlines in
   a light ink, and on a phone they all but vanished. The animation stays; the canvas is turned
   to solid ink (brightness), given a little weight (the soft drop-shadow) and then made denser
   by stacking copies of itself (each sharp drop-shadow doubles how solid a faint line is).
   Only CSS filter functions are used here, not an SVG filter, because Safari on iPhone runs
   these on the graphics chip; rive-illustrations.js also draws the phone canvas at no more
   than 2x so the filter has fewer pixels to work on. For lighter lines remove one of the
   sharp drop-shadows or lower the opacity.
   The fallback SVG is darker too (the stroke is set in the two home-*mobile*.svg files) and
   draws a different crop, so it is kept out of sight while Rive starts, as on desktop. */
@media(max-width:600px){
 .homepage .main-hero .rive-home-background{opacity:1;filter:brightness(0) drop-shadow(0 0 .5px #2e1f00) drop-shadow(0 0 0 #2e1f00) drop-shadow(0 0 0 #2e1f00) drop-shadow(0 0 0 #2e1f00) drop-shadow(0 0 0 #2e1f00)}
 html.rive-boot .homepage .main-hero:not(.rive-hero-failed):before{display:none}
}

/* 2-3. "Get in touch" stays in the bar on phones and tablets, next to the menu icon, with the
   menu closed or open (the open menu sits below the bar, so the button stays on top). */
@media(max-width:900px){
 nav .navbuttons{display:flex;margin-left:auto}
 nav .navbuttons>.button:first-child{display:inline-flex;gap:8px;padding:9px 14px;font-size:12px;line-height:1.4;white-space:nowrap}
 nav .navbuttons>.button:first-child .arrow{width:10px;height:7px}
}
@media(max-width:600px){nav .navbuttons{margin-right:16px}}

/* Article byline ("By Andrew Das and Paul Mackey"): one line above the date, in the same
   small type. The article's authors are named in the structured data, so the page shows them. */
.article-hero .article-byline{margin:0 0 6px;font-size:14px;line-height:1.5;letter-spacing:-.28px;font-weight:500}
