/* ============================================================
   Spooky Browser homepage — matches in-app landing visual style
   ============================================================ */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: linear-gradient(180deg, #1a1625 0%, #0d0b12 60%, #000 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ---------------- Hero ---------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0 8px;
}

.hero-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.35));
  margin-bottom: 12px;
}

.hero-title {
  font-family: "Creepster", "Chalkduster", "Comic Sans MS", cursive;
  font-weight: 400;
  font-size: 40px;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin: 0 0 6px;
  text-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.hero-subtitle {
  margin: 0 0 22px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------------- Search ---------------- */

.search {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 50px;
  padding: 0 18px 0 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-input:focus {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------------- Sections ---------------- */

.tile-section {
  margin-top: 32px;
}

/* Toggle hooks: hide entire section when corresponding data attr is "false" */
body[data-show-featured="false"] .tile-section[data-section="featured"],
body[data-show-spooks="false"]   .tile-section[data-section="spooks"] {
  display: none;
}

.section-title {
  font-family: "Creepster", "Chalkduster", "Comic Sans MS", cursive;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin: 0 0 14px;
}

/* ---------------- Tile grid ---------------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(76, 29, 149, 0.55), rgba(30, 16, 60, 0.55));
  border: 1px solid rgba(168, 85, 247, 0.25);
  text-decoration: none;
  color: inherit;
  aspect-ratio: 1 / 1;
  transition: transform 0.12s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.tile:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .tile:hover {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.18);
  }
}

.tile img {
  width: 56%;
  max-width: 78px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
}

.tile-label {
  font-family: "Creepster", "Chalkduster", "Comic Sans MS", cursive;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.6px;
  color: #ffffff;
  text-align: center;
  line-height: 1.1;
}

.tile-label-amber { color: #f97316; }
.tile-label-gold  { color: #d4a574; }

/* ---------------- Modal ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
  z-index: 100;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, visibility 0s linear 0s;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(160deg, rgba(45, 27, 78, 0.78) 0%, rgba(26, 16, 50, 0.82) 60%, rgba(15, 10, 28, 0.85) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-radius: 22px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(168, 85, 247, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 10px;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px;
  margin: 4px auto 14px;
  display: block;
}

.modal-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

/* Modal title color variants */
.modal[data-title-color="amber"] .modal-title { color: #f97316; }
.modal[data-title-color="gold"]  .modal-title { color: #f5b454; }
.modal[data-title-color="white"] .modal-title { color: #ffffff; }
.modal[data-title-color="white-glow"] .modal-title {
  font-family: "Creepster", "Chalkduster", "Comic Sans MS", cursive;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
}

.modal-description {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 4px;
}

.modal-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border-radius: 28px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.12s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.modal-cta:active { transform: scale(0.98); }
@media (hover: hover) { .modal-cta:hover { filter: brightness(1.08); } }

/* CTA color variants — match in-app design */
.modal[data-button-color="amber"]  .modal-cta { background: #f97316; color: #ffffff; }
.modal[data-button-color="gold"]   .modal-cta { background: #d4a574; color: #ffffff; }
.modal[data-button-color="white"]  .modal-cta { background: #ffffff; color: #1a1625; }
.modal[data-button-color="purple"] .modal-cta { background: #a855f7; color: #ffffff; }

/* ---------------- Small screens ---------------- */

@media (max-width: 360px) {
  .hero-title { font-size: 34px; }
  .section-title { font-size: 20px; }
  .tile-label { font-size: 12px; }
  .page { padding: 20px 14px 40px; }
  .modal { padding: 24px 18px 20px; }
  .modal-description { font-size: 14px; }
}
