@font-face {
  font-family: Fragment;
  src: url("assets/FragmentMono-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url("assets/Newsreader-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: Fragment, ui-monospace, monospace;
  color: #f2ead4;
  background: #101919;
  --gutter: clamp(22px, 5vw, 84px);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .25em; }
a:focus-visible { outline: 2px solid #9de9bc; outline-offset: 4px; }
nav { display: flex; flex-wrap: wrap; gap: 0 1.8rem; }
nav a { font-size: .78rem; padding: .9rem 0; }
footer { padding: .15rem var(--gutter) max(.15rem, env(safe-area-inset-bottom)); }
.landing { min-height: 100svh; display: flex; flex-direction: column; }
.print { --crop-x: .5; --crop-y: .3; position: relative; isolation: isolate; flex: 1; min-height: 28rem; display: flex; align-items: end; }
.print picture { position: absolute; z-index: -2; inset: 0; }
.landscape { display: block; height: 100%; width: 100%; object-fit: cover; object-position: calc(100% * var(--crop-x)) calc(100% * var(--crop-y)); }
/* Keep the paper grain fine at every screen size, independent of the image crop. */
.print::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url("assets/print-grain.png") repeat 0 0 / 72px 72px; }
.print::after { content: ""; position: absolute; inset: 55% 0 0; z-index: -1; background: linear-gradient(transparent, #101919e8); }
.caption { padding: 3rem var(--gutter) clamp(1.5rem, 4vh, 3.5rem); }
.caption h1 { margin: 0; font: 400 clamp(1.05rem, 1.8vw, 1.7rem)/1.4 Fragment, monospace; }
.caption p { margin: .32em 0 0; font: italic 300 clamp(2.4rem, 5.5vw, 6.4rem)/1 Newsreader, Georgia, serif; }
.legal { max-width: 52rem; padding: 0 var(--gutter) 4rem; margin: auto; }
.legal header { padding: 1.5rem 0; }
.legal main { margin: clamp(2rem, 7vh, 6rem) 0 3rem; }
.legal h1 { font: italic 300 clamp(3rem, 9vw, 5rem)/1 Newsreader, Georgia, serif; margin: 0 0 1.8rem; }
.legal h2 { margin: 1.75rem 0 .3rem; font: 400 1.1rem/1.4 Fragment, monospace; color: #add9bd; }
.legal p { font: 400 1rem/1.65 system-ui, sans-serif; max-width: 60ch; }
.legal footer { padding: 0; }
@media (max-aspect-ratio: 1/1) {
  .print { --crop-x: .43; --crop-y: .5; }
}
@media (max-width: 680px) and (max-aspect-ratio: 3/4) {
  .print { --crop-x: .5; --crop-y: .46; }
}
@media (min-aspect-ratio: 2/1) {
  .print { --crop-y: .12; }
}

/* The print remains the complete still scene when motion is disabled. */
.tide { display: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (width: 1cqw) and (mask-image: linear-gradient(black, transparent)) {
    .tide {
      display: block;
      position: absolute;
      inset: 0;
      z-index: -2;
      pointer-events: none;
      overflow: hidden;
      container-type: size;
    }
    /* Register the water layers to the same cover crop as the responsive print. */
    .tide-sheet {
      position: absolute;
      width: max(100cqw, 143.2168cqh);
      aspect-ratio: 1024 / 715;
      left: calc(100% * var(--crop-x));
      top: calc(100% * var(--crop-y));
      transform: translate(calc(-100% * var(--crop-x)), calc(-100% * var(--crop-y)));
    }
    /* Two slices of the original sea print share one image. The wide plate
       leaves a window for the submerged wireframe between the moving swells. */
    .sea-swell {
      position: absolute;
      inset: 67.6% 0 auto;
      height: 17.4%;
      --wave-print: url("assets/skellig-swell-wide.webp");
      mask-image: linear-gradient(to right, black 18%, transparent 24%, transparent 65%, black 71%);
    }
    .sea-swell::before,
    .sea-swell::after {
      content: "";
      position: absolute;
      left: -7%;
      width: 114%;
      height: 50%;
      background: var(--wave-print) center top / 100% 200% no-repeat;
      animation: sea-roll 8s ease-in-out -3s infinite alternate;
    }
    .sea-swell::after {
      top: 50%;
      background-position: center bottom;
      animation-duration: 6.5s;
      animation-delay: -4.8s;
    }
    .water-light {
      position: absolute;
      left: 30.078%; top: 50.49%; width: 29.688%; height: 31.993%;
      mask: url("assets/skellig-light-wide.png") center / 100% 100% no-repeat;
    }
    .water-light::after {
      content: "";
      display: block;
      width: 72%;
      height: 100%;
      background: linear-gradient(106deg, transparent 3%, rgb(162 249 208 / .5) 30%, #c4ffdf 52%, rgb(162 249 208 / .5) 70%, transparent 97%);
      animation: skellig-tide 6s ease-in-out -2.4s infinite alternate;
    }
    /* The fifth, faintest dash of the sun's reflection. */
    .tide-sheet::after {
      content: "";
      position: absolute;
      left: 72.3%; top: 64.6%; width: 6.9%; height: .41%;
      border-radius: 50%;
      background: #edc89a;
      animation: ripple 4.5s ease-in-out -1.3s infinite alternate;
    }
    @media (max-width: 680px) and (max-aspect-ratio: 3/4) {
      .tide-sheet { width: max(100cqw, 50cqh); aspect-ratio: 1 / 2; }
      .sea-swell {
        top: 68.2%; height: 17.6%;
        --wave-print: url("assets/skellig-swell-phone.webp");
        mask-image: none;
      }
      .tide-sheet::after { left: 88.6%; top: 53.8%; width: 8.7%; height: .27%; }
      .water-light {
        left: 1.701%; top: 47.619%; width: 81.293%; height: 21.088%;
        mask-image: url("assets/skellig-light-phone.png");
      }
    }
  }
}
@keyframes skellig-tide {
  from { transform: translateX(-35%); }
  to { transform: translateX(90%); }
}

@keyframes ripple {
  from { opacity: .18; transform: translate(-12%, -1px) scaleX(.48); }
  to { opacity: .82; transform: translate(7%, 2px) scaleX(1.08); }
}

@keyframes sea-roll {
  from { transform: translate(-5%, -5%); }
  to { transform: translate(5%, 5%); }
}
