/* ───────────────────────────────────────────────────────────
   LANDING OVERLAY
   ─────────────────────────────────────────────────────────── */
#landing {
  position: fixed;
  inset: 0;
  background-color: var(--landing-gray);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
}
#landing::before {
  content: "";
  position: absolute;
  inset: -64px; /* avoid edge halo during blur */
  background: var(--landing-gray);
  z-index: -1;
}
#enter-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#teapot-icon { width: 120px; transition: transform .2s ease; }
#teapot-icon:hover { transform: scale(1.1); }
#enter-text {
  margin-top: 8px; font-size: 1rem; color: var(--text-nearly-black);
  letter-spacing: 1px; text-decoration: underline;
}
.fade-out { animation: fadeOut .4s forwards; }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
#landing.dissolve-out { animation: landingDissolve 420ms ease forwards; will-change: opacity, filter; }
@keyframes landingDissolve { from { opacity:1; filter:blur(0); } to { opacity:0; filter:blur(10px); visibility:hidden; } }
body.no-scroll { overflow: hidden !important; }

/* ───────────────────────────────────────────────────────────
   VIDEO BANNER (hero)
   ─────────────────────────────────────────────────────────── */
:root { --nav-h: 60px; }

.video-banner {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--nav-h));   /* fallback */
  margin-top: var(--nav-h);
  overflow: hidden;
}
@supports (height: 100dvh) {
  .video-banner { height: calc(100dvh - var(--nav-h)); }
}
@supports (height: 100svh) {
  .video-banner { height: calc(100svh - var(--nav-h)); }
}

.banner-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: contrast(1.1) brightness(0.45);
}

/* Overlay defaults (desktop/tablet): center-center */
.video-overlay {
  position: absolute;
  inset: 0;                    /* let us center with grid */
  display: grid;
  place-items: center;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 1rem;
  box-sizing: border-box;
}
.video-overlay h1 {
  font-family: var(--font-heading);
  font-size: clamp(0.1rem, 2vw, 1rem);
  line-height: 1.25;
  margin: 0;
  color: orange;
  white-space: normal;         /* allow wrap */
}

/* Grain overlay */
.video-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: url('Pictures/grain.png') repeat;
  opacity: .15; pointer-events: none; mix-blend-mode: overlay;
  z-index: 2;
}

/* Phones: keep overlay centered (not bottom), account for safe areas */
@media (max-width: 600px) {
  .video-banner {
    display: grid;
    place-items: center;
    padding: 0 16px max(16px, env(safe-area-inset-bottom));
  }
  .video-overlay {
    position: static;          /* in-flow so it centers with the grid */
    transform: none;
    max-width: 90%;
    width: 100%;
  }
  .video-overlay h1 {
    font-size: clamp(0.25rem, 2vw, 1rem);
    line-height: 1.35;
  }
  .banner-video { filter: contrast(1.1) brightness(0.42); }
}

/* ───────────────────────────────────────────────────────────
   CARD GRID (3-up on desktop → responsive)
   ─────────────────────────────────────────────────────────── */
.card-grid {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.card {
  position: relative;
  flex: 1 1 33.333%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.card img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.card .title {
  position: absolute; top: 1rem; left: 1rem;
  z-index: 3; color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 4vw, 2rem);
  line-height: 1.1; text-transform: uppercase;
  word-break: break-word;
}

.card::after {
  content: ""; position: absolute; inset: 0;
  box-sizing: border-box; border: 12px solid #fff;
  opacity: 0; transition: opacity .3s ease; pointer-events: none; z-index: 10;
}
.card:hover::after { opacity: 1; }

/* Card grid responsive: 2-up on tablets, 1-up on phones */
@media (max-width: 900px) {
  .card { flex: 1 1 50%; }
}
@media (max-width: 600px) {
  .card { flex: 1 1 100%; }
}

/* ───────────────────────────────────────────────────────────
   Accessibility / motion
   ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fade-out, #landing.dissolve-out,
  .card::after { animation: none !important; transition: none !important; }
}
