/* App landing page styling for the Tumblr slideshow product page and legal variant. */
@import "../components/topbar.css";
@import "../components/links.css";

:root {
  --app-content-width: 530px;
  --app-primary: #8ea2ff;
  --app-secondary: #6579c9;
  --app-bg: #0e1218;
  --app-bg-start: #0e1218;
  --app-bg-end: #1d2533;
  --app-onBg: #f3f6fa;
  --app-heading: #f3f6fa;
  --app-headingAccent: #8f9eff;
  --app-chip-active: #394279;
  --app-bodyText: #d8e0ea;
  --app-chipText: #f3f6fa;
  --app-chipBorder: #303b49;
  --app-chipBgTop: #1f2833;
  --app-chipBgBottom: #171e27;
  --app-chipStatus: #95a3b5;
  --app-releasedText: #f3f6fa;
  --app-releasedBorder: #586a92;
  --app-releasedHoverBorder: #8ea2ff;
  --app-releasedBgTop: #273349;
  --app-releasedBgBottom: #1d2636;
  --app-comingSoonText: #d8e0ea;
  --app-comingSoonBorder: #303b49;
  --app-comingSoonBgTop: #1f2833;
  --app-comingSoonBgBottom: #171e27;
  --app-googlePlayComingSoonText: #d8e0ea;
  --app-googlePlayComingSoonBorder: #303b49;
  --app-googlePlayComingSoonBgTop: #1f2833;
  --app-googlePlayComingSoonBgBottom: #171e27;
}

* {
  box-sizing: border-box;
}

/* Root canvas fallback for the app landing background. */
html {
  margin: 0;
  min-height: 100%;
  background-color: var(--app-bg);
}

/* Main app page background and typography. */
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--app-bg);
  background: radial-gradient(circle at 10% 8%, var(--app-bg-start) 0%, var(--app-bg) 45%),
    radial-gradient(circle at 82% 70%, var(--app-bg-end) 0%, transparent 44%), var(--app-bg);
  color: var(--app-onBg);
  font-family: Calibri, "Segoe UI", Candara, Arial, sans-serif;
}

/* Soft background glows add depth without competing with the phone preview. */
.bg-glow {
  position: fixed;
  z-index: -1;
  filter: blur(56px);
  opacity: 0.32;
  border-radius: 999px;
  pointer-events: none;
}

/* Top-left glow blob. */
.bg-glow-a {
  width: 320px;
  height: 320px;
  left: -110px;
  top: -80px;
  background: var(--app-primary);
}

/* Bottom-right glow blob. */
.bg-glow-b {
  width: 360px;
  height: 360px;
  right: -140px;
  bottom: -140px;
  background: var(--app-secondary);
}

/* The hero pairs the preview device with copy and store availability chips. */
.hero {
  width: min(1120px, 92vw);
  margin: 12px auto 0;
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* Preview column for the device mockup/video. */
.visual {
  display: flex;
  justify-content: center;
}

/* Actual autoplaying device preview video. */
.phone-video {
  width: 290px;
  height: 590px;
  border-radius: 8px;
  object-fit: cover;
  background: transparent;
}

/* Main app name. */
.content .app-heading {
  margin: 0;
  color: var(--app-headingAccent);
  font-size: clamp(38px, 5.6vw, 58px);
  letter-spacing: 0.04em;
  line-height: 0.95;
}

/* Optional layout when a secondary descriptor sits under the app name. */
.content .app-heading-with-descriptor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22em;
}

/* Secondary descriptor line under the main app name. */
.content .app-heading-descriptor {
  display: block;
  color: var(--app-headingAccent);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.02;
}

/* Shared content block sizing for the intro and detail sections. */
.app-lead-inline,
.app-detail-inline,
.store-chips {
  width: min(100%, var(--app-content-width));
}

/* Intro block under the main heading uses the same width as the detail block. */
.app-lead-inline {
  margin-top: 35px;
}

/* Shared paragraph styling for the marketing copy. */
.app-lead-inline p,
.app-detail-inline p,
.content > p {
  margin: 13px 0 0;
  color: var(--app-bodyText);
  font-size: clamp(18px, 2.2vw, 18px);
  line-height: 1.4;
}

/* Secondary detail block under the main description. */
.app-detail-inline {
  margin-top: 26px;
}

.app-lead-inline .app-subheading,
.app-detail-inline h2 {
  color: var(--app-headingAccent);
  text-shadow: 0 0 0.01px var(--app-chip-active);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: left;
}

/* Optional app subtitle under the main heading. */
.app-lead-inline .app-subheading {
  margin: 0;
}

/* Detail block heading. */
.app-detail-inline h2 {
  margin: 14px 0 0;
  font-family: inherit;
}

/* Row/grid wrapper for store chips. */
.store-chips {
  margin-top: 34px;
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  padding-inline: 30px;
  margin-inline: 0;
}

/* Store chips switch between released and coming-soon states via class modifiers. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 182px;
  min-width: 182px;
  min-height: 52px;
  padding: 0 22px 0 18px;
  border-radius: 14px;
  color: var(--app-chipText);
  text-decoration: none;
  border: 1px solid var(--app-chipBorder);
  background: linear-gradient(180deg, var(--app-chipBgTop) 0%, var(--app-chipBgBottom) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease,
    transform 180ms ease;
}

/* Shared icon slot inside each chip. */
.chip-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

/* Main store label text. */
.chip-label {
  display: block;
  font-size: 1.06rem;
  line-height: 1.1;
}

/* Wrapper for label plus secondary status. */
.chip-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
}

/* Small secondary state text such as "Coming soon". */
.chip-status {
  display: block;
  font-size: 0.78rem;
  line-height: 1.1;
  color: var(--app-chipStatus);
  opacity: 0.82;
}

/* App Store icon artwork. */
.chip-icon-app-store {
  background-image: url("../../assets/store_icons/apple.svg");
}

/* Google Play icon artwork. */
.chip-icon-google-play {
  background-image: url("../../assets/store_icons/google.svg");
}

/* Released chip styling shared by both stores. */
.chip-released {
  color: var(--app-releasedText);
  border-color: var(--app-releasedBorder);
  background: var(--app-chip-active);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 22px rgba(25, 38, 61, 0.24);
}

/* Hover feedback for released chips. */
.chip-released:hover {
  border-color: var(--app-releasedHoverBorder);
  transform: translateY(-1px);
}

/* Default styling for unavailable store links. */
.chip-coming-soon {
  color: var(--app-comingSoonText);
  border-color: var(--app-comingSoonBorder);
  background: var(--app-chip-active);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 22px rgba(20, 23, 29, 0.16);
  cursor: default;
}

/* Google Play coming-soon variant. */
.chip-google-play.chip-coming-soon {
  color: var(--app-googlePlayComingSoonText);
  border-color: var(--app-googlePlayComingSoonBorder);
  background: var(--app-chip-active);
}

/* Collapse the two-column hero once the preview and copy no longer fit comfortably. */
@media (max-width: 930px) {
  /* Slightly reduce top spacing on smaller screens. */
  .topbar {
    padding-top: 18px;
  }

  /* Stack preview above copy on tablets and phones. */
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding: 8px 0 40px;
  }

  /* Keep the copy left-aligned even once the layout collapses. */
  .content {
    width: min(100%, var(--app-content-width));
    margin-inline: auto;
    text-align: left;
  }

  /* Keep all copy blocks aligned with the left edge of the centered content column. */
  .content p,
  .app-lead-inline,
  .app-detail-inline {
    margin-inline: 0;
    text-align: left;
  }

  /* Switch the chip row to a single-column stack. */
  .store-chips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding-inline: 0;
    justify-items: center;
    margin-inline: auto;
  }

  /* Let each chip fill the available width in stacked mode. */
  .chip {
    width: auto;
    min-width: 0;
  }

  /* Slightly shrink the device preview for tablet widths. */
  .phone-video {
    width: 246px;
    height: 510px;
  }
}

@media (max-width: 560px) {
  /* Reduce vertical spacing on narrow phones. */
  .hero {
    gap: 18px;
  }

  /* Further shrink the preview device on small phones. */
  .phone-video {
    width: 210px;
    height: 430px;
  }

  /* Reduce heading size for small-phone readability. */
  .content h1 {
    font-size: clamp(30px, 8vw, 38px);
  }

  /* Tighten paragraph sizing for narrow screens. */
  .content p {
    margin-top: 16px;
    font-size: clamp(16px, 4vw, 17px);
    line-height: 1.5;
  }

  /* Reduce store-chip spacing on small phones. */
  .store-chips {
    margin-top: 24px;
    gap: 10px;
  }

  /* Match the denser mobile button proportions used on Ritualz. */
  .chip {
    width: 100%;
    max-width: 182px;
    min-height: 54px;
    padding: 0 14px 0 12px;
  }

}
