
/* =========================================
   REX — 15TH BIRTHDAY
   Blue • Red • Yellow • Scrapbook
========================================= */

:root {
  --blue: #e2f2ff;
  --blue-deep: #a8d5f4;
  --blue-accent: #398ec9;

  --red: #f28c8c;
  --red-light: #ffc4bd;

  --yellow: #ffd966;
  --yellow-light: #ffedb0;

  --ink: #173e60;
  --ink-soft: #4e6e89;

  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.78),
      transparent 45%
    ),
    linear-gradient(
      155deg,
      #f0faff,
      #e3f3ff,
      #d8edff,
      #eff9ff
    );
}

body,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}


/* =========================================
   DYNAMIC DIAGONAL COLOR ATMOSPHERE
========================================= */

/* =========================================
   RICHER DIAGONAL COLOR ATMOSPHERE
========================================= */

.background-glow {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -2;
  opacity: 0.85;
  filter: blur(65px);
}

.glow-blue {
  background:
    radial-gradient(
      ellipse at 15% 25%,
      rgba(143, 207, 255, 0.9),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 80% 75%,
      rgba(160, 216, 255, 0.75),
      transparent 42%
    );

  animation: blueDrift 18s ease-in-out infinite alternate;
}

.glow-red {
  background:
    radial-gradient(
      ellipse at 70% 20%,
      rgba(255, 145, 145, 0.55),
      transparent 35%
    ),
    radial-gradient(
      ellipse at 15% 80%,
      rgba(255, 180, 165, 0.5),
      transparent 38%
    );

  animation: redDrift 22s ease-in-out infinite alternate;
}

.glow-yellow {
  background:
    radial-gradient(
      ellipse at 35% 65%,
      rgba(255, 220, 110, 0.55),
      transparent 36%
    ),
    radial-gradient(
      ellipse at 90% 30%,
      rgba(255, 238, 165, 0.45),
      transparent 32%
    );

  animation: yellowDrift 20s ease-in-out infinite alternate;
}

@keyframes blueDrift {
  from {
    transform: translate(-3%, -2%) rotate(-5deg);
  }

  to {
    transform: translate(4%, 3%) rotate(8deg);
  }
}

@keyframes redDrift {
  from {
    transform: translate(3%, -4%) rotate(6deg);
  }

  to {
    transform: translate(-4%, 5%) rotate(-8deg);
  }
}

@keyframes yellowDrift {
  from {
    transform: translate(-4%, 4%) rotate(5deg);
  }

  to {
    transform: translate(5%, -3%) rotate(-6deg);
  }
}

/* =========================================
   HERO
========================================= */

.hero {
  min-height: 100vh;
  min-height: 100svh;

  display: flex;
  flex-direction: column;

  padding: 25px 22px 24px;

  position: relative;
  overflow: hidden;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-label {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--ink-soft);
}

.top-spark {
  font-size: 21px;
  color: #e88c8c;
  animation: sparkRotate 8s linear infinite;
}

@keyframes sparkRotate {
  to {
    transform: rotate(360deg);
  }
}

.hero-content {
  width: 100%;
  max-width: 700px;
  margin: auto;
  padding: 55px 0 40px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.birthday-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  font-size: 8px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: #6d91aa;

  margin-bottom: 36px;
}

.date-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ed9c94;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 5px;
  font-weight: 700;
  color: #db8589;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;

  font-size: clamp(76px, 19vw, 135px);
  line-height: 0.82;

  letter-spacing: -5px;
}

.hero h1 span {
  display: inline-block;
  font-style: italic;
  color: #6aaedb;

  margin-top: 10px;
  transform: rotate(-4deg);
}

.name-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 37px auto 25px;
}

.name-wrap h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 12px;
  padding-left: 12px;
  color: #315b7b;
}

.name-decoration {
  width: 34px;
  height: 2px;
  background: #f2b0a8;
}

.age-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 28px auto;
}

.age-fifteen {
  font-family: var(--serif);
  font-size: 67px;
  font-weight: 600;
  line-height: 1;

  color: #ed9e91;

  text-shadow: 3px 4px 0 rgba(255,226,161,0.7);
}

.age-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 5px;
}

.age-copy strong {
  font-size: 10px;
  letter-spacing: 2px;
}

.age-copy span {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: var(--ink-soft);
}

.hero-message {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin-top: 23px;
}

.scroll-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;

  margin-top: 42px;
}

.scroll-link span:first-child {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--ink-soft);
}

.scroll-arrow {
  font-size: 22px;
  color: #e39a94;
  animation: arrowBounce 1.8s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

.hero-footer {
  display: flex;
  justify-content: space-between;

  font-size: 8px;
  letter-spacing: 2px;
  color: #819db3;
}


/* =========================================
   GENERAL SECTIONS
========================================= */

.memories-section,
.letters-section {
  position: relative;
  padding: 105px 22px 80px;
}

.section-heading {
  max-width: 500px;
  margin: 0 auto 55px;
}

.section-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #7895aa;
}

.section-heading h2 {
  font-family: var(--serif);
  font-weight: 500;

  font-size: 53px;
  line-height: 1.08;
  letter-spacing: -2px;

  margin-top: 23px;
}

.section-heading h2 span {
  font-style: italic;
  color: #6eafd9;
}

.section-heading > p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-top: 18px;
}


/* =========================================
   SCRAPBOOK
========================================= */

.scrapbook {
  width: 100%;
  max-width: 480px;
  margin: auto;
  position: relative;
}

.photo {
  position: relative;
  width: 78%;
  margin-bottom: 80px;

  transform-origin: center;

  transition:
    transform 0.45s cubic-bezier(.2,.8,.2,1),
    filter 0.4s;

  cursor: pointer;
  z-index: 1;
}

/* PAPER */

.photo-paper {
  position: relative;

  background: rgba(255,255,255,0.94);

  padding: 10px 10px 38px;

  box-shadow:
    0 12px 32px rgba(65,111,150,0.13),
    0 3px 8px rgba(65,111,150,0.07);

  transition:
    box-shadow 0.4s,
    transform 0.45s;

  overflow: visible;
}

/* IMPORTANT:
   Images retain their natural height.
   No fixed image height.
   No forced aspect ratio.
   No cropping.
*/

.photo-paper img {
  display: block;
  width: 100%;
  height: auto;

  object-fit: contain;
  object-position: center;

  background: #e9f5ff;
}

/* PHOTO NUMBER */

.photo-index {
  position: absolute;
  bottom: 14px;
  right: 14px;

  font-size: 9px;
  letter-spacing: 2px;
  color: #7f9db5;
}

/* CAPTIONS */

.photo figcaption {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: #587c98;

  margin-top: 13px;
  padding-left: 4px;
}


/* DIFFERENT ANGLES */

.photo-one {
  margin-left: 3%;
  transform: rotate(-7deg);
}

.photo-two {
  width: 70%;
  margin-left: auto;
  margin-right: 0;
  transform: rotate(6deg);
}

.photo-three {
  width: 87%;
  margin-left: 6%;
  transform: rotate(-3deg);
}

.photo-four {
  width: 72%;
  margin-left: 0;
  transform: rotate(7deg);
}

.photo-five {
  width: 79%;
  margin-left: auto;
  margin-right: 3%;
  transform: rotate(-5deg);
}


/* ACTIVE PHOTO */

.photo.active-photo {
  transform: rotate(0deg) scale(1.035) !important;
  z-index: 30;
}

.photo.active-photo .photo-paper {
  box-shadow:
    0 25px 55px rgba(58,100,140,0.22),
    0 6px 18px rgba(58,100,140,0.1);
}


/* DESKTOP HOVER */

@media (hover: hover) and (pointer: fine) {

  .photo:hover {
    transform: rotate(0deg) scale(1.035);
    z-index: 30;
  }

  .photo:hover .photo-paper {
    box-shadow:
      0 25px 55px rgba(58,100,140,0.22),
      0 6px 18px rgba(58,100,140,0.1);
  }

}


/* SCRAPBOOK ENDING */

.memory-ending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  text-align: center;
  margin-top: 25px;
  padding: 25px 5px;
}

.memory-ending p {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #7792a8;
}

.memory-star {
  font-size: 23px;
  color: #eaa39b;
}


/* =========================================
   LETTERS
========================================= */

.letters-section {
  padding-top: 100px;
}

.letters {
  width: 100%;
  max-width: 560px;
  margin: auto;
}

.letter {
  position: relative;

  padding: 38px 27px 35px;
  margin-bottom: 65px;

  background: rgba(255,255,255,0.17);

  border-top: 1px solid rgba(102,147,180,0.28);
  border-bottom: 1px solid rgba(102,147,180,0.28);
}

.letter-mum {
  transform: rotate(-1deg);
}

.letter-aunt {
  transform: rotate(1deg);
}

.letter-bro {
  transform: rotate(-0.5deg);
}

.letter-label {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #829bb0;
}

.letter-quote {
  display: block;
  font-family: var(--serif);
  font-size: 77px;
  line-height: 0.8;

  margin-top: 28px;
  color: rgba(226,147,146,0.55);
}

.letter-content {
  position: relative;
  z-index: 2;
}

.letter-content p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.85;

  color: #345b79;
  margin-bottom: 18px;
}

.letter-signature {
  display: block;
  text-align: right;

  margin-top: 30px;

  font-family: var(--serif);
  font-style: italic;
  font-size: 23px;

  color: #df918e;
}


/* =========================================
   FINALE
========================================= */

.finale {
  position: relative;

  min-height: 90vh;
  min-height: 90svh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 85px 25px 35px;

  overflow: hidden;
}

.finale::before {
  content: "";

  position: absolute;
  inset: -20%;

  background:
    linear-gradient(
      135deg,
      transparent 20%,
      rgba(255,206,190,0.2) 45%,
      rgba(255,238,177,0.3) 65%,
      transparent 85%
    );

  transform: rotate(-8deg);
  pointer-events: none;
}

.finale > .section-kicker {
  text-align: center;
  position: relative;
  z-index: 2;
}

.finale-number {
  position: absolute;

  font-family: var(--serif);
  font-size: 300px;
  line-height: 1;

  color: rgba(255,255,255,0.36);

  top: 50%;
  right: -45px;
  transform: translateY(-50%);

  pointer-events: none;
}

.finale-content {
  max-width: 500px;
  width: 100%;

  margin: 65px auto;
  text-align: center;

  position: relative;
  z-index: 2;
}

.finale-small {
  font-size: 11px;
  letter-spacing: 4px;
  color: #dd918f;
  font-weight: 700;
}

.finale h2 {
  font-family: var(--serif);
  font-weight: 500;

  font-size: 70px;
  line-height: 0.98;
  letter-spacing: -2px;

  margin-top: 24px;
}

.finale h2 span {
  font-style: italic;
  color: #6baed8;
}

.finale-message {
  max-width: 350px;
  margin: 28px auto 0;

  font-size: 13px;
  line-height: 2;

  color: var(--ink-soft);
}

.finale-love {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;

  margin-top: 25px;
  color: #6487a3;
}

.celebrate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;

  margin-top: 42px;
  padding: 17px 26px;

  background: linear-gradient(
    110deg,
    rgba(255,255,255,0.8),
    rgba(255,238,191,0.7),
    rgba(255,215,211,0.65)
  );

  border: 1px solid rgba(218,159,150,0.4);

  color: #55758f;

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;

  cursor: pointer;

  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.celebrate-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(211,151,139,0.2);
}

.button-star {
  color: #e39b85;
  font-size: 17px;
}

.finale-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  font-size: 8px;
  letter-spacing: 1.5px;

  color: #8aa1b4;
}


/* =========================================
   END SCREEN
========================================= */

.birthday-end {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 25px;

  background:
    radial-gradient(
      ellipse at 25% 25%,
      rgba(255,255,255,0.8),
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 75%,
      rgba(255,222,168,0.65),
      transparent 50%
    ),
    linear-gradient(
      145deg,
      #eaf7ff,
      #d4edff,
      #ffe3de,
      #fff2cc
    );

  z-index: 1000;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.75s,
    visibility 0.75s;
}

.birthday-end.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.end-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.end-small {
  font-size: 9px;
  letter-spacing: 3px;
  color: #718da5;
}

.end-number {
  font-family: var(--serif);
  font-size: 145px;
  line-height: 1;

  color: rgba(239,170,151,0.38);

  margin-top: 25px;
}

.end-content h1 {
  font-family: var(--serif);
  font-size: 60px;
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -2px;

  margin-top: -30px;
}

.end-content h1 span {
  font-style: italic;
  color: #68a9d4;
}

.end-message {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-top: 25px;
}

.end-heart {
  font-size: 40px;
  color: #e79d95;

  margin: 35px 0;

  animation: heartPulse 2s ease-in-out infinite;
}

.replay-button {
  background: transparent;
  border: 0;

  font-size: 9px;
  letter-spacing: 2px;

  color: #718da5;
  padding: 15px;

  cursor: pointer;
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}


/* =========================================
   BALLOONS
========================================= */

.balloon-layer {
  position: fixed;
  inset: 0;

  overflow: hidden;
  pointer-events: none;

  z-index: 0;
}

.balloon {
  position: absolute;
  bottom: -130px;

  width: 28px;
  height: 37px;

  border-radius: 50% 50% 48% 48%;

  opacity: 0.45;

  animation: balloonRise linear forwards;
}

.balloon::after {
  content: "";

  position: absolute;

  width: 1px;
  height: 30px;

  background: rgba(91,129,160,0.4);

  top: 36px;
  left: 50%;
}

@keyframes balloonRise {
  from {
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  to {
    transform: translateY(-120vh) translateX(50px) rotate(18deg);
  }
}


/* =========================================
   CONFETTI
========================================= */

.confetti {
  position: fixed;
  top: -20px;

  z-index: 2000;
  pointer-events: none;

  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}


/* =========================================
   REVEAL
========================================= */

.reveal {
  opacity: 0;

  transition:
    opacity 0.8s ease,
    filter 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  filter: blur(0);
}


/* =========================================
   FOOTER
========================================= */

.site-footer {
  display: flex;
  justify-content: space-between;

  padding: 25px 22px 35px;

  font-size: 8px;
  letter-spacing: 2px;

  color: #829cb1;
}


/* =========================================
   DESKTOP
========================================= */

@media (min-width: 700px) {

  .hero {
    padding: 35px 55px;
  }

  .hero h1 {
    font-size: 130px;
  }

  .hero-content {
    padding: 70px 0;
  }

  .memories-section,
  .letters-section {
    padding: 130px 50px 100px;
  }

  .section-heading h2 {
    font-size: 75px;
  }

  .scrapbook {
    max-width: 900px;
    min-height: 1750px;
  }

  .photo {
    position: absolute;
    margin-bottom: 0;
  }

  .photo-one {
    width: 34%;
    top: 35px;
    left: 4%;
    margin: 0;
    transform: rotate(-8deg);
  }

  .photo-two {
    width: 31%;
    top: 120px;
    right: 4%;
    margin: 0;
    transform: rotate(7deg);
  }

  .photo-three {
    width: 40%;
    top: 500px;
    left: 30%;
    margin: 0;
    transform: rotate(-3deg);
  }

  .photo-four {
    width: 33%;
    top: 900px;
    left: 4%;
    margin: 0;
    transform: rotate(7deg);
  }

  .photo-five {
    width: 35%;
    top: 1200px;
    right: 4%;
    margin: 0;
    transform: rotate(-6deg);
  }

  .photo-paper {
    padding: 14px 14px 43px;
  }

  .letters {
    max-width: 680px;
  }

  .letter {
    padding: 50px 65px;
    margin-bottom: 85px;
  }

  .letter-content p {
    font-size: 21px;
  }

  .finale h2 {
    font-size: 105px;
  }

  .finale {
    padding-left: 60px;
    padding-right: 60px;
  }

}


/* =========================================
   SMALL PHONES
========================================= */

@media (max-width: 380px) {

  .hero h1 {
    font-size: 72px;
  }

  .section-heading h2 {
    font-size: 44px;
  }

  .photo {
    width: 82%;
  }

  .photo-two,
  .photo-four {
    width: 71%;
  }

  .finale h2 {
    font-size: 58px;
  }

  .end-content h1 {
    font-size: 50px;
  }

  .birthday-date {
    font-size: 7px;
    letter-spacing: 1px;
  }

}


/* =========================================
   MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

}
