@font-face {
  font-family: Caveat;
  src: url("assets/fonts/caveat-latin.woff") format("woff");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

/* The second sheet moves with normal page scroll over the pinned first sheet. */
.simulator-page {
  position: sticky;
  top: 0;
  z-index: 0;
}
body.expanded .simulator-page { z-index: 2; }
body.expanded .services-sheet { visibility: hidden; }
.simulator-page #scene-canvas, .simulator-page #skate-canvas { touch-action: pan-y pinch-zoom; }
.simulator-page .site-name { min-width: 0; }

.services-jump {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-height: 44px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-color: #afcbea;
}
.services-jump span { font-size: 1.3em; }

.services-sheet {
  --paper-grid: clamp(19px, 2.5vw, 31px);
  --paper-margin: max(7%, calc((100% - 1000px) / 2));
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(min-content, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(22px, 4vh, 48px) max(7vw, calc((100vw - 1200px) / 2));
  color: #153779;
  background-color: #faf7e9;
  background-image:
    linear-gradient(90deg, transparent calc(var(--paper-margin) - 1px), #cc656b9c var(--paper-margin), transparent calc(var(--paper-margin) + 1px)),
    linear-gradient(#4a8aba43 1px, transparent 1px),
    linear-gradient(90deg, #4a8aba43 1px, transparent 1px),
    linear-gradient(#4a8aba29 1px, transparent 1px),
    linear-gradient(90deg, #4a8aba29 1px, transparent 1px);
  background-size:
    100% 100%,
    calc(var(--paper-grid) * 5) calc(var(--paper-grid) * 5),
    calc(var(--paper-grid) * 5) calc(var(--paper-grid) * 5),
    var(--paper-grid) var(--paper-grid), var(--paper-grid) var(--paper-grid);
  --tear-height: 24px;
  -webkit-mask: url("assets/services-paper-edge.svg") left top / 640px var(--tear-height) repeat-x,
    linear-gradient(#000, #000) left var(--tear-height) / 100% calc(100% - var(--tear-height)) no-repeat;
  mask: url("assets/services-paper-edge.svg") left top / 640px var(--tear-height) repeat-x,
    linear-gradient(#000, #000) left var(--tear-height) / 100% calc(100% - var(--tear-height)) no-repeat;
}
.services-sheet::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0 0 auto;
  height: var(--tear-height);
  background: linear-gradient(#fffdf4e6, #fffdf400);
}
.services-sheet:focus { outline: none; }
.services-writing {
  grid-row: 2;
  justify-self: center;
  width: min(820px, 100%);
  padding-inline-start: clamp(24px, 5vw, 72px);
  font-family: Caveat, "Segoe Print", cursive;
}
.services-footer {
  grid-row: 3;
  place-self: end;
  margin: clamp(16px, 2.5vh, 26px) 0 0;
}
.services-footer::before { content: none; }
.services-footer img {
  display: block;
  width: clamp(85px, 10vw, 140px);
  height: auto;
  filter: brightness(1.06);
  mix-blend-mode: multiply;
}
.services-writing h2 {
  display: table;
  position: relative;
  margin: 0 0 .32em -.08em;
  font: 650 clamp(72px, 8.7vw, 125px)/1 Caveat, "Segoe Print", cursive;
  letter-spacing: -.055em;
  transform: rotate(-3deg);
}
.services-writing h2::after {
  content: "";
  position: absolute;
  left: 0; right: -3%; bottom: -.005em;
  height: .07em;
  border-radius: 80% 25% 65% 30%;
  background: #e14638;
  transform: rotate(-1.2deg);
}
.services-writing ul {
  margin: 0; padding: 0;
  list-style: none;
  font-size: clamp(39px, 4.8vw, 70px);
  line-height: 1.13;
  font-weight: 500;
}
.services-writing li { position: relative; width: fit-content; padding-left: .77em; margin-block: .12em; }
.services-writing li::before {
  content: ""; position: absolute; left: .03em; top: .56em;
  width: .43em; height: .075em;
  border-radius: 95% 35% 90% 40%;
  transform: rotate(-8deg);
  background: currentColor;
}
.services-writing li:nth-child(2n) { transform: rotate(-.9deg); }
.services-writing li:nth-child(2n)::before { transform: rotate(3deg); }

@media (max-width: 760px) {
  .services-sheet { --paper-margin: 7%; padding-inline: 8% 6%; }
  .services-jump { font-size: 13px; gap: .32em; }
}
@media (max-width: 480px) {
  .simulator-page .site-header { gap: 7px; }
  .services-jump { font-size: 12px; }
  .services-writing ul { font-size: clamp(32px, 10.3vw, 42px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .services-sheet {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    column-gap: 16px;
    padding-block: 22px;
  }
  .services-writing { grid-area: 1 / 1; align-self: center; }
  .services-footer { grid-area: 1 / 2; margin: 0; }
  .services-writing h2 { font-size: 56px; }
  .services-writing ul { font-size: 33px; }
}
@media (prefers-reduced-motion: reduce) {
  .simulator-page { position: relative; }
}
