/* “AS-IS” Ventures
   Four film frames from New York in 1989, dissolving as you scroll. */

@font-face {
  font-family: "ASIS Movie";
  src: url(/fonts/asis-movie-garamond.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url(/fonts/eb-garamond-medium.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bone: #f3f0e8;
  --dim: #bdbab1;
  --night: #050506;
  --oxblood: #7b1113;

  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --caps: "ASIS Movie", "EB Garamond", Garamond, serif;
}

* { box-sizing: border-box; }

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--bone);
  font: 500 1rem / 1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--oxblood); color: var(--bone); }

:focus-visible { outline: 1px solid var(--bone); outline-offset: 4px; }

h1, p { margin: 0; font-weight: inherit; }

/* ---- The frames ---- */

.frame {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--night);
}
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* A little night at the foot of each frame, for the words to stand on. */
.frame::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 5, 6, 0.72), transparent);
}

/* With script, the frames share one screen and dissolve into each other. */
.js .film { height: 400vh; height: 400svh; }
.js .screen {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.js .frame {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.js .frame:first-child { opacity: 1; }

/* Film grain, moving, over everything. */
.js .screen::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background: url(/textures/grain.webp) 0 0 / 200px;
  animation: grain 0.8s steps(1) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-1%, 3%); }
  80% { transform: translate(4%, -1%); }
}

/* ---- The words ---- */

.line {
  position: absolute;
  z-index: 2;
  inset: auto 0 clamp(3.75rem, 11vh, 6.5rem);
  padding: 0 1.5rem;
  text-align: center;
  font: clamp(1.45rem, 1.05rem + 1.5vw, 2.2rem) / 1.28 var(--caps);
  letter-spacing: 0.012em;
  text-shadow: 0 1px 22px rgba(5, 5, 6, 0.9);
}

.cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.1rem;
  width: 1px;
  height: 2.1rem;
  background: var(--bone);
  transform-origin: top;
  animation: cue 2.8s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0.8; }
  55% { transform: scaleY(1); opacity: 0.8; }
  100% { transform: scaleY(1) translateY(1.2rem); opacity: 0; }
}
.is-moving .cue { opacity: 0; animation: none; }
html:not(.js) .cue { display: none; }

.mail {
  position: absolute;
  z-index: 2;
  inset: auto 0 clamp(6.3rem, 13vh, 7rem);
  padding: 0 1.25rem;
  text-align: center;
  font: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem) / 1.3 var(--caps);
  letter-spacing: 0.012em;
  text-shadow: 0 1px 22px rgba(5, 5, 6, 0.9);
}
.mail a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 240, 232, 0.4);
  overflow-wrap: anywhere;
}
.mail a:hover { border-bottom-color: var(--bone); }

.legal {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.25rem 0.8rem;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.4;
  text-wrap: balance;
  color: var(--dim);
  text-shadow: 0 1px 6px rgba(5, 5, 6, 0.9);
}

/* The page that is not there. */
.back {
  position: absolute;
  z-index: 2;
  inset: auto 0 clamp(2.6rem, 6.5vh, 3.6rem);
  text-align: center;
  font: 1.1rem / 1.3 var(--caps);
}
.back a { color: var(--bone); text-decoration: none; border-bottom: 1px solid rgba(243, 240, 232, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .js .screen::after,
  .cue { animation: none; }
}
