/* ==========================================================
   Lemba Studio: teaser page
   Palette: wall #000, paper #fff, smoke #cfcfcf, ash #8f8f8f
   ========================================================== */

:root {
  --wall: #000;
  --paper: #fff;
  --ink: #000;
  --smoke: #cfcfcf;
  --ash: #8f8f8f;

  --graffiti: "Rubik Spray Paint", "Sedgwick Ave Display", "Permanent Marker", Impact, "Arial Black", sans-serif;
  --marker: "Permanent Marker", "Sedgwick Ave Display", Impact, "Arial Black", sans-serif;

  /* Grainy noise, drawn inline so there are no extra files */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  /* Set by script.js while the sheet moves */
  --shift-x: 0;
  --shift-y: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.10), transparent 60%),
    var(--wall);
  color: var(--ink);
}

/* Grain over the whole wall */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background-image: var(--grain);
  opacity: .16;
  mix-blend-mode: overlay;
}

.defs { position: absolute; width: 0; height: 0; }

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vh, 4rem) clamp(1rem, 4vw, 3rem);
}

/* ---------- The sheet ---------- */

.sheet {
  position: relative;
  width: min(100%, 1060px);
  transform: rotate(-1.6deg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Posters pasted underneath: they slide a little against the top one */
.under {
  position: absolute;
  z-index: 0;
  overflow: hidden;
  transition: translate .5s cubic-bezier(.2, .7, .2, 1);
}

.under--a {
  inset: 2% -2.5% -3.5% 3.5%;
  background:
    radial-gradient(circle at 1px 1px, rgba(0,0,0,.55) 1.1px, transparent 1.6px) 0 0 / 9px 9px,
    var(--smoke);
  rotate: 2.6deg;
  translate: calc(var(--shift-x) * -10px) calc(var(--shift-y) * -8px);
}

.under--b {
  inset: -3.5% 7% 6% -3%;
  background:
    repeating-linear-gradient(-45deg, var(--ash) 0 14px, #b8b8b8 14px 28px);
  rotate: -3.2deg;
  translate: calc(var(--shift-x) * 12px) calc(var(--shift-y) * 10px);
}

/* The "?" you glimpse when the corner lifts */
.mark {
  position: absolute;
  right: 2%;
  bottom: -9%;
  font-family: var(--graffiti);
  font-size: clamp(9rem, 28vw, 24rem);
  line-height: 1;
  color: var(--ink);
  user-select: none;
}

/* ---------- The poster on top ---------- */

.poster {
  position: relative;
  z-index: 1;
  padding: clamp(2.2rem, 7vw, 5.5rem) clamp(1.4rem, 5vw, 4.5rem) clamp(2rem, 5.5vw, 4rem);
  background: var(--paper);
  /* torn outline + peeled corner, written by script.js */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Paper fibre + a few creases */
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 31%, rgba(0,0,0,.07) 31.3%, transparent 32.2%),
    linear-gradient(172deg, transparent 58%, rgba(0,0,0,.06) 58.3%, transparent 59.1%),
    radial-gradient(ellipse at 18% 12%, rgba(0,0,0,.05), transparent 45%),
    var(--grain);
  background-blend-mode: normal, normal, normal, multiply;
  opacity: .9;
  mix-blend-mode: multiply;
}

/* ---------- The name ---------- */

.name {
  position: relative;
  margin: 0;
  font-family: var(--graffiti);
  font-weight: 400;
  font-size: clamp(3.6rem, 16.5vw, 13.5rem);
  line-height: .86;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: .035em .035em 0 var(--smoke);
  filter: url(#rough);
}

.word { display: block; }
.word--one { transform: rotate(-2.5deg); transform-origin: left bottom; }
.word--two { transform: translateX(7%) rotate(1.8deg); transform-origin: left top; }

/* Slow paint drips off the bottom of the lettering */
.drip {
  position: absolute;
  z-index: 1;
  width: clamp(.45rem, 1.1vw, .8rem);
  height: 0;
  border-radius: 0 0 999px 999px;
  background: var(--ink);
  animation: drip 9s cubic-bezier(.45, 0, .2, 1) infinite;
}
.drip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -.28em;
  width: 160%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--ink);
}
.drip--1 { left: 17%; top: 66%; animation-delay: 1.2s; }
.drip--2 { left: 52%; top: 64%; animation-delay: 3.4s; --reach: 3.4rem; }
.drip--3 { left: 83%; top: 67%; animation-delay: 5.6s; --reach: 1.8rem; }

@keyframes drip {
  0%        { height: 0; opacity: 0; }
  8%        { opacity: 1; }
  60%, 90%  { height: var(--reach, 2.6rem); opacity: 1; }
  100%      { height: var(--reach, 2.6rem); opacity: 0; }
}

/* ---------- Teaser line ---------- */

.tease {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin: clamp(2.8rem, 6vw, 4.6rem) 0 0 clamp(0rem, 3vw, 2rem);
  padding: .5em 1.1em .55em;
  font-family: var(--marker);
  font-size: clamp(1.15rem, 3vw, 2rem);
  letter-spacing: .06em;
  color: var(--paper);
  background: var(--ink);
  rotate: 1.8deg;
  clip-path: polygon(0 8%, 6% 0, 31% 5%, 58% 0, 83% 6%, 100% 0, 98% 52%, 100% 100%, 72% 94%, 44% 100%, 19% 95%, 0 100%, 2% 48%);
}

.dots i {
  font-style: normal;
  opacity: .15;
  animation: blink 1.8s infinite;
}
.dots i:nth-child(2) { animation-delay: .3s; }
.dots i:nth-child(3) { animation-delay: .6s; }

@keyframes blink {
  0%, 15%  { opacity: .15; }
  30%, 70% { opacity: 1; }
  100%     { opacity: .15; }
}

/* ---------- The curling corner ---------- */

.flap {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  /* casts a shadow up and left onto the poster */
  filter: drop-shadow(-7px -7px 9px rgba(0,0,0,.5));
}

.flap__paper {
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background:
    var(--grain),
    linear-gradient(135deg, #fafafa 0%, #dcdcdc 52%, #9d9d9d 100%);
  background-blend-mode: multiply, normal;
}

/* ---------- Tape ---------- */

.tape {
  position: absolute;
  z-index: 3;
  width: clamp(4.2rem, 11vw, 8rem);
  height: clamp(1.4rem, 3.4vw, 2.3rem);
  background: rgba(214, 214, 214, .82);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  clip-path: polygon(0 0, 4% 30%, 0 60%, 3% 100%, 100% 100%, 96% 65%, 100% 35%, 97% 0);
}
.tape--l { top: -.9rem; left: 5%;  rotate: -14deg; }
.tape--r { top: -.7rem; right: 8%; rotate: 9deg; }

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  .word--two { transform: translateX(3%) rotate(1.8deg); }
  .tease { margin-left: 0; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .drip { animation: none; height: var(--reach, 2.2rem); opacity: 1; }
  .dots i { animation: none; opacity: 1; }
  .under { transition: none; }
}
