/* The People² - home page styles
   Fonts come from CSS/fonts.css (hosted on this site). */

:root {
  --ink: #151515;          /* headings */
  --text: #5e5e5e;         /* body text */
  --label: #6b7882;        /* small capitals labels */
  --panel: #f2f4f5;        /* grey boxes */
  --blue: #74A3C7;         /* brand blue */
  --blue-dark: #3f6f94;
  --ink: #2a2f8f;          /* handwriting on the quote page */
  --hand: Caveat, 'Segoe Print', 'Bradley Hand', cursive;
  --footer: #595959;

  --serif: 'EB Garamond', Garamond, Georgia, serif;
  --sans: Roboto, Arial, sans-serif;

  --gutter: 24px;
  --section-gap: 80px;
}
@media (max-width: 767px) {
  :root { --section-gap: 56px; }
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }          /* the envelope's flight never adds a sideways scrollbar */
body { margin: 0; background: #fff; color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
a { color: var(--blue-dark); }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 3px; }

.wrap { max-width: calc(1112px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.label { font-family: var(--sans); font-size: 16px; font-weight: 400; line-height: 1.4;
  letter-spacing: 2px; text-transform: uppercase; color: var(--label); }

.button { display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
  font-family: var(--sans); font-weight: 500; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  padding: 14px 32px; border: 1px solid var(--blue); }
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* ---------- Header and logo ---------- */
.site-header { display: flex; justify-content: center; padding: 56px var(--gutter) 49px; }   /* 49 + the logo's 7px shadow = 56 */
.logo { display: inline-block; font-family: var(--serif); font-size: 32px; line-height: 1; letter-spacing: 1px;
  color: var(--ink); text-decoration: none; border: 1px solid var(--ink); padding: 8px 16px;
  box-shadow: 7px 7px 0 -1px #fff, 7px 7px 0 0 var(--blue); margin: 0 7px 7px 0; }
@media (max-width: 767px) {
  .site-header { padding-block: 24px 17px; }
  .logo { font-size: 28px; }
}

/* ---------- Opening photo and tagline ---------- */
.hero { display: flex; }
.hero-photo { position: relative; flex: 0 0 65.1%; }
.hero-photo img { width: 100%; }
.hero-text { flex: 1; background: var(--panel); padding: 40px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 16px; }
.hero-text .label { color: #65737d; line-height: 1.25; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: .5px;
  color: var(--ink); text-wrap: balance; }
@media (max-width: 767px) {
  .hero { flex-direction: column; }
  .hero-photo { flex: none; }
  .hero-text { padding: 56px 24px; }
}

/* ---------- Services ---------- */
.services { margin-top: var(--section-gap); }
.services > .label { margin-bottom: 32px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
@media (max-width: 1023px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) {
  .services > .label { margin-bottom: 24px; }
  .cards { grid-template-columns: 1fr; }
}

.card { background: var(--panel); padding-block: 32px; text-align: center; }
.card h3 { display: flex; align-items: center; justify-content: center; min-height: calc(2.6em + 28px);
  padding: 14px 16px; font-family: var(--sans); font-weight: 400; font-size: 22px; line-height: 1.25;
  letter-spacing: 1px; color: #1b1b1b; text-wrap: balance; }
.card img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.card-body { padding: 32px 40px 0; line-height: 1.5; }
.card-body p { margin-bottom: 24px; }
.topics { list-style: none; padding: 0; font-weight: 700; }
.topics li { display: inline; }
.topics li:not(:last-child)::after { content: " · "; font-weight: 400; }

/* ---------- About ---------- */
.about { margin-top: 40px; display: flex; justify-content: center; }
.about-box { width: 760px; max-width: 100%; background: var(--panel); padding: 56px 40px; text-align: center; line-height: 1.5; }
.about-box .label { margin-bottom: 32px; }
.about-box p + p { margin-top: 24px; }
@media (max-width: 767px) {
  .about { margin-top: 48px; }
  .about-box { padding: 40px 24px; }
  .about-box .label { margin-bottom: 24px; }
}

/* ---------- Quote: a sheet of lined paper ---------- */
.quote-band { background: var(--panel); padding-block: 64px; }
.paper {
  --line: 48px;                      /* gap between the ruled lines = one line of writing */
  --margin: 72px;                    /* red margin line */
  position: relative; max-width: 700px; margin: 0 auto;
  padding: 44px 44px 36px calc(var(--margin) + 22px);
  background-color: #fffdf6;
  background-image:
    linear-gradient(90deg, transparent calc(var(--margin) - 1px), rgba(214, 92, 92, .55) calc(var(--margin) - 1px),
                    rgba(214, 92, 92, .55) calc(var(--margin) + 1px), transparent calc(var(--margin) + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), #cbdbe7 calc(var(--line) - 1px) var(--line));
  background-position: 0 0, 0 39px;   /* lines sit just under the writing */
  box-shadow: 0 1px 2px rgba(30, 40, 50, .08), 0 14px 30px rgba(30, 40, 50, .16);
  transform: rotate(-1deg);
}
.paper .ink { font-family: var(--hand); font-weight: 500; color: var(--ink); }
.paper blockquote p { font-size: 38px; line-height: var(--line); }
.quote-name { position: relative; margin-top: var(--line); text-align: right; line-height: var(--line); }
.quote-name .ink { font-size: 32px; }
.quote-flourish { display: block; width: 150px; height: 14px; margin: -10px 0 0 auto; overflow: visible; }
.quote-flourish path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: .75; }
@media (max-width: 767px) {
  .quote-band { padding-block: 48px; }
  .paper { --line: 40px; --margin: 34px; padding: 32px 20px 28px calc(var(--margin) + 14px);
           background-position: 0 0, 0 27px; transform: rotate(-.6deg); }
  .paper blockquote p { font-size: 30px; }
  .quote-name .ink { font-size: 27px; }
  .quote-flourish { width: 120px; }
}

/* ---------- Contact envelope ----------
   Without animation it simply shows open, with the letter out. */
.contact { padding-bottom: 56px; text-align: center; }
.env { position: relative; width: min(460px, 100%); height: 250px; margin: 180px auto 0;
  perspective: 900px; filter: drop-shadow(0 10px 18px rgba(30, 50, 70, .18)); }
.env-back, .env-flap, .env-pocket, .env-letter { position: absolute; }
.env-back { inset: 0; background: #b9cddc; }
.env-pocket { inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(160deg, #e6eef4, #d3e1eb);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env-flap { left: 0; top: 0; width: 100%; height: 58%; z-index: 1; background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transform: rotateX(180deg); }
.env-letter { left: 5%; width: 90%; top: 16px; height: 226px; z-index: 2; background: #fff;
  border: 1px solid #e3e8ec; padding: 24px 22px 0; transform: translateY(-190px); }
.env-letter p { margin-bottom: 18px; line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 56px; }
.site-footer p { font-size: 12px; line-height: 1.5; letter-spacing: 1px; text-transform: uppercase; color: var(--footer); }
.site-footer a { color: inherit; }
@media (max-width: 767px) { .site-footer { text-align: center; } }


/* =========================================================
   Animations - only switched on by js/home.js, and never for
   visitors who have turned animations off on their device.
   ========================================================= */

/* Service boxes slide in from the left */
.js-slide .card { opacity: 0; transform: translateX(-60px); transition: opacity .7s ease-out, transform .7s ease-out; }
.js-slide .card.in-view { opacity: 1; transform: none; }

/* About Us slides in from the left and settles in the centre */
.js-slide .about-box { opacity: 0; transform: translateX(-40vw);
  transition: opacity .9s ease-out, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js-slide .about-box.in-view { opacity: 1; transform: none; }

/* Quote written letter by letter, as if by hand */
.paper .qw { white-space: nowrap; }
.js-type .paper .qc { opacity: 0; display: inline-block; transform: translateY(2px) scale(.9); filter: blur(1.5px); }
.js-type .paper .qc.on { opacity: 1; transform: none; filter: none;
  transition: opacity .28s ease-out, transform .28s ease-out, filter .28s ease-out; }
.js-type .quote-flourish path { stroke-dasharray: 170; stroke-dashoffset: 170; }
.js-type .quote.done .quote-flourish path { stroke-dashoffset: 0; transition: stroke-dashoffset .7s ease-in-out; }

/* Envelope: 1. fly in from the lower right  2. flap opens  3. letter slides up */
.js-env .env:not(.go) { opacity: 0; }
.js-env .env:not(.go) .env-flap { transform: none; z-index: 4; }
.js-env .env:not(.go) .env-letter { transform: none; }
.js-env .env.go { animation: env-fly 1.2s cubic-bezier(.2, .8, .25, 1) both; }
.js-env .env.go .env-flap { animation: env-flap .55s 1.25s ease-in-out both; }
.js-env .env.go .env-letter { animation: env-letter .8s 1.75s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes env-fly {
  0%   { opacity: 0; transform: translate(55vw, 55vh) rotate(-22deg) scale(.45); }
  15%  { opacity: 1; }
  70%  { transform: translate(-1.5vw, -2vh) rotate(3deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes env-flap {
  0%   { transform: none; z-index: 4; }
  49%  { z-index: 4; }
  50%  { z-index: 1; }
  100% { transform: rotateX(180deg); z-index: 1; }
}
@keyframes env-letter { from { transform: none; } to { transform: translateY(-190px); } }

/* Opening photo: black-and-white copy laid over the photo (the colour spreads through a growing hole) */
.hero-grey { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(1); pointer-events: none; }
