/* Ramsey Systems - site styles.
   Sizes and colours follow the old Strikingly site; the few that changed are noted. */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --red: #b42d34;          /* logo red */
  --navy: #013669;         /* logo navy */
  --hero-from: #e14e50;    /* hero gradient, sampled from the old background image */
  --hero-to: #372c82;
  --band: #eeeeee;
  --text: #50555c;
  --ink: #130708;          /* the near-black the old site used for lead text */
  --heading: #333333;
  --muted: #56677a;        /* was #667788: darkened to pass WCAG AA contrast on grey */
  --nav: #5d7085;          /* was #859bb1: darkened to pass WCAG AA contrast on white */
  --role: #4d7c12;         /* was #5e9516: darkened to pass WCAG AA contrast on white */
  --font-heading: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 15px/1.6 var(--font-body);
}

img { max-width: 100%; height: auto; }

a { color: var(--navy); }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  padding: 10px 16px; border-radius: 0 0 8px 8px;
  background: var(--navy); color: #fff; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------------------------------------------------------------- header */

.site-header {
  padding: 18px 16px 6px;
  text-align: center;
  border-bottom: 1px solid #e4e4e4;
}
/* The logo is two layers in one frame: the letters (an image) and the dots
   (inline SVG on top), so the dots can be animated. */
.logo { position: relative; display: block; width: min(72vw, 414px); margin: 0 auto; }
.logo img, .intro-logo img { display: block; width: 100%; height: auto; }
.logo-dots { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.logo-dots circle { transform-box: fill-box; transform-origin: center; }

.site-header ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px;
  margin: 10px 0 0; padding: 0; list-style: none;
}
.site-header nav a {
  position: relative; display: inline-block; padding: 8px 2px 10px;
  color: var(--nav); font: 500 15px/1.2 var(--font-heading);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--navy); }
.site-header nav a[aria-current="page"] { color: var(--navy); }
/* Underlines: a thin grey one grows on hover; the red one marks the current
   page (a real element, so it can glide between pages - see Motion). */
.site-header nav a::after, .nav-marker {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
}
.site-header nav a::after { background: var(--nav); scale: 0 1; transition: scale 0.25s ease; }
.site-header nav a:hover::after { scale: 1 1; }
.nav-marker { z-index: 1; background: var(--red); }

/* ---------------------------------------------------------------- shared blocks */

.band { padding: clamp(56px, 8vw, 96px) 16px; }
.band-grey { background: var(--band); }
.container { max-width: 1000px; margin: 0 auto; }

.ruled {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 0 0 24px;
  color: var(--heading); font: 400 clamp(26px, 3.6vw, 36px)/1.25 var(--font-heading);
  text-align: center; text-wrap: balance;
}
.ruled::before, .ruled::after {
  content: ""; flex: 0 0 clamp(24px, 5vw, 60px); height: 1px; background: currentColor;
}
@media (max-width: 560px) {
  .ruled::before, .ruled::after { display: none; }
}

.button {
  position: relative; overflow: hidden;
  display: inline-block; padding: 13px 22px; border-radius: 999px;
  font: 700 16px/1 var(--font-body); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* A sheen that sweeps across the button on hover. */
.button::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, var(--sheen) 50%, transparent 65%);
  translate: -110% 0;
}
.button:hover::after { translate: 110% 0; transition: translate 0.7s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); }
.button-light { --sheen: rgb(225 78 80 / 0.22); background: #fff; color: rgb(0 0 0 / 0.8); }
.button-dark, .prose .button { --sheen: rgb(255 255 255 / 0.35); background: var(--navy); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
  .button:hover::after { transition: none; translate: -110% 0; }
}

/* ---------------------------------------------------------------- home: hero */

.hero {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  min-height: clamp(360px, 42vw, 640px);
  padding: 64px 16px;
  background: linear-gradient(90deg, var(--hero-from), var(--hero-to));
  color: #fff; text-align: center;
}
/* The logo's whole dot spiral, faint, as a backdrop. */
.hero::after {
  content: ""; position: absolute; inset: 0;
  margin: auto 4vw auto auto;
  width: min(52vw, 720px); aspect-ratio: 2.62;
  background: url("/images/swirl.svg") no-repeat center / contain;
  opacity: 0.09; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  text-wrap: balance;
  max-width: 17em; margin: 0 auto 18px;
  font: 400 clamp(28px, 4.2vw, 45px)/1.25 var(--font-heading);
}
.hero .hero-quote { margin: 0 0 32px; font-size: clamp(16px, 1.8vw, 20px); }
.hero p { margin: 0; }

/* ---------------------------------------------------------------- home: about */

.lead {
  max-width: 1000px; margin: 0 auto 40px;
  color: var(--ink); font-size: clamp(17px, 1.6vw, 20px); text-align: center;
}
.item { max-width: 860px; margin: 0 auto; }
.item h3 {
  margin: 0 0 12px;
  color: var(--muted); font: 400 clamp(18px, 2vw, 24px)/1.3 var(--font-heading);
}
.item-dark { color: var(--ink); }
/* A card's picture: across the top, in a wide 5:2 frame so cards stay tidy whatever the photo's shape. */
.item-image {
  display: block; width: 100%; aspect-ratio: 5 / 2; object-fit: cover;
  margin: 0 0 18px; border-radius: 8px;
}
/* Pictures within the words of a band (added in the admin's editor). */
.lead figure, .item figure { margin: 24px 0; text-align: center; }
.lead figure img, .item figure img { border-radius: 6px; vertical-align: middle; }
.item ul { padding-left: 1.4em; }
.item li + li { margin-top: 2px; }

/* ---------------------------------------------------------------- services */

.service + .service { padding-top: 0; }
.subtitle {
  max-width: 900px; margin: 0 auto 32px;
  color: var(--muted); font-size: 18px; text-align: center;
}
.service .item h3 { font-size: 18px; }
.service .item h3 strong { font-weight: 600; }

/* ---------------------------------------------------------------- team */

.team {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px 28px;
  margin: 40px 0 0; padding: 0; list-style: none; text-align: center;
}
/* The hover lift uses transform; the scroll-in (Motion) uses translate, so they never fight. */
.team > li { transition: transform 0.35s ease; }
.team picture {
  display: block; overflow: hidden; border-radius: 6px;
  box-shadow: 0 10px 30px rgb(1 54 105 / 0.12);
  transition: box-shadow 0.35s ease;
}
.team img {
  display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  transition: scale 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .team > li:hover { transform: translateY(-6px); }
  .team > li:hover picture { box-shadow: 0 18px 40px rgb(1 54 105 / 0.2); }
  .team > li:hover img { scale: 1.04; }
}
.team h2 { margin: 20px 0 6px; color: var(--muted); font: 400 24px/1.3 var(--font-heading); }
.team .role { margin: 0 0 10px; color: var(--role); font-size: 16px; }
.team p { margin-top: 0; }

/* ---------------------------------------------------------------- blog */

.page-banner {
  padding: clamp(48px, 7vw, 88px) 16px;
  background: linear-gradient(90deg, var(--hero-from), var(--hero-to));
  color: #fff; text-align: center;
}
.page-banner h1 {
  text-wrap: balance;
  max-width: 22em; margin: 0 auto;
  font: 400 clamp(28px, 4vw, 42px)/1.25 var(--font-heading);
}
.page-banner-sub { margin: 14px auto 0; font-size: clamp(16px, 1.8vw, 20px); }
.page-banner-meta { margin: 14px 0 0; opacity: 0.85; }

.prose {
  max-width: 760px; margin: 0 auto; padding: 48px 16px 8px;
  color: #333; font-size: 16px; line-height: 1.75;
}
.prose h2 { margin: 44px 0 14px; color: #222; font: 400 28px/1.3 var(--font-heading); }
.prose figure { margin: 32px 0; text-align: center; }
.prose figure img { vertical-align: middle; }
.prose hr { width: 130px; margin: 44px auto; border: 0; border-top: 1px solid #c9c9c9; }
.prose blockquote {
  margin: 28px 0; padding: 2px 0 2px 22px; border-left: 3px solid #555;
  color: #444; font: italic 18px/1.6 Georgia, "Times New Roman", serif;
}
.prose a:not(.button) { text-underline-offset: 2px; }
/* A Text section on a main page: the same column of writing, inside a band, which gives the spacing. */
.text-section .prose { padding: 0; }
.text-section .prose > :first-child { margin-top: 0; }
.text-section .prose > :last-child { margin-bottom: 0; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.small { font-size: 80%; }

.video a { display: block; position: relative; text-decoration: none; }
.video img { display: block; margin: 0 auto; border-radius: 6px; }
.video-label {
  display: inline-block; margin-top: 10px; color: var(--navy); font-weight: 700;
}

.post-footer { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;
}
.post-nav a { color: var(--heading); font: 400 18px/1.35 var(--font-heading); text-decoration: none; }
.post-nav a:hover { color: var(--navy); }
.post-nav span { display: block; margin-bottom: 4px; color: #888; font: 13px var(--font-body); }
.post-nav-next { text-align: right; grid-column: 2; }
.post-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 16px; font-size: 14px;
}
.post-tools > a { color: var(--text); }

.share, .social { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.share a, .social a {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px;
  background: #8a94a0; color: #fff;  /* was #a3abb5: darkened so the icons reach 3:1 contrast */
}
.share a:hover, .social a:hover { background: var(--navy); }
.icon { width: 15px; height: 15px; fill: currentColor; }

.post-list { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.post-list h2 {
  margin: 32px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #ddd;
  color: var(--muted); font: 400 22px var(--font-heading);
}
.post-list ul { margin: 0; padding: 0; list-style: none; }
.post-list li { padding: 14px 0; }
.post-list li a { color: var(--heading); font: 500 18px/1.35 var(--font-heading); text-decoration: none; }
.post-list li a:hover { color: var(--navy); text-decoration: underline; }
.post-list time { display: block; margin-top: 2px; color: #777; font-size: 13px; }
.post-list p { margin: 6px 0 0; }

/* ---------------------------------------------------------------- 404 */

.not-found { text-align: center; min-height: 40vh; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding: 56px 16px 64px;
  background: var(--band); text-align: center;
}
.site-footer .social { justify-content: center; margin-bottom: 18px; }
.site-footer p { margin: 0; }
/* The services page is grey all the way down: keep a visible edge above the footer. */
main:has(> .band-grey:last-child) + .site-footer { border-top: 1px solid #dcdcdc; }

/* ================================================================ Motion
   Every animation here is an extra:
   * people who ask their system to reduce motion get none of it (the blog's
     reading bar stays: it only moves when they scroll);
   * browsers without View Transitions or scroll-driven animations simply
     show the static site. */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.18, 1);
  --swipe: 100%;            /* how far a page travels in the swipe */
  --swipe-time: 0.6s;
}

/* Spiral order of the 11 logo dots (left to right), for staggered timing. */
.logo-dots circle:nth-child(1)  { --i: 0; }
.logo-dots circle:nth-child(2)  { --i: 1; }
.logo-dots circle:nth-child(3)  { --i: 2; }
.logo-dots circle:nth-child(4)  { --i: 3; }
.logo-dots circle:nth-child(5)  { --i: 4; }
.logo-dots circle:nth-child(6)  { --i: 5; }
.logo-dots circle:nth-child(7)  { --i: 6; }
.logo-dots circle:nth-child(8)  { --i: 7; }
.logo-dots circle:nth-child(9)  { --i: 8; }
.logo-dots circle:nth-child(10) { --i: 9; }
.logo-dots circle:nth-child(11) { --i: 10; }

@keyframes rise-in { from { opacity: 0; translate: 0 28px; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ---- 1. Intro: first page of a visit. site.js adds the classes to <html>. */

.intro { display: none; }
html.intro-active body { overflow: hidden; }
html.intro-active .intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: #fff;
  /* Failsafe: if the script dies mid-intro, the curtain still lifts. */
  animation: intro-failsafe 0.4s 4s forwards;
}
.intro-logo { position: relative; width: min(78vw, 600px); }
html.intro-active .intro .logo-dots circle { opacity: 0; }
html.intro-play .intro .logo-dots circle {
  animation: dot-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(150ms + var(--i) * 80ms);   /* keep in step with DOTS_MS in site.js */
}
html.intro-leaving .intro { opacity: 0; transition: opacity 0.45s ease; }

@keyframes dot-pop {
  from { opacity: 0; scale: 0; }
  60%  { opacity: 1; scale: 1.2; }
  to   { opacity: 1; scale: 1; }
}
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }

/* The glide into the header: for one frame each, the big logo and the header
   logo share the name "brand", and the browser morphs one into the other. */
html.intro-morph .intro-logo { view-transition-name: brand; }
html.intro-morph:not(.intro-active) .site-header .logo { view-transition-name: brand; }
/* Nothing else is lifted out during the intro, so the white curtain (part of
   the page snapshot) keeps covering everything until it fades. */
html.intro-morph .site-header,
html.intro-morph main,
html.intro-morph .nav-marker { view-transition-name: none; }
html.intro-morph::view-transition-group(brand) {
  animation-duration: 0.8s; animation-timing-function: var(--ease-in-out);
}
html.intro-morph::view-transition-old(root) { animation: fade-out 0.6s 0.2s ease both; }
html.intro-morph::view-transition-new(root) { animation: fade-in 0.6s 0.2s ease both; }

/* Then the first words on the page rise in. */
html.intro-reveal .hero-inner > *,
html.intro-reveal .page-banner > * { animation: rise-in 0.9s var(--ease-out) 0.3s both; }
html.intro-reveal .hero-inner > :nth-child(2),
html.intro-reveal .page-banner > :nth-child(2) { animation-delay: 0.42s; }
html.intro-reveal .hero-inner > :nth-child(3),
html.intro-reveal .page-banner > :nth-child(3) { animation-delay: 0.54s; }

/* ---- 2. Page swipe between pages (cross-document View Transitions).
   The header stays still, the red menu underline glides to the new page,
   and the content swipes across: left when moving along the menu, right when
   moving back (site.js picks the direction). */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: site-header; }
main { view-transition-name: page; }
.nav-marker { view-transition-name: nav-marker; }

::view-transition-old(page),
::view-transition-new(page) { mix-blend-mode: normal; }
::view-transition-group(page) { animation-duration: var(--swipe-time); }
::view-transition-old(page) { animation: swipe-out var(--swipe-time) var(--ease-in-out) both; }
::view-transition-new(page) { animation: swipe-in var(--swipe-time) var(--ease-in-out) both; }
html:active-view-transition-type(backwards)::view-transition-old(page) { animation-name: swipe-out-back; }
html:active-view-transition-type(backwards)::view-transition-new(page) { animation-name: swipe-in-back; }
::view-transition-group(nav-marker) {
  animation-duration: var(--swipe-time); animation-timing-function: var(--ease-in-out);
}

@keyframes swipe-out      { to   { translate: calc(-1 * var(--swipe)) 0; } }
@keyframes swipe-in       { from { translate: var(--swipe) 0; } }
@keyframes swipe-out-back { to   { translate: var(--swipe) 0; } }
@keyframes swipe-in-back  { from { translate: calc(-1 * var(--swipe)) 0; } }

/* ---- 3. Small touches */

@media (prefers-reduced-motion: no-preference) {
  /* The logo's dots ripple along the spiral on hover. */
  @media (hover: hover) {
    .site-header .logo:hover .logo-dots circle {
      animation: dot-ripple 0.6s ease-in-out both;
      animation-delay: calc(var(--i) * 45ms);
    }
  }

  /* The hero's spiral drifts slowly, and lags behind as you scroll. */
  .hero::after { animation: swirl-drift 18s ease-in-out infinite alternate; }
  @supports (animation-timeline: scroll()) {
    .hero::after {
      animation: swirl-drift 18s ease-in-out infinite alternate, swirl-parallax linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0px 700px;
    }
  }

  /* Content rises in as it scrolls into view; heading rules draw outwards.
     Scroll-driven: the animation is tied to scroll position, not time, so
     anything already on screen when the page opens is simply there. */
  @supports (animation-timeline: view()) {
    .lead p, .item, .subtitle, .team > li, .post-list li,
    .prose figure, .prose blockquote, .post-footer {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
    .ruled { view-timeline: --ruled block; }
    .ruled::before, .ruled::after {
      animation: draw-rule linear both;
      animation-timeline: --ruled;
      animation-range: entry 20% cover 40%;
    }
    .ruled::before { transform-origin: right center; }
    .ruled::after { transform-origin: left center; }
  }
}

@keyframes dot-ripple { 40% { scale: 1.35; } }
@keyframes swirl-drift { from { rotate: -3deg; scale: 1; } to { rotate: 3deg; scale: 1.06; } }
@keyframes swirl-parallax { to { translate: 0 140px; } }
@keyframes draw-rule { from { scale: 0 1; } }

/* ---- 4. Blog: a reading-progress bar along the top, filled by scrolling. */

.reading-progress {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 3px;
  background: linear-gradient(90deg, var(--hero-from), var(--hero-to));
  transform-origin: 0 50%; scale: 0 1; pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .reading-progress { animation: read-progress linear both; animation-timeline: scroll(root); }
}
@supports not (animation-timeline: scroll()) {
  .reading-progress { display: none; }
}
@keyframes read-progress { to { scale: 1 1; } }

@media print {
  .reading-progress { display: none; }
}
