/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #c5c0bf;
  font-family: "Times New Roman", serif;
  scroll-behavior: smooth;
}

/* ========== ANIMAȚII GENERALE ========== */
@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes pulseRotate {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.03) rotate(-2deg);
  }
  75% {
    transform: scale(1.03) rotate(2deg);
  }
}

@keyframes pulseFast {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpFadeSlow {
  from {
    opacity: 0;
    transform: translateY(150px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceUpDown {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ========== ANIMAȚIE PENTRU PERGAMENT - slide up de jos ========== */
@keyframes slideUpPergament {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 150px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ========== ANIMAȚIE INIMĂ MAI FINĂ ========== */
@keyframes heartbeat-strong-continuous {
  0%,
  5% {
    transform: scale(1);
  }
  2.5% {
    transform: scale(1.03);
  }
  10%,
  15% {
    transform: scale(1);
  }
  12.5% {
    transform: scale(1.03);
  }
  20%,
  25% {
    transform: scale(1);
  }
  22.5% {
    transform: scale(1.025);
  }
  30%,
  35% {
    transform: scale(1);
  }
  32.5% {
    transform: scale(1.025);
  }
  40%,
  45% {
    transform: scale(1);
  }
  42.5% {
    transform: scale(1.02);
  }
  50%,
  55% {
    transform: scale(1);
  }
  52.5% {
    transform: scale(1.02);
  }
  60%,
  65% {
    transform: scale(1);
  }
  62.5% {
    transform: scale(1.015);
  }
  70%,
  75% {
    transform: scale(1);
  }
  72.5% {
    transform: scale(1.015);
  }
  80%,
  85% {
    transform: scale(1);
  }
  82.5% {
    transform: scale(1.01);
  }
  90%,
  95% {
    transform: scale(1);
  }
  92.5% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

/* ========== ANIMAȚIE PENTRU TEXTELE DIN HÂRTII (LA SCROLL) ========== */
@keyframes slideUpPaperText {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== SECTION 1: TITLE ========== */
.title-section {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.title-image-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  animation: slideUpFade 1.2s ease-out;
}

.title-image {
  width: clamp(820px, 65vw, 1200px);
  height: auto;
  user-select: none;
  pointer-events: none;
  animation: slideUpFade 1.2s ease-out;
}

.cloud-left {
  position: absolute;
  top: -10px;
  left: -40px;
  width: 813px;
  opacity: 0.95;
  z-index: 2;
  pointer-events: none;
  animation: slideUpFade 1s ease-out 0.2s backwards;
}

.cloud-right {
  position: absolute;
  top: 294px;
  left: 886px;
  width: 900px;
  height: 594px;
  object-fit: cover;
  flex-shrink: 0;
  z-index: 2;
  animation: slideUpFade 1s ease-out 0.3s backwards;
}

.lantern {
  position: absolute;
  top: -68px;
  left: 1499px;
  width: 228px;
  height: 340px;
  object-fit: contain;
  flex-shrink: 0;
  z-index: 4;
  animation: slideUpFadeSlow 1.4s ease-out 0.4s backwards;
}

.letter {
  position: absolute;
  top: 314px;
  left: -83px;
  width: 701px;
  height: 701px;
  object-fit: contain;
  flex-shrink: 0;
  z-index: 2;
  animation: slideUpFadeSlow 1.4s ease-out 0.5s backwards;
}

.scroll-hint {
  position: absolute;
  bottom: 3vh;
  left: 40%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 3px;
  opacity: 0.8;
  z-index: 5;
  text-transform: uppercase;
  color: #390000;
  animation: slideUpFade 1s ease-out 0.8s backwards,
    bounceUpDown 2s ease-in-out 1.8s infinite;
}

/* ========== SECTION 2: QUOTE ========== */
.quote-section {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
  padding-bottom: 100px;
  background-color: #c5c0bf;
}

.quote-container {
  position: relative;
  width: 100%;
  height: 60vh;
}

.quote-text {
  position: absolute;
  top: 8%;
  left: 2.5%;
  font-size: 50px;
  font-family: "Inter", sans-serif;
  color: #1c1b1a;
  line-height: 1.3;
  z-index: 2;
  font-weight: 550;
  max-width: 900px;
}

.quote-text .highlight {
  font-family: "Abril Fatface", serif;
  font-weight: 700;
  color: #4a1f24;
  font-style: normal;
  font-size: 90px;
  line-height: 1.3;
}

/* TELEFON - animație continuă puternică */
.phone {
  position: absolute;
  bottom: -350px;
  left: -50px;
  width: 590px;
  height: auto;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  animation: heartbeat-strong-continuous 14s ease-in-out infinite;
}

/* CANDELABRU - animație continuă puternică */
.candelabru {
  position: absolute;
  top: 15%;
  right: -5%;
  width: 500px;
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  animation: heartbeat-strong-continuous 14s ease-in-out infinite;
}

/* CEAS - animație continuă puternică */
.clock {
  position: absolute;
  top: 8%;
  right: 8%;
  width: 350px;
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  animation: heartbeat-strong-continuous 30s ease-in-out infinite;
}

.story-text-inline {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
  text-align: center;
  z-index: 4;
  margin-top: 60px;
}

.story-main {
  font-family: "Abril Fatface", serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.5;
  color: #1c1b1a;
  text-align: left;
  padding-left: 92px;
}

.story-sub {
  font-family: "Abril Fatface", serif;
  font-size: 24px;
  font-weight: 550;
  line-height: 1.2;
  color: #1c1b1a;
  width: 100vw;
  max-width: 100vw;
  white-space: nowrap;
  position: relative;
  top: 150px;
  right: 500px;
}

.line-1 {
  display: block;
}

.line-2 {
  display: block;
  white-space: normal;
}

.story-papers {
  position: relative;
  width: 100%;
  min-height: 150vh;
  overflow: visible;
  padding-bottom: 100px;
  background-color: #c5c0bf;
}

.paper {
  position: absolute;
  width: 750px;
  height: 380px;
  z-index: 3;
}

.paper-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  top: 75px;
}

.paper-text {
  position: relative;
  z-index: 2;
  padding: 150px 120px 70px 120px;
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 545;
  line-height: 1.3;
  color: #1a1a1a;
  opacity: 0;
  transform: translateY(100px);
  transition: all 1.5s ease-out;
}

.paper-left .paper-text {
  padding-top: 120px;
}

.paper-text.visible {
  opacity: 1;
  transform: translateY(0);
}

.paper-left .paper-text.visible {
  transition-delay: 0.3s;
}

.paper-right .paper-text.visible {
  transition-delay: 0.6s;
}

.paper-left {
  top: 500px;
  left: -1%;
}

.paper-right {
  z-index: 10;
  bottom: 100px;
  right: 2%;
}

.decor {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.lantern-left {
  position: absolute;
  bottom: -90px;
  left: -1%;
  width: 300px;
  height: auto;
  animation: heartbeat-strong-continuous 15s ease-in-out infinite;
}

.gramophone-right {
  position: absolute;
  bottom: 23%;
  left: 57%;
  width: 730px;
  height: auto;
  z-index: 10;
  animation: heartbeat-strong-continuous 15s ease-in-out infinite;
}

.house-final {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible;
  padding: 100px 20px;
  background-color: #c5c0bf;
}

.main-house {
  width: 800px;
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 1;
}

.start-story {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.start-story img {
  width: 360px;
  height: auto;
  display: block;
  margin-top: 20%;
}

.start-story:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
  transition: 0.3s ease;
}

.clue-card {
  position: absolute;
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  transition: transform 0.3s ease;
}

.clue-card:hover {
  transform: scale(1.05);
  z-index: 10;
}

.clue-wrapper {
  position: relative;
  width: 200px;
  cursor: pointer;
}

.pergament-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.pergament-img:hover {
  transform: scale(1.05);
}

.clue-text {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  text-align: center;
  font-family: "Abril Fatface", serif;
  font-size: 15px;
  line-height: 1.4;
  color: #4a1f24;
  font-weight: 990;
  padding: 8px;
}

.indicator {
  position: absolute;
  width: 33px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #333;
  z-index: 3;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #333;
}

.clue-1 {
  top: 18%;
  right: 25%;
}

.clue-2 {
  bottom: 27%;
  left: 20%;
}

.clue-3 {
  bottom: 19%;
  right: 19%;
}

.indicator-1 {
  top: 40%;
  right: 37%;
}

.indicator-2 {
  bottom: 40%;
  left: 32%;
}

.indicator-3 {
  bottom: 42%;
  right: 33%;
}

@media (max-width: 1400px) {
  .cloud-right {
    left: 700px;
  }

  .lantern {
    left: 1200px;
  }
}

@media (max-width: 1200px) {
  .title-image {
    width: clamp(600px, 70vw, 900px);
  }

  .cloud-left {
    width: 600px;
  }

  .cloud-right {
    width: 700px;
    left: 500px;
  }

  .lantern {
    width: 180px;
    left: 1000px;
  }

  .letter {
    width: 550px;
  }

  .quote-text {
    font-size: 40px;
    max-width: 700px;
  }

  .quote-text .highlight {
    font-size: 70px;
  }

  .phone {
    width: 400px;
    left: -30px;
  }

  .candelabru {
    width: 280px;
  }

  .story-main {
    font-size: 22px;
  }

  .story-sub {
    font-size: 16px;
  }

  .paper {
    width: 600px;
    height: 320px;
  }

  .paper-text {
    font-size: 20px;
    padding: 60px 100px;
  }

  .gramophone-right {
    width: 450px;
  }

  .lantern-left {
    width: 250px;
  }
}

@media (max-width: 768px) {
  .title-image {
    width: 90%;
    min-width: 400px;
  }

  .cloud-left {
    width: 400px;
    left: -20px;
  }

  .cloud-right {
    width: 500px;
    left: 300px;
    top: 200px;
  }

  .lantern {
    width: 120px;
    left: auto;
    right: 50px;
    top: 20px;
  }

  .letter {
    width: 400px;
    top: 250px;
  }

  .quote-text {
    font-size: 32px;
    left: 5%;
    max-width: 600px;
  }

  .quote-text .highlight {
    font-size: 55px;
  }

  .phone {
    width: 600px;
    bottom: -5px;
    left: -20px;
  }

  .candelabru {
    width: 200px;
    right: 5%;
  }

  .story-text-inline {
    padding: 0 20px;
    margin-top: 40px;
  }

  .story-main {
    font-size: 18px;
  }

  .story-sub {
    font-size: 15px;
  }

  .paper {
    width: 450px;
    height: 240px;
  }

  .paper-text {
    font-size: 16px;
    padding: 40px 60px;
  }

  .paper-left {
    top: 150px;
    left: 5%;
  }

  .paper-right {
    bottom: 250px;
    right: 5%;
  }

  .lantern-left {
    width: 180px;
    bottom: 450px;
  }

  .gramophone-right {
    width: 300px;
    bottom: 30%;
  }

  .main-house {
    width: 300px;
  }

  .pergament-img {
    width: 110px;
  }

  .start-story img {
    width: 280px;
  }
}

@media (max-width: 480px) {
  .title-image {
    width: 95%;
    min-width: 300px;
  }

  .cloud-left,
  .cloud-right {
    width: 300px;
  }

  .lantern {
    width: 80px;
  }

  .letter {
    width: 300px;
  }

  .quote-text {
    font-size: 24px;
  }

  .quote-text .highlight {
    font-size: 40px;
  }

  .phone {
    width: 200px;
    left: -10px;
  }

  .candelabru {
    width: 150px;
  }

  .story-main {
    font-size: 16px;
  }

  .story-sub {
    font-size: 14px;
  }

  .paper {
    width: 320px;
    height: 200px;
  }

  .paper-text {
    font-size: 13px;
    padding: 30px 40px;
  }

  .lantern-left {
    width: 120px;
  }

  .gramophone-right {
    width: 200px;
  }

  .pergament-img {
    width: 90px;
  }

  .start-story img {
    width: 200px;
  }
}

.house-with-pergament {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.simple-pergament {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 400px;
  display: none;
  z-index: 10;
}

.simple-pergament.visible {
  display: block;
  animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.simple-pergament-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.simple-pergament-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 70%;
  padding: 40px;
  color: #2d1f10;
  font-family: "Georgia", serif;
  text-align: center;
  overflow: hidden;
}

.simple-pergament-content h3 {
  font-size: 28px;
  color: #3d2817;
  margin-bottom: 15px;
  font-weight: bold;
}

.simple-pergament-content p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.close-simple-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #8b7355;
  font-size: 30px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-simple-btn:hover {
  color: #6d5940;
  background: rgba(139, 115, 85, 0.1);
  transform: scale(1.1);
}

.toggle-pergament-btn {
  margin-top: 30px;
  padding: 12px 30px;
  background: #8b7355;
  border: 2px solid #ffd700;
  color: #ffd700;
  font-family: "Georgia", serif;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  z-index: 5;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.toggle-pergament-btn:hover {
  background: #a1886b;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .simple-pergament {
    width: 400px;
    height: 320px;
  }

  .simple-pergament-content {
    padding: 30px;
  }

  .simple-pergament-content h3 {
    font-size: 24px;
  }

  .simple-pergament-content p {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .simple-pergament {
    width: 300px;
    height: 240px;
  }

  .simple-pergament-content {
    padding: 20px;
  }

  .simple-pergament-content h3 {
    font-size: 20px;
  }

  .simple-pergament-content p {
    font-size: 14px;
  }

  .toggle-pergament-btn {
    padding: 10px 20px;
    font-size: 16px;
  }
}

/* Section 5: A doua casă cu pergament - CU ANIMAȚIE SLIDE-UP */
.second-house {
  position: relative;
}

.house-with-pergament {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.house-with-pergament .main-house {
  width: 800px;
  max-width: 90%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Pergamentul peste casă - CU ANIMAȚIE */
.pergament-over-house {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-width: 85%;
  height: 600px;
  z-index: 10;
  /* ANIMAȚIA SLIDEUP DE JOS */
  animation: slideUpPergament 3.5s ease-out;
}

.pergament-img-overlay {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7));
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.pergament-text-overlay {
  position: absolute;
  top: 10%;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  max-height: 250px;
  overflow: visible;
  padding: 20px;
  font-family: "Abril Fatface", serif;
  font-size: 20px;
  line-height: 1.4;
  color: #2d1f10;
  text-align: center;
  z-index: 20;
  font-weight: 600;
  color: #1c1b1a;
}

.pergament-text-overlay p {
  margin-bottom: 12px;
  font-size: 24px;
  color: #3d2817;
  line-height: 1.4;
}
