/* ============================================================
   For You — a small love letter of a website
   Palette: warm paper, soft rose, deep plum ink
   ============================================================ */

:root {
  --paper: #faf5ef;
  --paper-deep: #f4ece1;
  --ink: #43302e;
  --ink-soft: #8a6f6b;
  --rose: #d4537e;
  --rose-soft: #f4c0d1;
  --rose-wash: #fbeaf0;
  --white: #fffdfb;
  --shadow: 0 2px 6px rgba(67, 48, 46, 0.08), 0 12px 28px rgba(67, 48, 46, 0.10);
  --serif: "Cormorant Garamond", Georgia, serif;
  --hand: "Caveat", cursive;
  --sans: "Jost", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.7;
  /* faint paper grain */
  background-image: radial-gradient(rgba(67, 48, 46, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   The letter
   ============================================================ */
.letter {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) 1.5rem 3rem;
  text-align: center;
}

.letter-eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}

.letter-dear {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  color: var(--rose);
  margin-bottom: 2rem;
}

.letter-body p {
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  font-weight: 400;
  margin-bottom: 1.4rem;
}

.letter-signoff {
  font-family: var(--hand);
  font-size: 1.9rem;
  color: var(--rose);
  margin-top: 2.2rem;
}

/* days counter */
.counter {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-top: 3rem;
  padding: 1.1rem 2.2rem;
  background: var(--rose-wash);
  border-radius: 14px;
}
.counter-number {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--rose);
  line-height: 1.1;
}
.counter-label {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* scroll cue */
.scroll-cue {
  margin-top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-cue-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--ink-soft), transparent);
}

/* ============================================================
   The polaroid wall
   ============================================================ */
.wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.2rem, 4vw, 3rem);
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.polaroid {
  background: var(--white);
  padding: 12px 12px 0;
  box-shadow: var(--shadow);
  border-radius: 2px;
  width: min(270px, 78vw);
  cursor: pointer;
  border: none;
  font: inherit;
  color: inherit;
  text-align: center;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}
.polaroid.reveal {
  opacity: 0;
  transform: translateY(26px) rotate(var(--tilt, 0deg));
}
.polaroid.reveal.is-visible {
  opacity: 1;
  transform: rotate(var(--tilt, 0deg));
}
.polaroid:hover, .polaroid:focus-visible {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 4px 10px rgba(67, 48, 46, 0.10), 0 22px 44px rgba(67, 48, 46, 0.16);
  z-index: 2;
  position: relative;
}
.polaroid:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rose-wash);
}

.polaroid-caption {
  font-family: var(--hand);
  font-size: 1.45rem;
  color: var(--ink);
  padding: 0.65rem 0.4rem 0.9rem;
  line-height: 1.25;
}

/* every other polaroid drifts a little lower, scrapbook-style */
.polaroid:nth-child(even) { margin-top: 2.6rem; }
@media (max-width: 640px) {
  .polaroid:nth-child(even) { margin-top: 0; }
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(43, 28, 27, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}
.lightbox[hidden] { display: none; }

.lightbox-polaroid {
  background: var(--white);
  padding: 16px 16px 8px;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  max-width: min(480px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: lightbox-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.92) rotate(-1.5deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.lightbox-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rose-wash);
}

.lightbox-caption {
  font-family: var(--hand);
  font-size: 1.9rem;
  color: var(--ink);
  text-align: center;
  padding-top: 0.8rem;
  line-height: 1.2;
}
.lightbox-date {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 0.2rem;
}
.lightbox-note {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  text-align: center;
  padding: 0.9rem 0.6rem 1rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.4rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ============================================================
   Chapters (loves / places / fights)
   ============================================================ */
.chapter {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.chapter-title {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 2.8rem);
  color: var(--rose);
  margin-bottom: 0.4rem;
}
.chapter-sub {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* --- the things we love: three pinned notes --- */
.loves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
  margin-top: 2.2rem;
}
.love-note {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 2px;
  padding: 1.6rem 1.5rem 1.8rem;
  width: min(250px, 84vw);
  text-align: left;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.love-note:hover { transform: rotate(0deg) scale(1.03); }
.love-note-title {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--rose);
  text-align: center;
  margin-bottom: 0.9rem;
}
.love-note ul { list-style: none; }
.love-note li {
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--rose-soft);
}
.love-note li:last-child { border-bottom: none; }

/* --- every place we've been: little tickets --- */
.places {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
  margin: 2.2rem auto 0;
}
.place {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 2px;
  border-left: 4px solid var(--rose-soft);
  padding: 1rem 1.4rem;
  text-align: left;
}
.place-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  white-space: nowrap;
}
.place-note {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
  flex: 1;
}
.place-when {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
@media (max-width: 520px) {
  .place { flex-direction: column; gap: 0.2rem; }
}

/* --- the fights we survived: stamped case files --- */
.fights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 2.2rem;
}
.fight {
  position: relative;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 2px;
  padding: 1.4rem 1.5rem 1.6rem;
  width: min(250px, 84vw);
  text-align: left;
  transform: rotate(var(--tilt, 0deg));
}
.fight-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  padding-right: 4.5rem;
}
.fight-note {
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.fight-stamp {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  border: 1.5px solid var(--rose);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  transform: rotate(8deg);
  opacity: 0.85;
}

/* ============================================================
   Ending
   ============================================================ */
.ending {
  text-align: center;
  padding: 4rem 1.5rem 7rem;
  max-width: 560px;
  margin: 0 auto;
}
.ending-heart {
  font-size: 2rem;
  color: var(--rose);
  margin-bottom: 1.4rem;
}
.ending-line {
  font-size: clamp(1.15rem, 2.4vw, 1.3rem);
  font-style: italic;
  margin-bottom: 1.8rem;
}
.ending-continued {
  font-family: var(--hand);
  font-size: 2.1rem;
  color: var(--rose);
}

/* ============================================================
   Password gate
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  background: var(--paper);
  background-image: radial-gradient(rgba(67, 48, 46, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}
.gate[hidden] { display: none; }

.gate-card {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 2px;
  padding: 3rem 2.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  transform: rotate(-1deg);
}
.gate-heart { font-size: 1.8rem; color: var(--rose); margin-bottom: 1rem; }
.gate-question {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin-bottom: 1.4rem;
}
.gate-card input {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--hand);
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rose-soft);
  border-radius: 8px;
  outline: none;
  margin-bottom: 1rem;
}
.gate-card input:focus { border-color: var(--rose); }
.gate-card button {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--rose);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.gate-card button:hover { background: #b83f68; }
.gate-hint {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}
.gate-error {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--rose);
  margin-top: 0.8rem;
}
.gate-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: rotate(-1deg) translateX(0); }
  25% { transform: rotate(-1deg) translateX(-7px); }
  75% { transform: rotate(-1deg) translateX(7px); }
}
