/* Services page: the SP_Web_1 sheet's services, one section each, with a drawn illustration.
   Loaded after css/site.css, which holds the banner, reveals and footer. */

:root {
  --svs-tint: rgba(79, 90, 58, .1);
  --svs-tint-2: rgba(79, 90, 58, .2);
  --svs-tint-3: rgba(79, 90, 58, .3);
  --svs-grid: rgba(46, 37, 33, .045);
}

/* ---------- One section per service ---------- */
.svs {
  padding: clamp(64px, 8vw, 128px) 0;
  background: var(--paper);
  scroll-margin-top: var(--header-h);
}
.svs--flip { background: var(--plaster); }

.svs-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  align-items: center;
}
.svs-art { grid-column: 1 / 8; }
.svs-copy { grid-column: 9 / 13; }
.svs--flip .svs-art { grid-column: 6 / 13; order: 2; }
.svs--flip .svs-copy { grid-column: 1 / 5; order: 1; }

/* The illustration sits on a drawing board: a soft panel with a faint grid */
.svs-art {
  margin: 0;
  padding: clamp(16px, 2.6vw, 40px);
  aspect-ratio: 6 / 5;
  border-radius: 4px;
  background:
    linear-gradient(var(--svs-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--svs-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--plaster);
}
.svs--flip .svs-art {
  background:
    linear-gradient(var(--svs-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--svs-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
}
.svs-art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Number, name and description */
.svs-num {
  margin: 0 0 -.12em;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(5rem, 9vw, 9.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(79, 90, 58, .55);
  font-variant-numeric: lining-nums;
}
.svs-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.125rem, 2.4vw + 1rem, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.svs-text {
  position: relative;
  margin: clamp(24px, 2.4vw, 34px) 0 0;
  padding-top: clamp(20px, 2vw, 26px);
  max-width: 26rem;
  font-size: clamp(1.0625rem, .3vw + 1rem, 1.25rem);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.svs-text::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 2px;
  background: var(--olive);
}

/* ---------- Illustration colours ---------- */
.svs-art svg * { fill: none; stroke: none; stroke-linecap: round; stroke-linejoin: round; }
.svs-art .k { stroke: var(--ink); stroke-width: 1.5; }
.svs-art .o { stroke: var(--olive); stroke-width: 1.6; }
.svs-art .g { stroke: var(--stone); stroke-width: .9; opacity: .75; }
.svs-art .s { stroke: var(--stone); stroke-width: 1.1; stroke-dasharray: 5 6; opacity: .8; }
.svs-art .dash { stroke-dasharray: 6 7; }
.svs-art .thick { stroke-width: 2.6; }
.svs-art .bold { stroke-width: 3.2; }
.svs-art .wall { stroke-width: 5; stroke-linecap: square; }
.svs-art .w1 { fill: #fff; }
.svs-art .w2 { fill: #ebe6df; }
.svs-art .w3 { fill: #d8cfc3; }
.svs-art .t { fill: var(--svs-tint); }
.svs-art .t2 { fill: var(--svs-tint-2); }
.svs-art .of { fill: var(--svs-tint-3); }
.svs-art .ink { fill: var(--ink); }
.svs-art .dot { fill: var(--stone); opacity: .55; }
.svs-art .water { fill: rgba(79, 90, 58, .32); }
.svs-art .dotted { stroke: var(--olive); stroke-width: 6; }
.svs-art .pipe-o { stroke: var(--ink); stroke-width: 10; }
.svs-art .pipe-i { stroke: #fff; stroke-width: 6.5; }
.svs-art .drain { stroke: var(--olive); stroke-width: 6; stroke-dasharray: 14 9; stroke-linecap: butt; opacity: .8; }

/* The drawing wipes in from the left as the section arrives */
.js .svs-art svg {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.8s var(--ease-out) .2s;
}
.svs-art.is-in svg { clip-path: inset(0 0 0 0); }

@media (hover: hover) {
  .svs-art svg { transition: clip-path 1.8s var(--ease-out) .2s, transform .9s var(--ease-out); }
  .svs-art:hover svg { transform: scale(1.025); }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {

  .svs-art,
  .svs-copy,
  .svs--flip .svs-art,
  .svs--flip .svs-copy { grid-column: 1 / -1; order: 0; }
  .svs-copy { margin-top: clamp(28px, 5vw, 44px); }
  .svs-num { font-size: clamp(4rem, 16vw, 6rem); }
}

@media (max-width: 560px) {
  .svs-art { aspect-ratio: 1 / 1; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .svs-art svg { clip-path: none; transition: none; }
  .svs-art:hover svg { transform: none; }
}
