/* ---------------------------------------------------------------
   Components
   --------------------------------------------------------------- */

/* === Notebook page (glass card) ======================================== */

.notebook {
  position: relative;
  width: 100%;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 24px 64px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .notebook {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.notebook--center {
  text-align: center;
}

/* Specular rim — top edge */
.notebook::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  border-radius: 1.5rem 1.5rem 0 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45) 30%,
    rgba(255, 255, 255, 0.45) 70%,
    transparent
  );
}

/* Ruled notebook lines */
.notebook::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 31px,
    rgba(244, 114, 182, 0.1) 31px,
    rgba(244, 114, 182, 0.1) 32px
  );
  background-position-y: 20px;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.notebook > * {
  position: relative;
  z-index: 1;
}

/* === Buttons =========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  color: #fff;
  transition: transform 0.18s var(--ease-out-expo);
}

.btn:hover {
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  padding: 0.75rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.8),
    rgba(244, 63, 94, 0.8)
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(249, 168, 212, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(236, 72, 153, 0.4);
}

.btn--primary-lg {
  padding: 1rem 2.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 32px rgba(236, 72, 153, 0.45);
}

.btn--ghost {
  padding: 0.75rem 2rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn__icon .icon {
  width: 1rem;
  height: 1rem;
}

.btn--primary-lg .btn__icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-pink {
  color: var(--pink-400);
}

/* === Handwriting ======================================================= */

/* `.hw` deliberately sets no `display` — the wrapper keeps whatever the tag
   it was rendered as (h1 / p / span / div) would use on its own. */

.hw-word {
  display: inline-block;
  white-space: nowrap;
}

.hw-space {
  white-space: pre-wrap;
}

.hw-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  filter: blur(3px);
  transition: opacity 0.16s linear, transform 0.16s linear,
    filter 0.16s linear;
  transition-delay: var(--d, 0s);
}

.hw.is-visible .hw-char {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

@media (prefers-reduced-motion: reduce) {
  .hw-char {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* === Big beating heart headers ========================================= */

.beat {
  display: inline-block;
  margin-bottom: 1rem;
  animation: beat 1.8s ease-in-out infinite;
}

.beat--slow {
  animation-duration: 1.6s;
  margin-bottom: 1.5rem;
}

.beat--wobble {
  animation: wobble 1.2s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

.heart-glow {
  color: var(--pink-300);
  fill: var(--pink-300);
  filter: drop-shadow(0 0 24px rgba(244, 114, 182, 0.7));
}

.heart-glow--xl {
  filter: drop-shadow(0 0 40px rgba(244, 114, 182, 0.8));
}

.size-20 {
  width: 5rem;
  height: 5rem;
}
.size-16 {
  width: 4rem;
  height: 4rem;
}
.size-24 {
  width: 6rem;
  height: 6rem;
}
.size-32 {
  width: 8rem;
  height: 8rem;
}

/* === Elapsed counter =================================================== */

.counter {
  width: 100%;
  max-width: 42rem;
}

.counter__title {
  font-family: var(--font-hand);
  font-size: 4rem;
  line-height: 1.3;
  padding: 0 0 8px;
  margin: 0;
}

.counter__subtitle {
  display: block;
  margin-bottom: 2.5rem;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.65);
}

.counter__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-inline: auto;
  max-width: 42rem;
}

@media (min-width: 768px) {
  .counter__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.counter__unit {
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

.counter__value {
  font-size: 3rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.counter__label {
  margin-top: 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.45);
}

.counter__total {
  margin-top: 2.5rem;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.65);
}

.counter__total strong {
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
}

.counter__actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* === Intro / ask / yes pages =========================================== */

.intro__title {
  font-family: var(--font-hand);
  font-size: 4.5rem;
  line-height: 1.4;
  padding: 0 0 8px;
  margin: 0;
}

.intro__lead {
  display: block;
  margin-bottom: 2.5rem;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
}

.ask {
  margin-top: 3rem;
  text-align: center;
}

.ask__question {
  display: block;
  margin-bottom: 2rem;
  font-family: var(--font-hand);
  font-size: 2.75rem;
  line-height: 1.1;
  color: #fff;
}

.ask__buttons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  overflow: visible;
}

.btn--yes {
  padding: 1rem 3rem;
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.85),
    rgba(244, 63, 94, 0.85)
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(249, 168, 212, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 32px rgba(236, 72, 153, 0.5);
}

.btn--yes .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.btn--no {
  position: relative;
  z-index: 50;
  padding: 1rem 2rem;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translate(var(--nx, 0px), var(--ny, 0px));
  transition: transform 0.55s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.ask__hint {
  display: block;
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.4);
}

.yes__title {
  display: block;
  margin-bottom: 1.5rem;
  font-family: var(--font-hand);
  font-size: 5rem;
  line-height: 1;
  padding: 0 0 12px;
}

.yes__body {
  display: block;
  margin-inline: auto;
  max-width: 28rem;
  font-size: 1.4rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
}

.yes__badge {
  margin-top: 2.5rem;
  display: inline-block;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  color: var(--pink-200);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: bob 2s ease-in-out infinite;
}

/* === Love letter ======================================================= */

.letter {
  margin-inline: auto;
  max-width: 42rem;
}

.letter__tag {
  display: inline-block;
  margin-bottom: 1.5rem;
  border-radius: 9999px;
  padding: 0.25rem 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.7),
    rgba(244, 63, 94, 0.7)
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(249, 168, 212, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.letter__salutation {
  display: block;
  margin-bottom: 1.5rem;
  font-family: var(--font-hand);
  font-size: 2rem;
  line-height: 1.3;
  color: #fff;
}

.letter__body {
  display: block;
  margin-bottom: 1.5rem;
  font-size: 1.35rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.letter__reasons {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.letter__reason {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transition-delay: var(--d, 0s);
}

.letter__reason.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.letter__bullet {
  margin-top: 0.5rem;
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgba(249, 168, 212, 0.7);
}

.letter__reason span.hw {
  font-size: 1.3rem;
  line-height: 1.4;
}

/* === Timeline ========================================================== */

.timeline {
  position: relative;
  width: 100%;
  max-width: 42rem;
}

.timeline__head {
  text-align: center;
}

.timeline__title {
  font-family: var(--font-hand);
  font-size: 3.5rem;
  line-height: 1.3;
  padding: 0 0 8px;
  margin: 0;
}

.timeline__subtitle {
  display: block;
  margin-bottom: 3rem;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.6);
}

.timeline__track {
  position: relative;
}

.timeline__line,
.timeline__fill {
  position: absolute;
  left: 1.5rem;
  top: 0.5rem;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 9999px;
  bottom: var(--line-bottom, 8px);
}

.timeline__line {
  background: rgba(255, 255, 255, 0.12);
}

.timeline__fill {
  transform: translateX(-50%) scaleY(var(--fill, 0));
  transform-origin: top;
  background: linear-gradient(
    to bottom,
    rgba(249, 168, 212, 0.9),
    rgba(244, 63, 94, 0.9)
  );
  transition: transform 0.35s ease-out;
}

.timeline__items {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-left: 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline__node {
  position: absolute;
  left: 1.5rem;
  top: 0.25rem;
  z-index: 10;
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transform: translateX(-50%) scale(1);
  transition: transform 0.3s var(--ease-out-expo), background 0.3s ease,
    box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: rgba(249, 168, 212, 0.8);
}

.timeline__node .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.timeline__node.is-active {
  transform: translateX(-50%) scale(1.1);
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.85),
    rgba(244, 63, 94, 0.85)
  );
  border-color: rgba(249, 168, 212, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 24px rgba(236, 72, 153, 0.5);
  color: #fff;
}

.timeline__entry {
  flex: 1;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.timeline__entry--dream {
  border: 1px dashed rgba(249, 168, 212, 0.45);
}

.timeline__date {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: rgba(251, 207, 232, 0.7);
}

.timeline__name {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-hand);
  font-size: 1.9rem;
  line-height: 1.1;
  color: #fff;
}

.timeline__desc {
  display: block;
  font-size: 1.25rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.6);
}

.timeline__footer {
  margin-top: 3rem;
  text-align: center;
}

/* === Memory jar ======================================================== */

.jar {
  position: relative;
  height: 600px;
  width: 100%;
  max-width: 56rem;
  margin: 3rem auto 0;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--pink-100);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.jar__dots {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image: radial-gradient(var(--pink-400) 1px, transparent 1px);
  background-size: 24px 24px;
}

.jar__title {
  position: relative;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.875rem;
  color: var(--pink-600);
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.jar__board {
  position: relative;
  /* leave room for the heading so the bottom row is never clipped */
  height: calc(100% - 6rem);
  width: 100%;
}

.jar__photo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  cursor: pointer;
  transform: rotate(var(--rot)) scale(1);
  transition: transform 0.3s var(--ease-out-expo);
  /* `backwards`, not `both`: once it lands the element falls back to the rule
     above, so the rotation and the hover scale keep working. */
  animation: pop-in-rotated 0.45s var(--ease-out-expo) backwards;
  animation-delay: var(--pop-delay, 0s);
}

.jar__photo:hover {
  transform: rotate(0deg) scale(1.1);
  z-index: 10;
}

.jar__frame {
  background: #fff;
  padding: 0.75rem 0.75rem 2rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--pink-50);
  transition: box-shadow 0.3s ease;
}

.jar__photo:hover .jar__frame {
  box-shadow: 0 10px 25px -3px rgba(251, 207, 232, 0.5);
}

.jar__img {
  width: 8rem;
  height: 10rem;
  overflow: hidden;
  background: var(--pink-50);
}

.jar__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2);
  transition: filter 0.3s ease;
}

.jar__photo:hover .jar__img img {
  filter: grayscale(0);
}

.jar__caption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 10px;
  font-family: var(--font-hand);
  color: var(--pink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding-inline: 0.25rem;
}

.jar__tape {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 2rem;
  height: 1rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

/* Lightbox */
.jar-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(131, 24, 67, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.25s ease backwards;
}

.jar-modal.is-closing {
  animation: fade-out 0.2s ease both;
}

.jar-modal__card {
  position: relative;
  background: #fff;
  padding: 1rem 1rem 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  max-width: 24rem;
  width: 100%;
  animation: polaroid-in 0.35s var(--ease-out-expo) backwards;
}

.jar-modal__close {
  position: absolute;
  top: -1rem;
  right: -1rem;
  background: var(--pink-500);
  color: #fff;
  border-radius: 9999px;
  padding: 0.5rem;
  display: flex;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

.jar-modal__close:hover {
  background: var(--pink-600);
}

.jar-modal__close .icon {
  width: 1rem;
  height: 1rem;
}

.jar-modal__img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--pink-50);
  border-radius: 2px;
}

.jar-modal__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jar-modal__caption {
  margin-top: 1.5rem;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--pink-600);
}

.jar-modal__stamp {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  opacity: 0.2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--pink-300);
}

/* === Notebook lock ===================================================== */

.lock {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding-inline: 1.5rem;
  animation: fade-in 0.5s ease backwards;
}

.lock.is-leaving {
  animation: fade-out 0.5s ease both;
}

@media (min-width: 768px) {
  .lock {
    flex-direction: row;
    gap: 3.5rem;
  }
}

.lock__book-wrap {
  position: relative;
  perspective: 1500px;
}

.lock__book {
  position: relative;
  height: 360px;
  width: 280px;
  overflow: hidden;
  border-radius: 1rem;
  border-top-left-radius: 1.5rem;
  border-bottom-left-radius: 1.5rem;
  transform-origin: left center;
  transform-style: preserve-3d;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 32px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(236, 72, 153, 0.25);
}

.lock__book.is-shaking {
  animation: shake 0.5s ease;
}

.lock__book.is-opening {
  animation: book-open 0.9s ease-in both;
}

.lock__rim {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent
  );
}

.lock__spiral {
  pointer-events: none;
  position: absolute;
  inset-block: 0;
  left: 0;
  display: flex;
  width: 2.25rem;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding-block: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.lock__ring {
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lock__cover {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2rem 0 3rem;
  text-align: center;
}

.lock__heart {
  animation: beat 1.8s ease-in-out infinite;
  will-change: transform;
  color: #fff;
  fill: rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 0 20px rgba(244, 114, 182, 0.7));
}

.lock__heart .icon {
  width: 3.5rem;
  height: 3.5rem;
}

.lock__names {
  margin-top: 1rem;
  color: #fff;
  font-family: var(--font-hand);
  font-size: 2.5rem;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.lock__hint-cover {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
}

.lock__pips {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: rise-in 0.35s ease backwards;
}

.lock__pip {
  height: 0.875rem;
  width: 0.875rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lock__pip.is-filled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.lock__pips.is-error .lock__pip {
  background: rgba(251, 113, 133, 0.9);
  border-color: rgba(251, 113, 133, 0.7);
  box-shadow: none;
  animation: shake-sm 0.4s ease;
}

.lock__clasp {
  pointer-events: none;
  position: absolute;
  top: 50%;
  right: 0;
  height: 2.5rem;
  width: 4rem;
  transform: translate(1.5rem, -50%);
  border-radius: 9999px 0 0 9999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.lock__padlock {
  position: absolute;
  z-index: 10;
  top: 50%;
  right: 0;
  width: 56px;
  height: 72px;
  transform: translate(30%, -28%);
  transform-origin: top center;
  animation: padlock-swing 5.5s ease-in-out infinite;
}

.lock__padlock:hover:not(:disabled) {
  animation: padlock-swing-fast 0.7s ease-in-out;
}

.lock__padlock.is-open {
  animation: padlock-drop 0.6s var(--ease-out-expo) forwards;
}

.lock__pulse {
  position: absolute;
  width: 63px;
  height: 63px;
  top: 58%;
  left: 50%;
  border-radius: 9999px;
  border: 2px solid rgba(244, 114, 182, 0.5);
  filter: blur(3px);
  pointer-events: none;
  will-change: transform, opacity;
  animation: pulse-ring 2.2s ease-out infinite;
}

.lock__padlock-svg {
  width: 75%;
  height: 75%;
  margin: 0.25rem auto 0;
  filter: drop-shadow(0 4px 12px rgba(244, 114, 182, 0.7));
}

.lock__shackle {
  transform-box: fill-box;
  transform-origin: 88% 100%;
  transition: transform 0.5s var(--ease-out-expo);
}

.is-unlocking .lock__shackle {
  transform: rotate(-32deg) translateY(-4px);
}

.lock__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.lock__keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  animation: keypad-in 0.4s 0.15s ease backwards;
}

.lock__keypad.is-leaving {
  animation: keypad-out 0.8s ease-in both;
}

.key {
  display: flex;
  height: 4rem;
  width: 4rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #fff;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease;
}

.key.is-flashing,
.key:active {
  transform: scale(0.9);
}

.key--util {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.key--util .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.lock__hint {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lock.is-unlocking .lock__hint,
.lock.is-unlocking .lock__keypad {
  opacity: 0;
  transform: translateY(-20px);
}

/* === Doodle arrow ====================================================== */

.doodle {
  pointer-events: none;
  position: fixed;
  z-index: 30;
  bottom: 88px;
  left: 36px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.doodle.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.doodle__label {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: rgba(249, 168, 212, 0.8);
  margin-bottom: 2px;
  margin-left: 14px;
  white-space: nowrap;
}

.doodle path {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 1.1s ease-in-out 0.15s;
}

.doodle path.doodle__head {
  transition-duration: 0.35s;
  transition-delay: 1.1s;
  transition-timing-function: ease-out;
}

.doodle.is-visible path {
  stroke-dashoffset: 0;
}

/* === Music player ====================================================== */

.music {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 40;
}

.music__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 9999px;
  color: var(--pink-200);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease-out-expo);
  animation: pop-in 0.3s var(--ease-out-expo) backwards;
}

.music__fab:hover {
  transform: scale(1.12);
}

.music__fab:active {
  transform: scale(0.92);
}

/* mini */
.music__mini {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  animation: rise-in 0.25s var(--ease-out-expo) backwards,
    liquid-mini 5s ease-in-out infinite;
}

.music__specular {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28) 40%,
    rgba(255, 255, 255, 0.28) 60%,
    transparent
  );
}

.music__thumb {
  position: relative;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.music__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music__mini-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  width: 110px;
}

.music__mini-name {
  color: #fff;
  font-family: var(--font-hand);
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music__mini-artist {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music__mini-bar {
  height: 2px;
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.125rem;
  background: rgba(255, 255, 255, 0.1);
}

.music__mini-bar > div {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.85),
    rgba(249, 168, 212, 0.85)
  );
  transition: width 0.25s linear;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 14px;
  flex-shrink: 0;
}

.eq span {
  width: 4px;
  height: 3px;
  border-radius: 2px;
  background: rgba(249, 168, 212, 0.85);
}

.eq.is-active span {
  animation: eq-bounce 0.7s ease-in-out infinite;
}

.eq.is-active span:nth-child(2) {
  animation-delay: 0.18s;
}
.eq.is-active span:nth-child(3) {
  animation-delay: 0.36s;
}

.music__mini-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.8),
    rgba(244, 63, 94, 0.8)
  );
  border: 1px solid rgba(249, 168, 212, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 10px rgba(236, 72, 153, 0.45);
  transition: transform 0.15s ease;
}

.music__mini-toggle:hover {
  transform: scale(1.15);
}

.music__mini-toggle .icon {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

/* panel */
.music__panel {
  position: relative;
  width: 18rem;
  padding: 1rem 1.25rem 1.25rem;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 24px 64px rgba(0, 0, 0, 0.5);
  border-radius: 28px;
  animation: rise-in 0.3s var(--ease-out-expo) backwards,
    liquid-panel 7s ease-in-out infinite;
}

.music__panel .music__specular {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35) 40%,
    rgba(255, 255, 255, 0.35) 60%,
    transparent
  );
}

.music__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.music__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.music__close {
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  transition: color 0.2s ease;
}

.music__close:hover {
  color: rgba(255, 255, 255, 0.6);
}

.music__close .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.music__art-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.music__art {
  position: relative;
}

.music__art-glow {
  position: absolute;
  inset: -0.75rem;
  border-radius: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    circle,
    rgba(236, 72, 153, 0.4) 0%,
    transparent 70%
  );
  filter: blur(10px);
}

.music.is-playing .music__art-glow {
  opacity: 1;
}

.music__cover {
  position: relative;
  width: 7rem;
  height: 7rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.music.is-playing .music__cover {
  animation: breathe 3s ease-in-out infinite;
}

.music__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music__info {
  text-align: center;
  margin-bottom: 1rem;
}

.music__name {
  color: #fff;
  line-height: 1.1;
  font-family: var(--font-hand);
  font-size: 1.45rem;
}

.music__artist {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

.music__progress-wrap {
  margin-bottom: 1rem;
  padding-inline: 0.25rem;
}

.music__progress {
  height: 4px;
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
}

.music__progress > div {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.9),
    rgba(249, 168, 212, 0.9)
  );
  transition: width 0.25s linear;
}

.music__times {
  display: flex;
  justify-content: space-between;
  margin-top: 0.375rem;
  padding-inline: 0.125rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.music__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.music__play {
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.85),
    rgba(244, 63, 94, 0.85)
  );
  border: 1px solid rgba(249, 168, 212, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 20px rgba(236, 72, 153, 0.5);
  transition: transform 0.15s ease;
}

.music__play:hover {
  transform: scale(1.08);
}

.music__play:active {
  transform: scale(0.93);
}

.music__play .icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.music__volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding-inline: 0.25rem;
}

.music__mute {
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  display: flex;
  transition: color 0.2s ease;
}

.music__mute:hover {
  color: rgba(255, 255, 255, 0.6);
}

.music__mute .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.music__vol-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
}

.music__vol-fill {
  height: 100%;
  border-radius: 9999px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(236, 72, 153, 0.7),
    rgba(249, 168, 212, 0.7)
  );
  transition: width 0.08s linear;
}

.music__vol-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

/* === Responsive tweaks ================================================= */

@media (max-width: 640px) {
  .counter__title {
    font-size: 2.75rem;
  }
  .intro__title {
    font-size: 3rem;
  }
  .yes__title {
    font-size: 3.25rem;
  }
  .ask__question {
    font-size: 2rem;
  }
  .timeline__title {
    font-size: 2.5rem;
  }
  .counter__value {
    font-size: 2.25rem;
  }
  .notebook {
    padding: 2rem 1.25rem;
  }
  .jar {
    height: 460px;
    padding: 1rem;
  }
  .jar__img {
    width: 6rem;
    height: 7.5rem;
  }
}
