/* ===== BASE ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: url("silo.jpg") center center / cover no-repeat fixed;
  background-color: #000;
  font-family: serif;
  overflow-x: hidden;
}

/* page container — anchored bottom */
.overlay {
  min-height: 100vh;
  padding: 40px 16px 200px; /* space for hay bale */
  box-sizing: border-box;
  position: relative;
}

.content {
  max-width: 800px;
  margin: 0 auto;
  color: #eee;
  text-align: center;
  position: relative;
}

/* ===== LOGO ===== */
.logo {
  display: block;
  margin: 0 auto 26px;
  max-width: 420px;
  width: 100%;
  height: auto;
  animation: breathe 6.5s ease-in-out infinite, flicker 5.1s infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

@keyframes flicker {
  0%   { opacity: 0.95; }
  7%   { opacity: 0.85; }
  10%  { opacity: 0.98; }
  18%  { opacity: 0.90; }
  21%  { opacity: 0.99; }
  35%  { opacity: 0.88; }
  42%  { opacity: 0.97; }
  55%  { opacity: 0.92; }
  61%  { opacity: 0.99; }
  72%  { opacity: 0.86; }
  85%  { opacity: 0.98; }
  100% { opacity: 0.95; }
}

/* ===== TEXT ===== */
p {
  line-height: 1.6;
  text-align: left;
  color: #eee;
}

/* ===== PHOTO FRAMES ===== */
.photo-frame {
  margin: 26px auto;
  padding: 12px;
  background: rgba(20, 20, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 20px rgba(0,0,0,0.8),
    inset 0 0 30px rgba(0,0,0,0.6);
}

.photo-frame.foggy {
  position: relative;
  overflow: hidden;
}

.photo-frame.foggy .main-photo {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.04) brightness(0.96);
}

.photo-frame.foggy .fog-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(0.3px);
}

/* ===== TINY BEAR DIVIDER ===== */
.bear-divider {
  display: block;
  width: min(110px, 40vw);
  height: auto;
  margin: 14px auto 18px;
  opacity: 0.85;
  mix-blend-mode: lighten;
  filter: brightness(1.1) contrast(1.03);
  pointer-events: none;
}

/* ===== BACK HAY BUTTON ===== */
.back-hay {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 6;
  text-decoration: none;
}

.back-hay img {
  width: 180px;
  max-width: 60vw;
  height: auto;
  display: block;
  filter: contrast(1.05) brightness(0.95);
}

/* text overlay — slightly lower */
.back-hay span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 42px;
  letter-spacing: 1px;

  color: #eee;
  transform: translateY(14px);

  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.7);

  mix-blend-mode: lighten;
  pointer-events: none;
}

/* ===== BOTTOM FOG ===== */
.page-fog {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 120%;
  opacity: 0.65;
  pointer-events: none;
  z-index: 4;
  transform: translateX(-10%);
  mix-blend-mode: screen;
  filter: blur(0.4px);
}

/* ===== FILM GRAIN ===== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background:
    repeating-radial-gradient(circle at 20% 30%,
      rgba(255,255,255,0.06) 0 1px,
      rgba(0,0,0,0.06) 1px 2px),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.03) 0 1px,
      rgba(0,0,0,0.03) 1px 2px);
  animation: grainShift 2.2s steps(2, end) infinite;
}

@keyframes grainShift {
  0%   { transform: translate3d(0,0,0); }
  25%  { transform: translate3d(-1%, 1%, 0); }
  50%  { transform: translate3d(1%, -1%, 0); }
  75%  { transform: translate3d(-1%, -1%, 0); }
  100% { transform: translate3d(0,0,0); }
}
