/* Page chrome shared by the home page and the case study pages: nav, client logos, the closing panel,
   the footer, the fade-up reveal and the review marks. Loads after system.css. */
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

/* Nav: 3 columns. The mark on the left, the page links as plain text in the centre, the call button on the right.
   The glass pill forms only once the page scrolls. */
.nav { position: sticky; top: 14px; z-index: 20; margin-top: 14px; }
.nav-bar { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 58px; padding: 0 8px; border-radius: var(--r-pill); }
.nav-bar::before, .nav-bar::after { opacity: 0; transition: opacity .5s var(--ease), transform .7s var(--ease); }
.nav-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; transform: scale(.97);
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-lift); }
.nav.scrolled .nav-bar::before, .nav.scrolled .nav-bar::after { opacity: 1; transform: none; }
@media (prefers-reduced-transparency: reduce) { .nav-bar::before { background: rgb(253 252 249 / 97%); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.nav-bar > .brand { grid-column: 1; justify-self: start; margin-left: 12px; }
.nav-bar > .btn { grid-column: 3; justify-self: end; }
.nav-mid { grid-column: 2; display: flex; gap: var(--space-2); }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: var(--type-button-sm); letter-spacing: -0.005em; color: var(--ink-2); text-decoration: none; transition: color var(--dur-fast); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
/* Below 560 px the centre has no room between the wordmark and the button: the phone nav stays the mark and the
   button, as Tim set it, and Resources is in the footer */
@media (max-width: 560px) { .nav-mid { display: none; } }

/* A client logo, drawn in the text colour from its file as a mask */
.logo { display: block; height: var(--h, 20px); aspect-ratio: var(--ar); background-color: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }

/* Closing (partials/closing.html): the page's 1 Forest panel, the brand mark's rings large behind the headline,
   and a light button. Nothing else (Tim) */
.closing { position: relative; isolation: isolate; overflow: hidden; margin-top: var(--section); border-radius: var(--r-panel); padding: 128px var(--space-5); text-align: center; background: var(--forest); color: var(--on-forest); }
.closing::before { content: ""; position: absolute; left: 50%; top: 42%; z-index: -1; width: max(1100px, 140%); aspect-ratio: 1; transform: translate(-50%, -50%); background: url("/img/rings.svg") center / contain no-repeat; opacity: .85; }
.closing h2 { max-width: 12em; margin: 0 auto; font: var(--type-display-1); letter-spacing: var(--track-display-1); }
.closing .ctas { margin-top: var(--space-7); display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* Video: 16:9 in a Linen panel. A file plays in place; an embed waits behind a play button until clicked */
.player { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-panel); background: var(--linen) var(--poster, none) center / cover no-repeat; }
.player video, .player iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--ink); }
.player.still { display: grid; place-items: center; }
.player .overlay { display: none; position: absolute; inset: 0; }
.js .player .overlay { display: grid; }
.js .player.playing .overlay { display: none; }
.player .facade { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.play { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-pill); background: var(--white); color: var(--forest); box-shadow: 0 10px 30px -12px rgb(var(--shade) / 30%); transition: transform var(--dur-fast) var(--ease); }
.play svg { width: 20px; height: 20px; margin-left: 3px; }
.facade:hover .play { transform: scale(1.06); }
.case-video { margin: 0; }
.case-video figcaption { margin-top: var(--space-3); font: var(--type-small); color: var(--muted); }
.player.has-poster .play { background: rgb(255 255 255 / 92%); }

.wordmark { display: inline-block; font: var(--type-wordmark); letter-spacing: var(--track-wordmark); }
.ph { padding: 0 5px; border-radius: 4px; background: var(--sage); color: var(--forest); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* A client name when there is no logo file */

/* Booking loader (booking.js): the brand mark's rings pulse on Paper while Cal.com's calendar loads */
.booking-loader { position: fixed; inset: 0; z-index: 2147483647; display: grid; place-items: center; background: rgb(253 252 249 / 94%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .35s var(--ease); }
.booking-loader.on { opacity: 1; }
.booking-mark { position: relative; width: 84px; height: 84px; }
.booking-mark .dot { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--sage-dark); }
.booking-mark .ring { position: absolute; inset: 0; border-radius: var(--r-pill); border: 3px solid var(--sage-deep); filter: blur(.6px); animation: booking-ring 1.6s var(--ease) infinite; }
.booking-mark .ring + .ring { animation-delay: .8s; }
@keyframes booking-ring { from { transform: scale(.3); opacity: .95; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .booking-mark .ring { animation: none; opacity: .5; } .booking-mark .ring + .ring { transform: scale(.66); } }

/* Footer */
footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); padding: 36px 0 var(--space-7); font: var(--type-small); color: var(--muted); }
.foot-brand { display: inline-flex; align-items: center; gap: 14px; }
.foot-brand .brand-name { font-size: 16px; color: var(--ink); }
.foot-brand .brand-mark { --mark: 26px; }
footer nav { display: flex; gap: var(--space-5); }
footer a { text-decoration: none; }
/* Tap areas of 44 px on small links, without moving them */
footer nav a { padding: 12px 4px; margin: -12px -4px; }
footer a:hover { color: var(--ink); }

/* Reveal: fade up once on entering the screen */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform var(--dur-slow) var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .player { border-radius: var(--r-card); }
  .play { width: 60px; height: 60px; }
  .nav-bar { height: 54px; }
  .nav-bar > .brand { margin-left: 8px; }
  .logo { height: calc(var(--h, 20px) * 0.86); }
  .closing { padding: 80px 20px; border-radius: 20px; }
}

/* Review marks: hidden unless ?review */
/* Pending items hide outside review mode; the selector outranks any layout rule that sets display */
html:not(.review) .pending, html:not(.review) .review-bar { display: none; }
.review .review-bar { display: block; background: var(--sage); color: var(--forest); font-size: 13px; line-height: 1.5; padding: 10px 24px; text-align: center; }
.review [data-d] { background: rgb(225 234 219 / 70%); border-radius: 4px; box-shadow: 0 0 0 3px rgb(225 234 219 / 70%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.review .closing [data-d] { background: rgb(225 234 219 / 14%); box-shadow: 0 0 0 3px rgb(225 234 219 / 14%); }
.review [data-d]::after { content: attr(data-d); display: inline-block; justify-self: start; align-self: start; width: max-content; max-width: 100%; margin-left: 8px; padding: 0 7px; font: 500 10px/1.7 var(--sans); letter-spacing: 0.04em; color: var(--sage); background: var(--forest); border-radius: 999px; vertical-align: 2px; white-space: nowrap; font-style: normal; }
