:root {
  --bg: #eff1f5;
  --panel: #ffffff;
  --panel-muted: #f7f8fb;
  --text: #18202b;
  --text-soft: #4d5a6a;
  --line: #d6dde8;
  --brand: #04576d;
  --brand-warm: #f3a442;
  --focus: #0d9ec2;
  --shadow: 0 16px 44px rgba(16, 34, 56, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at 5% 5%, rgba(4, 87, 109, 0.12) 0, rgba(4, 87, 109, 0) 30%),
    radial-gradient(circle at 95% 15%, rgba(243, 164, 66, 0.18) 0, rgba(243, 164, 66, 0) 25%),
    var(--bg);
}

a {
  color: var(--brand);
  text-decoration-thickness: 2px;
}

a:hover {
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 1rem + 1.7vw, 2.4rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
}

.top-nav a:hover {
  color: var(--brand);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 24px 64px;
}

.hero {
  margin-top: 14px;
  padding: 14px 18px;
  background: linear-gradient(120deg, #f7fbfc, #f8f2e9);
  border: 1px solid rgba(4, 87, 109, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Order Bell live card: a small clickable Twitch thumbnail with a LIVE badge,
   pinned to the right of the hero. Hidden until app.js confirms the bell is live. */
.order-bell-live {
  flex: 0 0 auto;
  width: clamp(180px, 24vw, 264px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--text-soft);
}

.order-bell-live[hidden] {
  display: none;
}

.order-bell-live-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(4, 87, 109, 0.18);
  background: #0f1115;
  box-shadow: 0 8px 22px rgba(16, 34, 56, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.order-bell-live-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-bell-live:hover .order-bell-live-media,
.order-bell-live:focus-visible .order-bell-live-media {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 34, 56, 0.18);
}

.order-bell-live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #d81f2a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-bell-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: order-bell-pulse 1.6s ease-in-out infinite;
}

@keyframes order-bell-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .order-bell-live-dot { animation: none; }
  .order-bell-live-media { transition: none; }
}

.order-bell-live-caption {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.25;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }
  .order-bell-live {
    width: 100%;
    max-width: 320px;
  }
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 700;
}

.hero h1 {
  margin: 4px 0 4px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.2rem, 1rem + 1.1vw, 1.85rem);
  line-height: 1.14;
  max-width: none;
}

.hero-copy {
  max-width: 760px;
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.mailing-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(4, 87, 109, 0.22);
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.95rem;
  background: var(--panel);
}

.section-head {
  margin-top: 38px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem);
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
}

/* Featured product (home) — mirrors a product section's copy/preview split
   inside one panel, with the preview taking the wider column. */
.featured-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
  padding: 24px;
  background: var(--panel);
  border: 1px solid rgba(4, 87, 109, 0.18);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* Featured carousel: cards share one grid cell; the active one sits at
   translateX(0), the leaving one slides to the left, the next parks off the
   right edge (see buildFeaturedCarousel in app.js). The negative margin +
   padding keeps the card's box-shadow inside the clipped area. */
.featured-track {
  display: grid;
  overflow: hidden;
  /* Horizontal bleed must not exceed .page-shell's 24px gutter, or the
     page gets a horizontal scrollbar on phones. */
  margin: -32px -24px;
  padding: 32px 24px;
}

.featured-track > .featured-card {
  grid-area: 1 / 1;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.65s ease;
}

.featured-track > .featured-card.is-off,
.featured-track > .featured-card.is-entering {
  transform: translateX(calc(100% + 64px));
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.featured-track > .featured-card.is-entering {
  visibility: visible;
}

.featured-track > .featured-card.is-leaving {
  transform: translateX(calc(-100% - 64px));
  opacity: 0;
}

.featured-track > .featured-card.is-active {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.featured-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.featured-lockup h3 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.1rem);
  line-height: 1.15;
}

.featured-oneline {
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--brand);
}

.featured-blurb {
  margin: 8px 0 0;
  color: var(--text-soft);
  max-width: 52ch;
}

.featured-media iframe,
.featured-media img {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  object-fit: cover;
}

/* Product groups: a task-based heading over a uniform card grid. */
.product-group {
  margin-bottom: 30px;
}

.product-group-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.product-grid {
  /* 240px min gives four columns at the 1180px container, stepping down to
     3 / 2 / 1. auto-fill (not auto-fit) keeps a short group's cards the same
     width as a full row's instead of stretching them. */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 16px;
  padding: 16px;
  min-height: 230px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.06);
  transform: translateY(8px);
  opacity: 0;
  animation: rise 480ms ease forwards;
}

.product-card:nth-child(2) { animation-delay: 70ms; }
.product-card:nth-child(3) { animation-delay: 140ms; }
.product-card:nth-child(4) { animation-delay: 210ms; }
.product-card:nth-child(5) { animation-delay: 280ms; }
.product-card:nth-child(6) { animation-delay: 350ms; }
.product-card:nth-child(7) { animation-delay: 420ms; }
.product-card:nth-child(8) { animation-delay: 490ms; }
.product-card:nth-child(9) { animation-delay: 560ms; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:hover {
  border-color: rgba(4, 87, 109, 0.36);
  box-shadow: 0 18px 40px rgba(21, 37, 52, 0.12);
}

.product-icon {
  inline-size: 80px;
  block-size: 80px;
  border-radius: 18px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
}

.product-card h3 {
  margin: 4px 0 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.15rem;
  line-height: 1.25;
}

.price-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--brand);
  background: rgba(4, 87, 109, 0.08);
  border: 1px solid rgba(4, 87, 109, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
}

/* On product cards the flags ("New", "Free") are pinned top-right, level with
   the icon, so they land in the same spot on every card regardless of name. */
.card-flags {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
}

.tag-new {
  color: #7a4a05;
  background: rgba(243, 164, 66, 0.16);
  border-color: rgba(243, 164, 66, 0.55);
}

.price-note {
  color: var(--text-soft);
  font-size: 0.93rem;
}

.copy .price-note,
.featured-copy .price-note {
  margin: 10px 0 0;
}

.product-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.96rem;
}


.product-sections {
  margin-top: 34px;
}

.product-section {
  scroll-margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 44px 0;
}

.product-detail-head {
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.product-detail-head h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 0.95rem + 1.2vw, 2rem);
}

.product-pill {
  font-size: 0.82rem;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.product-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
}

.copy p {
  margin: 0 0 14px;
}

.copy p:last-child {
  margin-bottom: 0;
}

.cta-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: #101720;
}

.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--brand);
  background: var(--panel);
}

.fine-print {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.video-shell {
  margin: 0;
}

.video-shell iframe {
  display: block;
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.08);
  background: #0b0b0b;
}

.video-shell iframe + iframe {
  margin-top: 14px;
}

.video-shell img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.08);
  background: #fff;
}

.preview-placeholder {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.08);
  background: linear-gradient(145deg, #f8fbff, #f0f4fb);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}

.preview-placeholder img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 12px;
}

.preview-placeholder p {
  margin: 0;
  color: var(--text-soft);
}

.video-note {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.partner-note {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  text-align: center;
  color: var(--text-soft);
}

.testimonial {
  margin: 20px 0 0;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, #f8fbff, #f9f8ff);
}

.testimonial-quote {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.testimonial-quote-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.testimonial-quote-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--text-soft);
}

.testimonial-meta {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.mailing-list {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 42px;
}

.mailing-list h2 {
  margin: 0 0 18px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem);
}

.mailing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.mailing-card h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem);
}

.mailing-card p {
  margin: 0;
  color: var(--text-soft);
}

.mailing-embed {
  margin-top: 16px;
}

.mailing-form {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mailing-form input {
  flex: 1 1 260px;
  min-width: 180px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.mailing-form button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #11384a, #04576d);
  cursor: pointer;
}

.privacy-note {
  margin-top: 12px;
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 28px 24px 44px;
}

.site-footer a {
  font-weight: 600;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

code {
  background: #eef2f8;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 0.9em;
}

@media (max-width: 980px) {
  .product-body,
  .featured-card {
    grid-template-columns: 1fr;
  }

  .video-shell iframe {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero {
    padding: 12px 14px;
  }

  .featured-card {
    padding: 18px;
    gap: 20px;
  }

  .mailing-card {
    padding: 20px;
  }
}

/* ---------- Secondary pages (guides, PDF landings, app landings) ---------- */

.doc-page {
  max-width: 860px;
}

.doc-header {
  margin: 14px 0 8px;
}

.doc-header .eyebrow {
  margin-bottom: 6px;
}

.doc-header h1 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.15;
}

.doc-body {
  margin-top: 22px;
}

.doc-body h2 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.3rem;
  margin: 30px 0 10px;
}

.doc-body h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  margin: 22px 0 8px;
}

.doc-body p {
  margin: 0 0 14px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc-body li {
  margin-bottom: 8px;
}

.doc-figure {
  margin: 18px 0;
}

.doc-figure img,
.doc-figure video {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.08);
  background: #fff;
}

.doc-figure figcaption {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.doc-note {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.doc-note p {
  margin: 0;
}

/* PDF guide landing */
.pdf-shell {
  margin-top: 22px;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.pdf-frame {
  width: 100%;
  height: 80vh;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: #fff;
}

/* App landing (formerly -video pages) */
.landing {
  margin: 40px auto 0;
  max-width: 640px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 28px;
  box-shadow: var(--shadow);
}

.landing-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.landing h1 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  margin: 18px 0 6px;
}

.landing p {
  color: var(--text-soft);
  margin: 0 0 20px;
}

.landing-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 22px;
}

.landing-video iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(21, 37, 52, 0.08);
  background: #0b0b0b;
}

.store-badge {
  display: inline-block;
}

.landing .price-note {
  margin: 12px 0 0;
}

/* Store badges share a height so the App Store and FxFactory art line up. */
.store-badge img {
  width: auto;
  height: 82px;
  max-width: 100%;
  display: block;
}

.landing .store-badges {
  justify-content: center;
  margin-top: 0;
}

/* Product landing pages (/<id>/, generated by scripts/generate-product-pages.mjs) */
.product-page {
  max-width: 860px;
}

.product-page .landing {
  margin-top: 24px;
}

.product-about {
  max-width: 640px;
  margin: 28px auto 0;
}

.product-about .landing-video {
  margin-top: 12px;
}

.landing-figure {
  margin: 0 0 22px;
}

.product-about .testimonial {
  margin: 20px 0;
}

.product-title-link {
  color: inherit;
  text-decoration: none;
}

.product-title-link:hover,
.product-title-link:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
