body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  color: #3d3d3d;
  transition: background 1s ease;
  opacity: 0;
  animation: fadeIn 2s ease forwards;
}

header, section {
  padding: 4em 2em;
  text-align: center;
}

header {
    color: #4b2b2b;
}

body, header {
    background-image: url("../img/background/paper-fibers.e746000bd3c0.png"), linear-gradient(to bottom right, #fff6f0, #fde2e2);
    background-blend-mode: overlay;
    background-size: cover;
}

h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5em;
    margin-bottom: 0.3em;
}

.subtext {
  font-size: 1.3em;
  color: #8f4f5a;
  font-style: italic;
}


.letter {
  max-width: 700px;
  margin: 2em auto;
  font-size: clamp(1em, 2.5vw, 1.2em);
  line-height: 1.8;
  font-family: 'Lora', serif;
  background: rgba(255, 255, 255, 0.8);
  padding: clamp(1em, 4vw, 2em);
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.letter.narrow {
  max-width: 500px;
}

footer {
  padding: 2em;
  text-align: center;
  font-size: 0.95em;
  color: #8f4f5a;
}

.letter-paper {
    background: #fffdf5;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(220, 210, 180, 0.6),
        rgba(220, 210, 180, 0.6) 2px,
        transparent 2px,
        transparent 30px
    );
    border: 1px solid #d6c9b2;
    border-radius: 12px;
    padding: 2em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    font-family: 'Indie Flower', cursive;
}

.intro-quote {
    font-size: 1.5em;
    font-style: italic;
		font-weight: bold;
    color: #6b4f4f;
    margin-bottom: 1em;
}

@keyframes fadeIn {
  to { opacity: 1; }
}


form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

input[type="password"],
input[type="text"] {
  flex-grow: 1;
  padding: 0.5em 1em;
  border: none;
  font-size: 1em;
  font-family: 'Quicksand', sans-serif;
  color: #8f4f5a;
  background-color: transparent;
  caret-color: #8f4f5a;
}

button[type="submit"] {
  background-color: #8f4f5a;
  color: white;
  border: none;
  padding: 0.6em 1.5em;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: 0.3s;
}

button[type="submit"]:hover {
  background-color: #a86774;
}

p.error {
  color: #b30000;
  font-weight: bold;
  margin-bottom: 1em;
}

.error {
  color: #b30000;
  font-weight: bold;
  margin-bottom: 1em;
}

.passcode-label {
  font-size: 1.2em;
  margin-bottom: 0.5em;
  display: block;
}

a {
  color: #8f4f5a;
  text-decoration: underline;
  font-weight: 500;
  font-family: 'Quicksand', sans-serif;
  transition: color 0.3s ease;
}

a:hover {
  color: #a86774;
}

.pretty-countdown-wrapper {
  margin: 2.5em auto;
  text-align: center;
  animation: fadeIn 1.5s ease forwards;
  opacity: 0;
}

.pretty-countdown-label {
  font-family: 'Indie Flower', cursive;
  font-size: 1.2em;
  color: #6b4f4f;
  margin-bottom: 0.3em;
  letter-spacing: 0.5px;
}

.pretty-countdown-time {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8em;
  color: #8f4f5a;
  text-shadow: 0 0 6px rgba(255, 192, 203, 0.4);
  letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 6px rgba(255, 192, 203, 0.4);
  }
  50% {
    transform: scale(1.03);
    text-shadow: 0 0 12px rgba(255, 192, 203, 0.8);
  }
}

.passcode-field-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5em;
}

.passcode-input-group {
  display: flex;
  align-items: center;
  background-color: #fffdfc;
  border: 1px solid #d6a4a4;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input::placeholder {
  color: #c69a9a;
}

.toggle-password {
  background: none;
  border: none;
  padding: 0 0.8em 0 0.5em;
  font-size: 1.1em;
  color: #8f4f5a;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.toggle-password:hover {
  transform: scale(1.2);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 20px;
  transition: opacity 0.5s ease;
}

.overlay button {
  padding: 15px 30px;
  font-size: 1.2em;
  font-family: 'Quicksand', sans-serif;
  background-color: #8f4f5a;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

.overlay button:hover {
  background-color: #723942;
}

.overlay-content {
  text-align: center;
}

.overlay-content p {
  font-size: 1.4em;
  margin-bottom: 1em;
  font-family: 'Indie Flower', cursive;
  color: #8f4f5a;
}

.model-viewer-container {
    position: relative;
    margin: 2em auto;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    height: auto;
    border: 2px solid #8f4f5a;
    border-radius: 20px;
    background-image: url("../img/background/paper-fibers.e746000bd3c0.png");
    background-color: #fffdf5;
    background-blend-mode: multiply;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.model-viewer {
  visibility: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.model-viewer::part(default-progress-bar) {
  background-color: #8f4f5a;
}

.loader {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px 40px;
  border-radius: 12px;
  font-family: sans-serif;
  font-size: clamp(14px, 2vw, 18px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

  .memory-hero { position: relative; max-width: 600px; margin: 0 auto; }
  .memory-hero__frame { position: relative; margin: 0; }
  .memory-hero__img {
    width: 100%;
	max-width: 600px;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
  }
  .memory-hero__overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0));
    color: #fff;
    border-radius: 12px;
  }
  .memory-hero__title { margin: 0 0 .25rem; font-size: clamp(1.25rem, 2.2vw, 2rem); }
  .memory-hero__subtitle { margin: 0; font-size: clamp(.95rem, 1.6vw, 1.1rem); opacity: .95; }

  /* --- Love notes --- */
.love-note {
  position: absolute;
  display: inline-block;
  z-index: 40;
  font-size: var(--love-note-size, 1.4rem);
  cursor: pointer;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: transform 140ms ease;
  will-change: transform;
}
.love-note:hover { transform: translate(-50%, -50%) scale(1.12); }
.love-note.inline:hover { transform: none; filter: drop-shadow(0 2px 6px rgba(168,103,116,.25)); }

/* gentle drift */
@keyframes drift {
  0%   { transform: translate(-50%, -50%) translateY(0); }
  50%  { transform: translate(-50%, -50%) translateY(-6px); }
  100% { transform: translate(-50%, -50%) translateY(0); }
}
.love-note.float { animation: drift 4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .love-note.float { animation: none; }
}

/* --- Popover --- */
.love-popover {
  position: absolute;
  z-index: 1010;
  top: 0;
  left: 50%;
  min-width: 220px;
  max-width: min(90vw, 480px);
  background: #fffdf5;
  color: #4b2b2b;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
  padding: 8px 10px;
  line-height: 1.25;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  transform: translate(-50%, calc(-100% - 16px));
}

.love-popover::after { /* little arrow */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  background: #fffdf5;
  border-right: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transform: translateX(-50%) rotate(45deg);
}

.love-popover .close-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  float: right;
  margin-left: 8px;
  color: #888;
}
.love-popover .close-btn:hover { color: #333; }

/* optional backdrop click area */
.love-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: transparent;
}

.love-anchor {
  position: static;
}

/* inline note that sits at the end of the paragraph */
.love-note.inline {
  position: static;
  display: inline-block;
  margin-left: 0.3em;
  right: -0.25em;         /* nudge slightly outside the text */
  top: 0.1em;             /* tweak to taste */
  transform: none;        /* no centering for inline placement */
  font-size: 1.1em;       /* a bit smaller than random float ones */
}

/* make the emoji itself wiggle, not the whole button */
.note-icon {
  display: inline-block;
  transform-origin: 50% 60%;
}

/* infinite wiggle */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-15deg) scale(1.1); }
  30% { transform: rotate(15deg) scale(1.1); }
  45% { transform: rotate(-12deg) scale(1.05); }
  60% { transform: rotate(12deg) scale(1.05); }
  75% { transform: rotate(-8deg) scale(1.02); }
  90% { transform: rotate(8deg) scale(1.02); }
}

.note-icon.wiggle {
  animation: wiggle 1.2s ease-in-out infinite;
}

/* when a note is active (popover open), pause & reset the emoji */
.love-note.active .note-icon {
  animation-play-state: paused;
  transform: none;
}