/* Memento landing page
   Three layers per screen: back (texture/colour), middle (giant type, angled bands),
   front (object + calm readable copy). One shared tilt drives every angle. */

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy: #010080;
  --navy-deep: #00004d;
  --off: #f3efe6;
  --orange: #ff4f00;
  --ink: #20242c;
  --tilt: -7deg;
  --untilt: 7deg;
  --display: "Anton", "Bahnschrift Condensed", Impact, "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 76px;
  --tear: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

a { color: inherit; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--orange); color: var(--navy); padding: 10px 14px; font-weight: 800;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Textures ---------- */

.tex-navy {
  background-color: var(--navy);
  background-image:
    url("assets/tex/grain.svg"),
    radial-gradient(ellipse 70% 60% at 25% 15%, rgba(40, 40, 200, 0.55), transparent 70%),
    radial-gradient(ellipse 80% 70% at 85% 105%, rgba(0, 0, 40, 0.75), transparent 70%);
  background-size: 260px 260px, 100% 100%, 100% 100%;
  background-blend-mode: soft-light, normal, normal;
}

.tex-paper {
  background-color: var(--off);
  background-image: url("assets/tex/paper.svg");
  background-size: 640px 640px;
  background-blend-mode: multiply;
}

/* Torn top edge: JS writes the jagged polygon into --torn. */
.torn-top {
  margin-top: calc(var(--tear) * -1);
  clip-path: var(--torn, none);
  position: relative;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 1.5em;
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--orange);
  font: 800 1.0625rem/1 var(--body);
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--navy-deep);
  transition: transform 180ms var(--ease-out);
}
.btn:hover { transform: translate(-2px, -2px); }
.btn:active { transform: translate(2px, 2px); }
.btn-ghost {
  background: transparent; color: var(--off);
  border-color: rgba(243, 239, 230, 0.7);
  box-shadow: none;
}
.btn-ghost:hover { box-shadow: none; border-color: var(--off); }
.btn-small { min-height: 44px; padding: 0 1em; font-size: 1rem; box-shadow: 3px 3px 0 var(--navy-deep); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Nav ---------- */

.nav {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4vw;
  color: var(--off);
}
.nav nav { display: flex; align-items: center; gap: 28px; }
.nav nav a:not(.btn) { text-decoration: none; font-weight: 700; font-size: 1rem; }
.nav nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark rect { fill: var(--off); }
.brand-mark path { fill: var(--navy); }

/* ---------- Shared layer system ---------- */

.layer { position: absolute; inset: 0; }
.back { z-index: 0; }
.mid { z-index: 1; pointer-events: none; }
.front { z-index: 2; pointer-events: none; }
.front > * { pointer-events: auto; }

/* Full-width orange band behind a line of type */
.band { position: relative; color: var(--navy); }
.band::before {
  content: ""; position: absolute; z-index: -1;
  top: 0.04em; bottom: 0.01em; left: -100vw; right: -100vw;
  background: var(--orange);
}

/* Rubber stamp */
.stamp {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  text-transform: uppercase; line-height: 0.92; letter-spacing: 0.02em;
  -webkit-mask-image: url("assets/tex/ink.svg");
  mask-image: url("assets/tex/ink.svg");
  -webkit-mask-size: 300px; mask-size: 300px;
}

/* ---------- 1. Hero ---------- */

.hero {
  position: relative;
  min-height: max(100svh, 700px);
  overflow: hidden;
  isolation: isolate;
  color: var(--off);
}

.halftone {
  position: absolute; inset: -20%;
  background-image: radial-gradient(circle, rgba(243, 239, 230, 0.2) 0 1.4px, transparent 1.9px);
  background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 85%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 85%);
  transform: rotate(var(--tilt));
}

.hero-title {
  position: absolute;
  left: 3vw;
  top: calc(var(--nav-h) + 8svh);
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4.5rem, min(11.2vw, 18svh), 16rem);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  transform: rotate(var(--tilt));
  transform-origin: 0 50%;
  white-space: nowrap;
}
.hero-title .line { display: block; }
.outline, .hero-title .outline {
  color: transparent;
  -webkit-text-stroke: max(2px, 0.012em) var(--off);
}
.hero-title .l3 { padding-left: 0.04em; }

/* The front card plays while the deck is visible. */
.stack {
  position: relative;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.hero .stack {
  --cw: min(23vw, 40vh, 360px);
  position: absolute;
  right: 9vw;
  top: calc(50% + 5vh);
  transform: translateY(-50%);
}

.card {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  width: 100%; height: 100%;
  padding: calc(var(--cw) * 0.13) calc(var(--cw) * 0.08) 0;
  border: 1px solid rgba(0, 0, 50, 0.18);
  border-radius: calc(var(--cw) * 0.06);
  background-color: #fbf9f4;
  background-image: url("assets/tex/paper.svg");
  background-size: 400px;
  background-blend-mode: multiply;
  box-shadow: 0 14px 28px -8px rgba(0, 0, 30, 0.65);
  color: var(--navy);
  font: inherit; text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 50% 140%;
  translate: var(--drag-x, 0px) 0;
  transition: transform 420ms var(--ease-out), translate 420ms var(--ease-out);
}
.card.is-dragging { transition-property: transform; cursor: grabbing; }
.card video {
  display: block;
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: calc(var(--cw) * 0.012);
  background: #222;
  outline: 1px solid rgba(1, 0, 128, 0.55);
  outline-offset: calc(var(--cw) * 0.012);
  pointer-events: none;
}
/* Gloss across the card face */
.card::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(0, 0, 30, 0.08));
  pointer-events: none;
}
/* Corner indices, like a playing card */
.idx {
  position: absolute;
  top: calc(var(--cw) * 0.022); left: calc(var(--cw) * 0.03);
  width: calc(var(--cw) * 0.08);
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--display);
  font-size: calc(var(--cw) * 0.075);
  line-height: 0.95;
  color: var(--navy);
}
.idx i { font-style: normal; color: var(--orange); font-size: 0.62em; line-height: 1; }
.idx-bot { top: auto; left: auto; bottom: calc(var(--cw) * 0.022); right: calc(var(--cw) * 0.03); transform: rotate(180deg); }
.card .tag {
  position: absolute; left: 8%; right: 14%; bottom: 0;
  height: calc(var(--cw) * 0.22);
  display: flex; align-items: center;
  font: 750 clamp(0.8125rem, calc(var(--cw) * 0.047), 1rem)/1.2 var(--body);
  color: var(--ink);
}
.card:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

/* Slots follow the same order as the previous and next buttons. */
.card[data-slot="0"] { z-index: 6; transform: rotate(var(--tilt)) translateY(-2%) scale(1.06); }
.card[data-slot="1"] { z-index: 5; transform: rotate(7deg) translateX(14%); }
.card[data-slot="2"] { z-index: 4; transform: rotate(18deg) translateX(26%); }
.card[data-slot="3"] { z-index: 3; transform: rotate(28deg) translateX(38%); }
.card[data-slot="4"] { z-index: 2; transform: rotate(-21deg) translateX(-12%); }

.deck-controls {
  position: absolute; z-index: 7;
  left: 50%; top: calc(100% + clamp(6px, calc(var(--cw) * 0.055), 20px));
  transform: translateX(-50%);
  display: flex; align-items: center;
  column-gap: 12px;
  color: var(--off);
}
.deck-controls[hidden] { display: none; }
.deck-controls button {
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  color: var(--off); background: var(--navy-deep);
  border: 1px solid var(--off); border-radius: 50%;
  cursor: pointer;
  transition: transform 180ms var(--ease-out);
}
.deck-controls button:hover { transform: scale(1.08); }
.deck-controls button:active { transform: scale(0.96); }
.deck-controls svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.stamp-hero {
  position: absolute;
  right: 3.5vw;
  top: calc(var(--nav-h) + 4vh);
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
  color: var(--orange);
  background: var(--navy-deep);
  border: 0.14em solid var(--orange);
  padding: 0.35em 0.5em 0.3em;
  transform: rotate(12deg);
  -webkit-mask-image: none;
  mask-image: none;
  z-index: 8;
}

.hero-copy {
  position: absolute;
  left: 4vw;
  bottom: 6vh;
  max-width: 30rem;
}
.lede {
  margin: 0 0 22px;
  font-size: clamp(1.0625rem, 1.25vw, 1.25rem);
  line-height: 1.5;
  font-weight: 650;
  color: var(--off);
  text-wrap: pretty;
}

/* ---------- 2. Split ---------- */

.split {
  position: relative;
  min-height: max(100svh, 780px);
  overflow: hidden;
  isolation: isolate;
  background: var(--navy);
}
.half { position: absolute; inset: 0; overflow: hidden; }
.half-a {
  clip-path: polygon(0 0, calc(50% + 6.2vh) 0, calc(50% - 6.2vh) 100%, 0 100%);
  color: var(--navy);
}
.half-b {
  clip-path: polygon(calc(50% + 6.2vh) 0, 100% 0, 100% 100%, calc(50% - 6.2vh) 100%);
  color: var(--off);
}

.giant {
  position: absolute; z-index: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(5rem, 15vw, 20rem);
  line-height: 0.82;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.25;
  transform: rotate(var(--tilt));
  pointer-events: none;
}
.outline-navy { color: transparent; -webkit-text-stroke: max(2px, 0.01em) var(--navy); }
.outline-light { color: transparent; -webkit-text-stroke: max(2px, 0.01em) rgba(243, 239, 230, 0.85); }
.half-a .giant { left: -1.5vw; bottom: 4vh; }
.half-b .giant { right: -1.5vw; top: 6vh; }

.shopper {
  position: absolute; z-index: 1;
  top: 54%;
  width: min(36vw, 560px);
  transform: translateY(-50%);
}
.half-a .shopper { left: 5vw; }
.half-b .shopper { right: 5vw; }

.who {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
}
.signal { margin: 8px 0 16px; font-size: 1.0625rem; }
.signal b { font-weight: 800; }
.slot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  box-shadow:
    0 2px 2px rgba(0, 0, 20, 0.25),
    0 26px 50px -18px rgba(0, 0, 30, 0.65);
}
.half-a .slot { outline: 2px solid var(--navy); outline-offset: 6px; }
.half-b .slot { outline: 2px solid rgba(243, 239, 230, 0.7); outline-offset: 6px; }
.slot video { width: 100%; height: 100%; object-fit: cover; }
.saw { margin: 18px 0 0; font-weight: 700; font-size: 1.0625rem; }
.half-a .signal, .half-a .saw { color: var(--ink); }

.stamp-seam {
  position: absolute; z-index: 5;
  left: 50%; top: 7vh;
  font-size: clamp(2.2rem, 4.4vw, 4.6rem);
  color: var(--navy);
  background: var(--orange);
  padding: 0.18em 0.38em 0.14em;
  text-align: center;
  transform: translateX(-50%) rotate(var(--tilt));
  box-shadow: 0 20px 40px -18px rgba(0, 0, 20, 0.6);
}
.split-note {
  position: absolute; z-index: 5;
  left: 5vw; bottom: 3.5vh; margin: 0;
  font: 750 1rem/1.4 var(--body);
  color: var(--ink);
}

/* ---------- 3. How it works ---------- */

.how {
  padding: calc(12vh + var(--tear)) 5vw 16vh;
  color: var(--navy);
  overflow: hidden;
}
.section-title {
  margin: 0 0 10vh;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.2rem, 8.5vw, 9.5rem);
  line-height: 0.85;
  text-transform: uppercase;
  transform: rotate(var(--tilt));
  transform-origin: 0 50%;
}
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4vw;
}
.steps li { position: relative; min-height: clamp(260px, 26vw, 420px); }
.numeral {
  position: absolute; z-index: 0; top: -4vw; left: -1vw;
  font-family: var(--display);
  font-size: clamp(12rem, 25vw, 26rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 2px var(--navy);
  transform: rotate(var(--tilt));
  pointer-events: none;
}
.steps li:nth-child(2) .numeral { color: var(--orange); -webkit-text-stroke: 0; }
.step-text {
  position: relative; z-index: 1;
  margin-left: 34%;
  padding-top: clamp(110px, 11vw, 190px);
  max-width: 22rem;
}
.step-text h3 {
  margin: 0 0 10px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.7rem, 2.3vw, 2.4rem);
  line-height: 1;
  text-transform: uppercase;
}
.step-text p { margin: 0; color: var(--ink); }

/* ---------- 4. Benefit bands ---------- */

.bands {
  position: relative;
  overflow: hidden;
  padding: 11vw 0 13vw;
  background: var(--navy-deep);
}
.band-row {
  position: relative;
  width: 130%; margin: -1.4vw 0 0 -15%;
  padding: 3.4vw 19%;
  display: flex; align-items: center; justify-content: space-between; gap: 4vw;
  transform: rotate(var(--tilt));
  clip-path: var(--torn, none);
}
.band-row:first-child { margin-top: 0; }
.band-row:nth-child(even) { flex-direction: row-reverse; }
.band-word {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.4rem, 9.5vw, 11rem);
  line-height: 0.86;
  text-transform: uppercase;
  white-space: nowrap;
}
.band-row p {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.0625rem, 1.3vw, 1.3rem);
  line-height: 1.45;
  font-weight: 600;
  transform: rotate(var(--untilt));
}
.b-orange { background: var(--orange); color: var(--navy); }
.b-navy { color: var(--off); }
.b-navy .band-word { color: var(--orange); }
.b-paper { color: var(--navy); }
.b-orange p, .b-paper p { color: var(--ink); }

/* ---------- 5. Final ---------- */

.final {
  min-height: max(92svh, 640px);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  color: var(--off);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(12vh + var(--tear)) 5vw 12vh;
}
.final-mid { position: relative; z-index: 1; width: 100%; }
.final-title {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.4rem, 10vw, 12rem);
  line-height: 0.88;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(var(--tilt));
}
.final-title .band { display: inline-block; line-height: 1; padding: 0.06em 0.1em 0; }
.final-title .band::before { top: 0; bottom: 0; }
.final-front {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 40px;
  margin-top: 3vw;
}
.stack-final {
  --cw: min(54vw, 260px);
  margin-bottom: 46px;
}
.stack-poster {
  width: 100%; height: 100%; object-fit: cover;
  border: 9px solid #fbf9f4; border-top-width: 22px; border-bottom-width: 30px;
  border-radius: 10px;
  transform: rotate(var(--tilt));
}

/* ---------- Footer ---------- */

.footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  padding: 28px 4vw;
  background: var(--navy-deep);
  color: var(--off);
  font-size: 1rem;
}
.footer nav { display: flex; gap: 24px; }
.footer nav a { text-decoration: none; font-weight: 600; }
.footer nav a:hover { text-decoration: underline; }
.footer p { margin: 0 0 0 auto; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-title .line { animation: headline-in 520ms var(--ease-out) backwards; }
  .hero-title .l2 { animation-delay: 55ms; }
  .hero-title .l3 { animation-delay: 110ms; }
  .hero .stack { animation: stack-in 520ms var(--ease-out) 80ms backwards; }
}
@keyframes headline-in {
  from { opacity: 0; transform: translateX(-20px); }
}
@keyframes stack-in {
  from { opacity: 0; translate: 0 24px; }
}

@supports (animation-timeline: view()) and (animation-range: cover) {
  @media (prefers-reduced-motion: no-preference) {
    .split, .how { view-timeline-name: --section; }
    .giant, .numeral {
      animation: section-drift linear both;
      animation-timeline: --section;
      animation-range: cover;
    }
  }
}
@keyframes section-drift {
  from { translate: 0 -28px; }
  to { translate: 0 28px; }
}

/* ---------- Tablet / phone ---------- */

@media (max-width: 900px) {
  :root { --nav-h: 64px; --tear: 10px; }
  .nav { padding: 0 16px; }
  .nav nav a:not(.btn) { display: none; }

  .hero { min-height: auto; padding-bottom: 48px; }
  .hero .layer.mid, .hero .layer.front { position: relative; inset: auto; }
  .hero .layer.mid { padding-top: calc(var(--nav-h) + 40px); }
  .hero-title {
    position: relative; top: auto; left: 3vw;
    font-size: 20vw;
  }
  .hero-title .l1 span { display: block; }

  .hero .stack {
    --cw: min(54vw, 300px);
    position: relative; right: auto; top: auto;
    margin: clamp(12px, 4vw, 24px) auto 0;
    transform: none;
  }
  .card[data-slot="1"] { transform: rotate(6deg) translateX(12%); }
  .card[data-slot="2"] { transform: rotate(13deg) translateX(23%); }
  .card[data-slot="3"] { transform: rotate(20deg) translateX(34%); }
  .card[data-slot="4"] { transform: rotate(-17deg) translateX(-12%); }
  .stamp-hero {
    right: 16px; top: -12vw;
    font-size: 1.125rem;
  }
  .hero-copy { position: relative; z-index: 9; left: auto; bottom: auto; margin-top: 88px; padding: 0 16px; }

  .split { min-height: auto; display: flex; flex-direction: column; }
  .half { position: relative; inset: auto; padding: 64px 16px 96px; }
  .half-a { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12vw), 0 100%); }
  .half-b { clip-path: none; margin-top: -12vw; padding-top: calc(64px + 12vw); }
  .giant { font-size: 25vw; }
  .half-a .giant { left: -2vw; bottom: auto; top: 16vw; }
  .half-b .giant { right: -2vw; top: auto; bottom: 10vw; }
  .shopper { position: relative; top: auto; width: auto; transform: none; left: auto !important; right: auto !important; }
  .stamp-seam {
    position: relative; left: auto; top: auto; order: -1;
    align-self: center; margin: 56px 0 0;
    transform: rotate(var(--tilt));
    font-size: 2.6rem;
  }
  .split-note { position: relative; left: auto; bottom: auto; padding: 0 16px 28px; color: var(--off); background: var(--navy); }

  .how { padding: calc(64px + var(--tear)) 16px 72px; }
  .section-title { margin-bottom: 96px; font-size: 17vw; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .steps li { min-height: 0; }
  .numeral { font-size: 48vw; top: -8vw; left: -2vw; }
  .step-text { margin-left: 30vw; padding-top: 22vw; }

  .bands { padding: 18vw 0 22vw; }
  .band-row {
    width: 150%; margin-left: -25%;
    padding: 12vw 27% 15vw;
    flex-direction: column !important; align-items: flex-start; gap: 14px;
  }
  .band-word { font-size: 15vw; }
  .band-row p { max-width: none; transform-origin: 0 0; }

  .final { padding: calc(72px + var(--tear)) 16px 72px; }
  .final-title { font-size: 15vw; }
  .final-front { margin-top: 0; padding-top: 56px; }
  .final-front .actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 360px; }

  .footer { padding: 24px 16px; }
  .footer p { margin-left: 0; width: 100%; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .deck-controls button { transition: none; }
}
