/* Shared by every page: fonts, the motion tokens (PocketCAD's own curves and springs), a reset, and the
   reveal every section uses as it scrolls in. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Mona Sans";
  src: url("/assets/fonts/mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  /* The camera's curve: a gentle start, a long settle (Motion.Camera). */
  --settle: cubic-bezier(0.3, 0.25, 0.1, 1);
  /* Anything going away: quick, accelerating (Motion.leave). */
  --leave: cubic-bezier(0.55, 0, 0.9, 0.4);
  --leave-dur: 140ms;
  /* SwiftUI's springs, sampled (Motion.snap, .panel, .bloom). */
  --snap-dur: 260ms;
  --snap: linear(0, 0.012, 0.043, 0.088, 0.143, 0.203, 0.266, 0.33, 0.393, 0.454, 0.511, 0.566, 0.616, 0.663, 0.705, 0.743, 0.778, 0.808, 0.836, 0.86, 0.881, 0.9, 0.916, 0.93, 0.942, 0.952, 0.961, 0.968, 0.975, 0.98, 0.984, 0.988, 0.991, 0.993, 0.995, 0.997, 1);
  --panel-dur: 485ms;
  --panel: linear(0, 0.022, 0.077, 0.152, 0.239, 0.329, 0.417, 0.502, 0.58, 0.651, 0.713, 0.767, 0.814, 0.853, 0.886, 0.913, 0.935, 0.953, 0.967, 0.978, 0.986, 0.992, 0.997, 1, 1.002, 1.004, 1.005, 1.005, 1.005, 1.005, 1.005, 1.004, 1.004, 1.003, 1.003, 1.002, 1);
  --bloom-dur: 550ms;
  --bloom: linear(0, 0.031, 0.111, 0.219, 0.34, 0.464, 0.581, 0.688, 0.781, 0.859, 0.921, 0.969, 1.004, 1.029, 1.044, 1.052, 1.054, 1.053, 1.049, 1.043, 1.036, 1.03, 1.023, 1.017, 1.012, 1.008, 1.005, 1.002, 1, 0.999, 0.998, 0.997, 0.997, 0.997, 0.997, 0.998, 1);
  /* Seconds between one item and the next in a bloom. */
  --stagger: 22ms;

  --gutter: clamp(20px, 5vw, 48px);
  --measure: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--focus, #2f6bff);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Hidden means hidden, whatever display a component's own rule gives it. */
[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  transition: top 0.2s var(--settle);
}
.skip:focus {
  top: 12px;
}

/* A section's pieces rise into place as they scroll in, one after another. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s var(--settle),
    transform 0.9s var(--settle);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* Words that rise out of their own line, one after another. */
.rise {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.rise > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.05s var(--settle);
  transition-delay: calc(120ms + var(--w, 0) * 70ms);
}
.is-ready .rise > span {
  transform: none;
}
.no-js .rise > span {
  transform: none;
}

/* Pages hand over to one another: a crossfade, and the PocketCAD stage carried across. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: var(--settle);
}
::view-transition-group(pocketcad-stage) {
  animation-duration: 0.66s;
  animation-timing-function: var(--settle);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .rise > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
