/* =========================================================
   RESET & GLOBAL
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body,
html {
  font-family: 'Work Sans', sans-serif;
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: transparent;
}

/* =========================================================
   VISUALLY HIDDEN (SEO)
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   BACKGROUND VIDEO
   ========================================================= */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  background-color: black;
}

/* =========================================================
   POSTCARD CONTAINER
   ========================================================= */
.postcard {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 1100px;
  max-width: 95%;
  border-radius: 28px;
  background: #fcfcfc;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.32),
    inset 0 0 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  opacity: 0;
  animation: fadeSlide 1s ease forwards, flicker 1.5s infinite;
}

/* =========================================================
   LEFT COLUMN
   ========================================================= */
.left-col {
  width: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  z-index: 2;
  background: linear-gradient(
    135deg,
    rgba(130, 255, 142, 0.85),
    rgba(125, 190, 227, 0.85)
  );
  border-radius: 28px 0 0 28px;
  overflow: hidden;
}

.left-col::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url('noise-texture.png');
  background-size: cover;
  mix-blend-mode: soft-light;
  border-radius: 28px 0 0 28px;
}

/* =========================================================
   PHOTO CONTAINER
   ========================================================= */
.photo-container {
  position: relative;
  max-width: 220px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  z-index: 3;
  isolation: isolate;
}

.photo-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.photo-container img.profile-pic {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 28px;
}

/* =========================================================
   PAUSE INDICATOR
   ========================================================= */
#photo-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Courier New', Courier, monospace;
  font-size: 5em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    1px 0 0 rgba(255, 255, 255, 0.6),
    -1px 0 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 9999;
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  opacity: 0;
}

@keyframes flickerPause {
  0% { opacity: 0.85; transform: translate(-50%, -50%) translateX(0); }
  20% { opacity: 0.9; transform: translate(-50%, -50%) translateX(-1px); }
  40% { opacity: 0.88; transform: translate(-50%, -50%) translateX(1px); }
  60% { opacity: 0.86; transform: translate(-50%, -50%) translateX(-1px); }
  80% { opacity: 0.89; transform: translate(-50%, -50%) translateX(1px); }
  100% { opacity: 0.85; transform: translate(-50%, -50%) translateX(0); }
}

/* =========================================================
   PHOTO TEXT
   ========================================================= */
.photo-text {
  position: absolute;
  bottom: 14px;
  right: 24px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 4;
}

/* =========================================================
   RIGHT COLUMN
   ========================================================= */
.right-col {
  width: 70%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.right-col::before,
.right-col::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.right-col::before {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.03) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.right-col::after {
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.04),
    rgba(0, 255, 0, 0.03),
    rgba(0, 0, 255, 0.04)
  );
  mix-blend-mode: screen;
  animation: glitchAnim 2s infinite;
}

/* =========================================================
   RIGHT-TOP TEXT
   ========================================================= */
.right-top {
  display: flex;
  flex-direction: column;
  margin-bottom: 48px;
}

.right-top img.handwritten {
  width: 480px;
  max-width: 90%;
  margin-bottom: 16px;
}

/* =========================================================
   TEXT STYLING
   ========================================================= */
.right-top h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.right-top p {
  font-size: 1.1rem;
  color: #333;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* =========================================================
   ICON BUTTONS
   ========================================================= */
.icon-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.icon-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #333;
  border: 2px solid rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: transform 0.2s ease,
              background 0.3s ease,
              color 0.3s ease;
}

.icon-buttons a:hover {
  transform: scale(1.1);
  background: linear-gradient(
    135deg,
    rgba(125, 190, 227, 0.85),
    rgba(130, 255, 142, 0.85)
  );
  color: #fff;
  border-color: rgba(0, 0, 0, 0.5);
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeSlide {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  10%, 30%, 50%, 70%, 90% { opacity: 0.95; }
  20%, 40%, 60%, 80% { opacity: 0.97; }
}

@keyframes glitchAnim {
  0% { transform: translateX(0px); opacity: 0.05; }
  20% { transform: translateX(-2px); opacity: 0.08; }
  40% { transform: translateX(2px); opacity: 0.06; }
  60% { transform: translateX(-1px); opacity: 0.07; }
  80% { transform: translateX(1px); opacity: 0.05; }
  100% { transform: translateX(0px); opacity: 0.05; }
}

/* =========================================================
   RESPONSIVE (TABLET & MOBILE)
   ========================================================= */
@media (max-width: 1024px) {
  body { align-items: flex-start; }

  .postcard {
    flex-direction: column;
    width: 95%;
    margin-top: 40px;
  }

  .left-col {
    width: 100%;
    padding: 24px;
    border-radius: 28px 28px 0 0; /* top corners only */
  }

  .photo-container { margin: 0 auto; }

  .right-col {
    width: 100%;
    padding: 24px;
    align-items: center;
    text-align: center;
  }

  .right-top img.handwritten { margin: 0 auto 12px auto; }

  .right-top h1 { font-size: 1.2rem; margin-bottom: 16px; }

  .right-top p { font-size: 1rem; line-height: 1.6; margin-bottom: 20px; }

  .icon-buttons { justify-content: center; }

  .icon-buttons a { width: 46px; height: 46px; }
}

/* =========================================================
   SMALLER SCREENS (PHONES)
   ========================================================= */
@media (max-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px; /* buffer around postcard */
    flex-direction: column;
  }

  .postcard {
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    transform: scale(0.92);
    transform-origin: center top;
    /* Keep original rounded corners from desktop; do not override */
  }

  /* LEFT COLUMN TOP SECTION */
  .left-col {
    width: 100%;
    padding: 2.2em;
    border-radius: 20px 20px 0 0; /* top-left & top-right rounded, bottom corners straight */
  }

  .left-col::before {
    border-radius: 20px 20px 0 0;
  }

  .photo-container {
    max-width: 180px;
    margin: 0 auto;
  }

  .right-col {
    width: 100%;
    padding: 2.2em;
    text-align: center;
  }

  .right-top img.handwritten {
    display: block;
    margin: 0 auto 16px auto;
    width: 90%;
    max-width: 480px;
    height: auto;
  }

  .right-top h1 {
    font-size: 1rem;
    margin-bottom: 14px;
  }

  .right-top p {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 20px;
  }

  /* ICON BUTTONS */
  .icon-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: none;
    margin: 0 auto;
  }

  .icon-buttons a {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* =========================================================
   EXTRA SMALL SCREENS (NARROW PHONES)
   ========================================================= */
@media (max-width: 480px) {
  body {
    padding: 60px 26px; /* extra buffer */
  }

  .postcard {
    transform: scale(0.88);
    max-width: 500px;
    /* Keep desktop rounded corners intact */
  }

  .left-col {
    padding: 2em;
    border-radius: 16px 16px 0 0; /* top corners rounded, bottom corners straight */
  }

  .left-col::before {
    border-radius: 16px 16px 0 0;
  }

  .photo-container {
    max-width: 160px;
  }

  .right-col {
    padding: 2em;
  }

  .right-top img.handwritten {
    width: 90%;
    max-width: 480px;
    height: auto;
    margin: 0 auto 16px auto;
    display: block;
  }

  .right-top h1 {
    font-size: 0.95rem;
  }

  .right-top p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .icon-buttons {
    gap: 10px;
    margin: 0 auto;
  }

  .icon-buttons a {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }
}
