/* Self-hosted webfonts (Fredoka, Nunito). Served from our own origin so that
   no visitor IP is sent to Google — GDPR-compliant, no consent banner needed.
   Both are variable fonts: one woff2 per subset covers all weights we use.
   Subsets: latin + latin-ext (covers EN + DE umlauts + HR diacritics). */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/fredoka-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/fredoka-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #160b2e;
  --surface: #241247;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #fbbf24;
  --border: rgba(255, 255, 255, 0.16);
  --truth: #38bdf8;
  --dare: #fb7185;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  /* The logo's zoom-in starts scaled up; clip horizontal overflow so it
     never spawns a scrollbar mid-animation. */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: var(--bg);
  /* App-style purple→darker gradient backdrop. */
  background: radial-gradient(
      120% 80% at 50% 0%,
      #1e0b3b 0%,
      #160b2e 55%,
      #0e0820 100%
    )
    no-repeat fixed;
  color: var(--text);
  line-height: 1.6;
}

/* ---------- Landing ---------- */
.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}

/* Keep the icon/logo/tagline/buttons above the card field behind them. */
.hero > :not(.card-field) {
  position: relative;
  z-index: 1;
}

/* Soft radial scrim keeps the logo/buttons readable over the moving feed. */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 92vw);
  height: min(560px, 80vh);
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(22, 11, 46, 0.92) 0%,
    rgba(22, 11, 46, 0.78) 38%,
    rgba(22, 11, 46, 0) 72%
  );
}

/* Official app word-mark: a tilted, 3D-extruded "Christian / Truth or Dare"
   logo that zooms in with a bouncy pop on load — mirrors the app's home hero. */
.logo {
  /* Extra bottom room so the tilted word-mark + tagline clear the buttons. */
  margin: 0 0 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.96;
  /* Tilt matches the app's -15° word-mark. */
  transform: rotate(-15deg) scale(1);
  transform-origin: center;
  animation: logo-pop 0.75s cubic-bezier(0.18, 0.7, 0.24, 1) both;
}

.logo-line {
  display: block;
  font-family: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  /* App uses letterSpacing -0.5px at ~40-48px ≈ -0.011em. */
  letter-spacing: -0.011em;
}

/* "Christian" — gold face with a darker-gold extruded side. Six stacked
   shadow copies stepped diagonally (em-based so the 3D depth scales with the
   responsive font, mirroring the app's DEPTH=6 / STEP=1.6 extrude). */
.logo-gold {
  font-size: clamp(30px, 7vw, 62px);
  color: #fbbf24;
  text-shadow: 0.033em 0.033em 0 #a85b06, 0.066em 0.066em 0 #a85b06,
    0.1em 0.1em 0 #a85b06, 0.133em 0.133em 0 #a85b06, 0.166em 0.166em 0 #a85b06,
    0.2em 0.2em 0 #a85b06, 0.24em 0.26em 0.34em rgba(0, 0, 0, 0.38);
}

/* "Truth or Dare" — white face with a purple extruded side. */
.logo-white {
  font-size: clamp(36px, 8.6vw, 76px);
  margin-top: -0.125em;
  color: #ffffff;
  text-shadow: 0.033em 0.033em 0 #5b4a86, 0.066em 0.066em 0 #5b4a86,
    0.1em 0.1em 0 #5b4a86, 0.133em 0.133em 0 #5b4a86, 0.166em 0.166em 0 #5b4a86,
    0.2em 0.2em 0 #5b4a86, 0.24em 0.26em 0.34em rgba(0, 0, 0, 0.38);
}

@keyframes logo-pop {
  0% {
    opacity: 0;
    transform: rotate(-15deg) scale(2.6);
  }
  45% {
    opacity: 1;
  }
  72% {
    transform: rotate(-15deg) scale(0.93);
  }
  88% {
    transform: rotate(-15deg) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: rotate(-15deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo {
    animation: none;
    opacity: 1;
  }
}

/* Tagline sits inside the tilted .logo so it shares the -15° angle, centered
   under the word-mark — gold, uppercase, wide-tracked, mirroring the app. */
.tagline {
  margin-top: 28px;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: clamp(12px, 2.6vw, 15px);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  color: #fbbf24;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  /* Constrain width so the buttons wrap (rather than overflow) on narrow
     screens instead of taking their full max-content width. */
  width: 100%;
  max-width: 440px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.store-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.store-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store-btn .label {
  text-align: left;
  line-height: 1.2;
}

.store-btn .label small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.store-btn .label span {
  font-size: 18px;
  font-weight: 600;
}

/* On narrow screens, stack the store buttons so neither is clipped. */
@media (max-width: 480px) {
  .downloads {
    flex-direction: column;
    align-items: center;
  }

  .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
  margin-bottom: 10px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Content pages ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header a.home-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.page-header a.home-logo img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.page h1 {
  font-family: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  margin: 24px 0 8px;
  font-size: clamp(28px, 6vw, 36px);
}

.page h2 {
  font-family: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-top: 32px;
  font-size: 20px;
}

.page h3 {
  margin: 24px 0 4px;
  font-size: 16px;
  color: var(--text);
}

.page p,
.page li {
  color: var(--muted);
}

.page a {
  color: var(--accent);
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  color: var(--accent);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.muted-note {
  font-size: 13px;
  color: var(--border);
}

.plain-summary {
  margin: 20px 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: rgba(36, 18, 71, 0.55);
}

.plain-summary p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.plain-summary strong {
  color: var(--accent);
}

/* ---------- Ambient Truth/Dare card feed ---------- */
/* Confined to the hero/main area so cards rise from the footer line upward
   and never travel over the footer. */
.card-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  /* Fade cards in/out at the top & bottom edges. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
}

.td-card {
  position: absolute;
  bottom: 0;
  width: 270px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(36, 18, 71, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
  animation-name: card-rise;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

.td-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.td-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #160b2e;
}

.td-level {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.td-prompt {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Card type accents. */
.td-card.is-truth {
  border-top: 2px solid var(--truth);
}

.td-card.is-truth .td-pill {
  background: linear-gradient(120deg, #38bdf8, #2563eb);
  color: #ffffff;
}

.td-card.is-dare {
  border-top: 2px solid var(--dare);
}

.td-card.is-dare .td-pill {
  background: linear-gradient(120deg, #fb7185, #e11d48);
  color: #ffffff;
}

/* Parallax depth tiers: far = small/dim/blurred, near = larger/crisper. */
.td-card.depth-far {
  --scale: 0.82;
  --peak: 0.5;
  filter: blur(1.2px);
  z-index: 1;
}

.td-card.depth-mid {
  --scale: 0.94;
  --peak: 0.74;
  z-index: 2;
}

.td-card.depth-near {
  --scale: 1.06;
  --peak: 0.96;
  z-index: 3;
}

@keyframes card-rise {
  0% {
    transform: translate(0, 12vh) scale(var(--scale, 1));
    opacity: 0;
  }
  10% {
    opacity: var(--peak, 0.85);
  }
  90% {
    opacity: var(--peak, 0.85);
  }
  100% {
    transform: translate(var(--drift, 0), -118vh) scale(var(--scale, 1));
    opacity: 0;
  }
}

/* Static fallback used only under reduced-motion. */
.td-card.is-static {
  bottom: auto;
  animation: none;
  opacity: 0.4;
}

@media (max-width: 640px) {
  .td-card {
    width: 210px;
    padding: 13px 15px;
    /* Drop blur on mobile for smoother scrolling. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(36, 18, 71, 0.82);
  }

  .td-prompt {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .td-card {
    animation: none;
  }
}
