:root {
  --espresso: #1a110a;
  --coffee: #2a1d10;
  --mocha: #5d4030;
  --latte: #8b6f4e;
  --caramel: #c89968;
  --cream: #d4b896;
  --foam: #ede0c8;
  --poster-aspect: 3240 / 4050;
}

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

html,
body {
  min-height: 100vh;
}

body {
  font-family: 'Cormorant', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--foam);
  background-color: var(--espresso);
  background-image: url('assets/background_image.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(26, 17, 10, 0.35) 0%, rgba(26, 17, 10, 0.75) 100%),
    linear-gradient(180deg, rgba(26, 17, 10, 0.4) 0%, rgba(26, 17, 10, 0.65) 100%);
  z-index: 0;
  pointer-events: none;
}

.site-header,
main {
  position: relative;
  z-index: 1;
}

.site-header {
  text-align: center;
  padding: 4rem 2rem 1.5rem;
}

.site-header h1 {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--foam);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem 1.5rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}

.poster-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Flip card */
.poster-card {
  width: 100%;
  max-width: 460px;
  aspect-ratio: var(--poster-aspect);
  perspective: 1800px;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.poster-card:focus-visible {
  outline: 2px solid var(--caramel);
  outline-offset: 8px;
}

.poster-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.poster-card.flipped .poster-card__inner {
  transform: rotateY(180deg);
}

.poster-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(212, 184, 150, 0.25);
}

.poster-card__face--front {
  background: var(--coffee);
}

.poster-card__face--front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-card__face--back {
  transform: rotateY(180deg);
  background:
    linear-gradient(180deg, rgba(26, 17, 10, 0.0) 0%, rgba(26, 17, 10, 0.25) 100%),
    var(--coffee);
}

.poster-card__back-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2rem 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--mocha) transparent;
}

.poster-card__back-content::-webkit-scrollbar {
  width: 6px;
}

.poster-card__back-content::-webkit-scrollbar-track {
  background: transparent;
}

.poster-card__back-content::-webkit-scrollbar-thumb {
  background: var(--mocha);
  border-radius: 3px;
}

.poster-card__back-content::-webkit-scrollbar-thumb:hover {
  background: var(--latte);
}

.poster-card__back-content h2 {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
  color: var(--foam);
  letter-spacing: 0.03em;
  text-align: center;
}

.poster-card__back-content p {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--cream);
  margin-bottom: 1rem;
}

.poster-card__back-content p:last-of-type {
  margin-bottom: 0;
}

/* Hint */
.poster-hint {
  font-size: 1rem;
  color: var(--cream);
  opacity: 0.75;
  font-style: italic;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  text-align: center;
  min-height: 1.5em;
}

.poster-hint__back {
  display: none;
}

.poster-card.flipped ~ .poster-hint .poster-hint__front {
  display: none;
}

.poster-card.flipped ~ .poster-hint .poster-hint__back {
  display: inline;
}

/* Socials */
.socials {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.socials a {
  color: var(--cream);
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 184, 150, 0.3);
  border-radius: 50%;
  background: rgba(26, 17, 10, 0.45);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease,
    background-color 0.3s ease, transform 0.3s ease;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--foam);
  border-color: var(--caramel);
  background: rgba(200, 153, 104, 0.18);
  transform: translateY(-3px);
  outline: none;
}

.socials svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Mobile */
@media (max-width: 600px) {
  .site-header {
    padding: 2.5rem 1rem 1rem;
  }

  main {
    padding: 1rem 1rem 3rem;
    gap: 2rem;
  }

  .poster-card__back-content {
    padding: 1.5rem 1.25rem;
  }

  .poster-card__back-content p {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
