/* =========================================
   RareSlate — Styles (clean)
   ========================================= */

/* ---------------------
   1) CSS Variables/Base
   --------------------- */
:root{
  --tilt-max: 8;          /* degrees of max tilt */
  --parallax: 20;         /* px background shift */
  --shadow: 22px;         /* drop-shadow intensity */
}

html, body { height: 100%; margin: 0; }
body {
  font-family: Arial, sans-serif;
  color: #fff;
  background: #000;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* --------------------------------
   2) Scene & Background (parallax)
   -------------------------------- */
.scene {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 900px;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: -2rem;
  background: url("/img/777-BACKGROUND-1920.jpg") no-repeat center/cover;
  transform: translate3d(var(--tx,0), var(--ty,0), 0);
  will-change: transform, opacity;
  transition: transform 110ms linear;
  filter: saturate(1.02) contrast(1.02);
  opacity: 0.9;
  animation: fadeInBg 30.5s ease-in-out forwards;
}

/* Fallback hint if bg image fails */
#bg-hint {
  position: fixed;
  bottom: 10px; left: 10px;
  font-size: 10px; opacity: 0.6; display: none;
}
.no-bg #bg-hint { display: block; }

/* ------------------------
   3) Foreground Content
   ------------------------ */
.card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  will-change: transform;
  transition: transform 110ms linear;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform-style: preserve-3d;
}

.logo {
  width: 220px;
  max-width: 70%;
  transform: translateZ(60px);
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.5));
  animation: fadeIn 10.5s;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

h1 {
  text-align: center;
  font-size: 2rem;
  line-height: 1.3;
  text-shadow: 0 10px var(--shadow) rgba(0,0,0,0.45);
  margin: 0 1rem;
  transform: translateZ(50px);
  animation: fadeIn 10.5s;
}

footer {
  position: fixed; left: 0; right: 0; bottom: 10px;
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.85;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  transform: translateZ(30px);
  /* Optional: keep some horizontal padding; don't add bottom padding here */
  padding: 0 12px;
  /* Keep your fade behavior if you want */
  transition: opacity 3.2s ease;
  animation: fadeIn 10.5s;
  pointer-events: auto;
  z-index: 5;
  user-select: none;
}
footer a {
  color: inherit;
  text-decoration: underline;
  pointer-events: auto;
  cursor: pointer;
}

/* ----------------------------
   4) Notify (email capture)
   ---------------------------- */
/* Fade in slightly after logo/headline; stay visible (forwards). */
.notify-block {
  margin-top: .75rem;
  text-align: center;
  opacity: 0;                             /* start invisible */
  animation: fadeIn 10.5s ease forwards;  /* keep final opacity */
  animation-delay: 1.2s;                  /* slight delay vs. logo/h1 */
  transform: translateZ(50px);            /* same plane as h1 */
  will-change: transform, opacity;
}

/* Stack form and thanks in the exact same spot */
.notify-swap {
  display: grid;
  place-items: center;
}
.notify-form,
.notify-thanks {
  grid-area: 1 / 1;     /* overlap in the same grid cell */
  margin: 0;
  transform: translateZ(50px); /* keep parallax in sync with h1/logo */
}

/* Form */
.notify-form {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
/* Default everywhere */
.notify-form input[type="email"] {
  width: 260px;                  /* compact baseline */
  max-width: 100%;               /* safety net */
  padding: .5rem .6rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  outline: none;
}

/* Portrait mobile: shrink a bit */
@media (max-width: 480px) {
  .notify-form input[type="email"] {
    width: 70vw;                  /* relative to screen */
    max-width: 220px;             /* hard cap */
  }
}

/* Landscape mobile: shrink more */
@media (max-height: 420px) and (orientation: landscape) {
  .notify-form input[type="email"] {
    width: 60vw;
    max-width: 200px;
  }
}
.notify-form input[type="email"]::placeholder{ color: rgba(255,255,255,.6); }
.notify-form input[type="email"]:focus{
  border-color: rgba(255,255,255,.45);
  box-shadow: 0 0 0 3px rgba(255,255,255,.12);
}
.notify-form button{
  padding: .5rem .8rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color:#fff; cursor:pointer;
}
.notify-form button:hover{ background: rgba(255,255,255,.18); }
.notify-form button:disabled{ opacity:.6; cursor: default; }
.notify-msg { margin: .25rem 0 0; font-size: .85rem; opacity: .9; min-height: 1.2em; }

/* Thank-you message (hidden until success; JS toggles visibility) */
.notify-thanks { opacity: 0; font-size: .95rem; }

/* Cross-fade classes for notify swap (opacity only; no translate) */
.swap-in  { animation: fadeOnlyIn  .6s ease forwards; }
.swap-out { animation: fadeOnlyOut .6s ease forwards; }
@keyframes fadeOnlyIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOnlyOut { from { opacity: 1; } to { opacity: 0; } }

/* A11y helper */
.sr-only{
  position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(1px,1px,1px,1px); white-space:nowrap;
}

/* --------------------------
   5) Keyframes (shared)
   -------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes fadeInBg {
  0%   { opacity: 1; }
  30%  { opacity: 0.5; }
  100% { opacity: 0.9; }
}

@keyframes fadeInBgLoop {
  0%   { opacity: 0.9; }
  50%  { opacity: 0.5; }
  100% { opacity: 0.9; }
}

/* (kept for any legacy fade classes you might still reference) */
@keyframes playerFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes playerFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
.fade-in   { animation: playerFade 0.6s ease forwards; }
.fade-out  { animation: playerFadeOut 0.6s ease forwards; }

/* --------------------------
   6) Reduced Motion
   -------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bg, .card { transition: none !important; animation: none !important; }
  .card { transform: none !important; }
  .bg { transform: none !important; opacity: 1 !important; }
  .marquee__inner { animation: none !important; transform: none !important; }
}

/* --------------------------
   7) Optional bg click guard
   -------------------------- */
.bg-guard {
  position: fixed;
  inset: 0;
  z-index: 1;             /* below foreground but above .bg */
  background: transparent;
  pointer-events: none;
}
.protect .bg-guard { pointer-events: auto; }

/* --------------------------
   8) Watermark overlay
   -------------------------- */
.watermark::before {
  content: "RARESLATE  •  REXOVAS";
  position: fixed;
  inset: 0;
  z-index: 2;                 /* above bg, below foreground */
  pointer-events: none;
  opacity: 0.06;
  font: 700 16px/1.6 Arial, sans-serif;
  color: #fff;
  mix-blend-mode: overlay;
  background:
    repeating-linear-gradient(45deg, transparent 0 180px, currentColor 180px 181px, transparent 181px 360px);
}

/* -------------------------------------------
   9) Responsive
   ------------------------------------------- */
@media (max-width: 600px), (pointer: coarse) and (max-width: 800px){
  .notify-form input[type="email"]{ width: min(92vw, 520px); }
}

/* Small touch devices in LANDSCAPE: shrink headline + logo */
@media (pointer: coarse) and (max-width: 800px) and (orientation: landscape) {
  .logo {
    width: 300px;
    max-width: 50%;
  }
  h1 {
    font-size: 1.5rem;
    line-height: 1.2;
  }
}

/* Footer fade-out trigger (set by JS on mobile if needed) */
@media (max-width: 600px), (pointer: coarse) and (max-width: 800px) {
  body.footer-hidden footer {
    opacity: 0;
    pointer-events: none;
  }
}

/* ----------- */

/* Phones in LANDSCAPE (short height) — tighten hero + form */
@media (orientation: landscape) and (max-height: 480px) {
  .card-content { gap: .55rem; }

  .logo {
    width: 150px !important;    /* force smaller than 220px base */
    max-width: none !important;  /* ignore the 70% cap from base */
  }

  h1 {
    font-size: 1.05rem !important;
    line-height: 1.18;
    margin: 0 .6rem;
  }

  /* Make the email input compact too so it doesn't collide with footer */
  .notify-form input[type="email"] {
    width: 50vw;
    max-width: 200px;
  }
}
