:root{
  --bg: #C9A0DC;
  --bg-2: #B48ED2;
  --ink: #2b2430;
  --muted: #6f6278;
  --paper: rgba(255, 255, 255, 0.75);
  --edge: rgba(123, 94, 167, 0.12);
  --accent: rgba(214, 182, 255, 0.25);
  --shadow: rgba(0, 0, 0, 0.12);
}

html,
body{
  height: 100%;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  color: var(--ink);
  font-family: "Crimson Pro", ui-serif, Georgia, "Times New Roman", Times, serif;
  background:
    radial-gradient(1000px 800px at 20% 8%, rgba(214, 182, 255, 0.30), transparent 60%),
    radial-gradient(1200px 800px at 85% 10%, rgba(255, 255, 255, 0.20), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden{
  display: none !important;
}

/* General layout */
.wrap{
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 18px 100px;
  display: none;
}

.paper{
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 24px;
  padding: 30px 22px;
  margin: 26px 0;
  box-shadow: 0 18px 50px var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.intro-paper{
  margin-top: 8px;
}

h1{
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 0.2px;
  font-family: "Caveat", ui-cursive, "Bradley Hand", "Comic Sans MS", cursive;
  font-weight: 700;
}

.meta{
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.line{
  font-size: 20px;
  line-height: 1.72;
  margin: 0 0 14px;
}

.hand{
  font-family: "Caveat", ui-cursive, "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0.2px;
}

.accent{
  display: inline-block;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #7b5ea7;
  font-weight: 700;
}

.heart-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  color: rgba(43, 36, 48, 0.34);
  font-size: 14px;
  letter-spacing: 0.6px;
}

.heart-divider::before,
.heart-divider::after{
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(43, 36, 48, 0.12);
}

.ps{
  margin-top: 18px;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

.closing-signoff{
  margin-top: 18px;
}

/* Reveal animation */
.reveal{
  opacity: 0;
  transform: translateY(12px);
  filter: blur(3px);
  transition:
    opacity 900ms ease,
    transform 900ms ease,
    filter 900ms ease;
  will-change: opacity, transform, filter;
}

.reveal.show{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Overlays */
.overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 100;
  background:
    radial-gradient(900px 700px at 20% 10%, rgba(214, 182, 255, 0.25), transparent 60%),
    radial-gradient(1200px 900px at 80% 15%, rgba(255, 255, 255, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(201, 160, 220, 0.96), rgba(180, 142, 210, 0.92));
}

.card{
  width: min(680px, 100%);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(123, 94, 167, 0.15);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.10);
  padding: 28px 22px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.title{
  font-family: "Caveat", ui-cursive, "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 42px;
  line-height: 1.1;
  margin: 4px 0 10px;
  font-weight: 700;
}

.subtitle{
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 18px;
}

.row{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.questions{
  flex-direction: column;
}

.questions input[type="text"]{
  width: min(360px, 100%);
}

input[type="text"]{
  width: min(240px, 100%);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(123, 94, 167, 0.18);
  font-size: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  box-sizing: border-box;
  color: var(--ink);
}

input[type="text"]:focus{
  border-color: rgba(123, 94, 167, 0.35);
}

button{
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(123, 94, 167, 0.18);
  background: rgba(214, 182, 255, 0.38);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 120ms ease, background 180ms ease;
}

button:hover{
  background: rgba(214, 182, 255, 0.52);
}

button:active{
  transform: translateY(1px);
}

.error{
  color: #8b2e2e;
  font-size: 14px;
  margin-top: 10px;
  min-height: 18px;
}

.intro-ps{
  margin-bottom: 0;
}

/* Apple-style scenes */
.scene{
  height: 235vh;
  margin: 10px 0 0;
}

.scene-sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
}

.scene-stage{
  width: min(760px, 100%);
  padding: 0 18px;
  display: grid;
  place-items: center;
}

.scene-card{
  position: relative;
  width: 100%;
  height: clamp(420px, 72vh, 560px);
  border-radius: 30px;
  border: 1px solid rgba(123, 94, 167, 0.10);
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(214, 182, 255, 0.35), transparent 55%),
    radial-gradient(900px 520px at 86% 18%, rgba(120, 90, 140, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.12);

  transform: translateY(60px) scale(0.92);
  opacity: 0;
  filter: blur(10px);
  will-change: transform, opacity, filter;
}

.scene-content{
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 30px 24px;
  z-index: 3;
}

.scene-title{
  font-family: "Caveat", ui-cursive, "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  color: rgba(43, 36, 48, 0.92);
}

.scene-title.big{
  font-size: clamp(54px, 8vw, 70px);
  margin-top: -2px;
}

.scene-sub{
  margin-top: 10px;
  font-size: 18px;
  color: rgba(43, 36, 48, 0.55);
}

.scene-glow{
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 40%, rgba(214, 182, 255, 0.45), transparent 60%);
  opacity: 0;
  transform: scale(1);
  filter: blur(12px);
  will-change: opacity, transform;
}

.scene-liquid{
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(60% 40% at 20% 40%, rgba(255, 255, 255, 0.42), transparent 60%),
    radial-gradient(50% 35% at 80% 55%, rgba(214, 182, 255, 0.20), transparent 65%),
    linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.16) 40%, transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transform: translateX(-8%) translateY(6%) rotate(-8deg);
  filter: blur(2px);
  will-change: transform, opacity;
}

.scene-down{
  margin-top: 16px;
  font-size: 14px;
  color: rgba(43, 36, 48, 0.42);
  letter-spacing: 0.3px;
}

/* Tap screen */
.tap-stage{
  width: min(760px, 100%);
  padding: 0 18px;
  display: grid;
  place-items: center;
}

.scene-card.tap-card{
  position: relative;
  width: min(520px, 86vw);
  aspect-ratio: 1 / 1;
  height: auto;

  transform: none;
  opacity: 1;
  filter: blur(0);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  border-radius: 0;

  -webkit-clip-path: url(#heartClip);
  clip-path: url(#heartClip);

  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.12);
}

.scene-card.tap-card:focus{
  outline: none;
}

.scene-card.tap-card:focus-visible{
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(214, 182, 255, 0.65);
}

.tap-sub{
  text-align: center;
}

.scene-glow.tap-glow{
  opacity: 0.26;
  transform: scale(1.02);
}

.scene-liquid.tap-liquid{
  opacity: 0.22;
  transform: translateX(3%) translateY(0%) rotate(-2deg);
}

/* Crack effect */
.crack-layer{
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.crack{
  position: absolute;
  display: block;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(40, 40, 40, 0),
    rgba(40, 40, 40, 0.65),
    rgba(40, 40, 40, 0)
  );
  transform-origin: left center;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
}

.c1{ top: 48%; left: 49%; width: 90px; transform: rotate(-38deg); }
.c2{ top: 48%; left: 49%; width: 75px; transform: rotate(24deg); }
.c3{ top: 48%; left: 49%; width: 65px; transform: rotate(84deg); }
.c4{ top: 48%; left: 42%; width: 70px; transform: rotate(5deg); }

.c5{ top: 20%; left: 15%; width: 180px; transform: rotate(25deg); }
.c6{ top: 30%; left: 70%; width: 160px; transform: rotate(-35deg); }
.c7{ top: 75%; left: 20%; width: 170px; transform: rotate(-20deg); }
.c8{ top: 70%; left: 65%; width: 150px; transform: rotate(40deg); }
.c9{ top: 50%; left: 5%; width: 160px; transform: rotate(5deg); }
.c10{ top: 50%; left: 75%; width: 160px; transform: rotate(-10deg); }

.tap-card.cracked-1 .crack-1{
  opacity: 1;
}

.tap-card.cracked-2 .crack-1,
.tap-card.cracked-2 .crack-2{
  opacity: 1;
}

.tap-card.cracked-1{
  animation: crackPulse 220ms ease;
}

.tap-card.cracked-2{
  animation: crackPulse 260ms ease;
}

.tap-card.opening{
  animation: finalBreak 380ms ease forwards;
}

@keyframes crackPulse{
  0%{ transform: scale(1); }
  35%{ transform: scale(0.994); }
  70%{ transform: scale(1.01); }
  100%{ transform: scale(1); }
}

@keyframes finalBreak{
  0%{
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
  45%{
    transform: scale(1.03);
    opacity: 1;
    filter: blur(0.5px);
  }
  100%{
    transform: scale(1.08);
    opacity: 0;
    filter: blur(5px);
  }
}

/* Mobile */
@media (max-width: 640px){
  .wrap{
    padding: 26px 14px 80px;
  }

  .paper{
    padding: 24px 18px;
    border-radius: 20px;
    margin: 20px 0;
  }

  h1{
    font-size: 30px;
  }

  .line{
    font-size: 18px;
    line-height: 1.68;
  }

  .hand{
    font-size: 25px;
  }

  .title{
    font-size: 38px;
  }

  .scene{
    height: 220vh;
  }

  .scene-card{
    height: clamp(360px, 66vh, 500px);
    border-radius: 26px;
  }

  .scene-card.tap-card{
    width: min(420px, 88vw);
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 0;
  }

  .scene-title{
    font-size: 34px;
  }

  .scene-title.big{
    font-size: clamp(46px, 11vw, 58px);
  }

  .scene-sub{
    font-size: 16px;
  }

  .card{
    padding: 24px 18px;
    border-radius: 24px;
  }

  .questions input[type="text"]{
    width: 100%;
  }

  .c1{ width: 70px; }
  .c2{ width: 58px; }
  .c3{ width: 50px; }
  .c4{ width: 55px; }

  .c5{ width: 120px; }
  .c6{ width: 105px; }
  .c7{ width: 95px; }
  .c8{ width: 105px; }
  .c9{ width: 82px; }
  .c10{ width: 82px; }
}