/* ==========================================================================
   AI app pages (ScribeAI.html, RedInk.html)
   Builds on home.css and prophet.css, so <main> carries
   class="home prophet ai-app ai-scribe" (or ai-redink).
   Each product swaps the site's purple accent for its own colour.
   ========================================================================== */

/* ---------- product colours ---------- */
.ai-scribe {
  --accent: #2f5ee8;
  --accent-rgb: 47, 94, 232;
  --accent-2-rgb: 124, 58, 237;
  --accent-soft: #eaf0ff;
  --accent-deep: #1e3fae;
  --grad: linear-gradient(135deg, #5b8af5 0%, #0d41e1 100%);
  --grad-wide: linear-gradient(120deg, #3b6cf6 0%, #0d41e1 45%, #7c3aed 100%);
}

.ai-redink {
  --accent: #d63a2c;
  --accent-rgb: 214, 58, 44;
  --accent-2-rgb: 245, 158, 11;
  --accent-soft: #fdecea;
  --accent-deep: #a02f23;
  --grad: linear-gradient(135deg, #ff6b45 0%, #c0392b 100%);
  --grad-wide: linear-gradient(120deg, #ff6b45 0%, #e5483a 45%, #9f1239 100%);
}

/* recolour the shared pieces that hard-code the purple accent */
.ai-app .h-hero::before {
  background:
    radial-gradient(42rem 32rem at 88% 8%, rgba(var(--accent-rgb), 0.2), transparent 62%),
    radial-gradient(34rem 26rem at 6% 96%, rgba(var(--accent-2-rgb), 0.14), transparent 62%),
    radial-gradient(30rem 24rem at 52% 58%, rgba(var(--accent-rgb), 0.08), transparent 62%);
}

.ai-app .p-visual-glow {
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.3) 0%, rgba(var(--accent-2-rgb), 0.12) 45%, transparent 70%);
}

.ai-app .h-btn--primary,
.ai-app .h-btn--primary:visited {
  box-shadow: 0 12px 26px -10px rgba(var(--accent-rgb), 0.7);
}

.ai-app .h-btn--primary:hover {
  box-shadow: 0 16px 32px -12px rgba(var(--accent-rgb), 0.85);
}

.ai-app .h-btn--ghost:hover,
.ai-app .h-eyebrow:hover,
.ai-app .p-gallery-bar button:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.ai-app .p-subnav-links a:hover {
  background: rgba(var(--accent-rgb), 0.06);
}

.ai-app .p-subnav-links a.is-current {
  background: rgba(var(--accent-rgb), 0.1);
}

.ai-app .p-feature:hover {
  border-color: rgba(var(--accent-rgb), 0.18);
}

.ai-app .p-faq details[open] {
  border-color: rgba(var(--accent-rgb), 0.25);
}

.ai-app .p-faq summary::after {
  background:
    linear-gradient(var(--accent), var(--accent)) center / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    var(--accent-soft);
}

.ai-app a:focus-visible,
.ai-app button:focus-visible,
.ai-app summary:focus-visible {
  outline-color: var(--accent);
}

.ai-app .h-cta {
  background: var(--grad-wide);
  box-shadow: 0 40px 80px -40px rgba(var(--accent-rgb), 0.8);
}

.ai-app .h-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- hero ---------- */
.home.ai-app .h-hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.15rem) !important;
}

.ai-app .p-visual--phone .p-visual-main {
  width: 54%;
}

.ai-app .p-visual--phone .p-visual-main img {
  border-radius: 34px;
}

.ai-float-icon {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: 11px;
}

.ai-app .h-float--dl .h-float-ico {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-payment {
  margin-top: 1.1rem !important;
  font-size: 0.88rem;
  color: var(--muted);
}

.ai-payment strong {
  color: var(--ink);
}

/* "Web platform" button next to the store badges */
.h-btn--web,
.h-btn--web:visited {
  height: 42px;
  padding-block: 0;
  color: var(--accent);
  background: #fff;
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: var(--shadow-sm);
}

.h-btn--web:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 12px 24px -12px rgba(var(--accent-rgb), 0.9);
}

.h-cta .h-btn--web,
.h-cta .h-btn--web:visited {
  color: var(--ink);
  border-color: transparent;
}

.h-cta .h-btn--web:hover {
  color: var(--ink);
  background: #fff;
}

.ai-app .h-hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.h-cta .h-hero-cta {
  justify-content: center;
}

/* ---------- screens: a small set shown as a grid ---------- */
.ai-screens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 220px));
  justify-content: center;
  gap: 1.75rem;
}

.ai-screens button {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
  transition: transform 0.3s var(--ease);
}

.ai-screens button:hover {
  transform: translateY(-6px);
}

.ai-screens img {
  display: block;
  width: 100%;
  filter: drop-shadow(0 18px 22px rgba(15, 23, 42, 0.22));
}

/* RedInk's framed screenshots sit on black: round them into cards */
.ai-redink .p-gallery--phone .p-shot img {
  border-radius: 26px;
}

/* ---------- ScribeAI guide: step cards ---------- */
.ai-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.ai-step {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.ai-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.ai-step-media {
  display: grid;
  place-items: center;
  height: 300px;
  padding: 1.25rem 1rem 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #f8faff 100%);
}

.ai-step-media button {
  display: block;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
  align-self: end;
}

.ai-step-media button img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px -8px rgba(15, 23, 42, 0.25);
}

.ai-step-media--stores {
  align-content: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
}

.ai-step-media--stores > img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.ai-step-media--stores .h-stores {
  flex-direction: column;
}

.ai-step-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.ai-step-body::before {
  counter-increment: step;
  content: "Step " counter(step);
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.18rem 0.6rem;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.home .ai-step h3 {
  margin-bottom: 0.45rem !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

.ai-step p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* ---------- RedInk guide: tabs and step rows ---------- */
.ai-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 2.5rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.ai-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.ai-tabs button:hover {
  color: var(--accent);
}

.ai-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 22px -10px rgba(var(--accent-rgb), 0.85);
}

.ai-pane-intro {
  max-width: 40rem;
  margin: -1rem auto 2rem !important;
  text-align: center;
  color: var(--muted);
}

.ai-flow {
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}

.ai-flow-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.ai-flow-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.ai-flow-head::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border-radius: 12px;
  box-shadow: 0 10px 20px -10px rgba(var(--accent-rgb), 0.9);
}

.home .ai-flow-head h3 {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

.ai-flow-text {
  display: grid;
  gap: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.ai-flow-text strong {
  font-weight: 600;
  color: var(--ink);
}

.ai-flow-text em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.home .ai-flow-text h4 {
  margin: 0.5rem 0 0;
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.ai-flow-text ul,
.ai-flow-text ol {
  display: grid;
  gap: 0.4rem;
}

.ai-flow-text li {
  position: relative;
  padding-left: 1.4rem;
}

.ai-flow-text ul > li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0.2rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.ai-flow-text ol {
  counter-reset: sub;
}

.ai-flow-text ol > li::before {
  counter-increment: sub;
  content: counter(sub) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--accent);
}

.ai-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.home .ai-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem 0.25rem 0.5rem;
  font-size: 0.85rem;
  background: var(--soft);
  border-radius: 999px;
}

.home .ai-legend li::before {
  content: "";
  position: static;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  opacity: 1;
}

.ai-sample {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.4rem;
  padding: 1rem;
  background: var(--soft);
  border-radius: 16px;
}

.ai-sample button {
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.ai-sample button img {
  display: block;
  width: 100%;
  max-width: 460px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.ai-sample .h-btn {
  justify-self: start;
}

.ai-warn {
  display: flex;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #9a3412;
}

/* screenshots beside each step */
.ai-shots {
  display: flex;
  gap: 0.9rem;
}

.ai-shots button {
  flex-shrink: 0;
  width: 160px;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
  transition: transform 0.3s var(--ease);
}

.ai-shots button:hover {
  transform: translateY(-4px);
}

.ai-shots img {
  display: block;
  width: 100%;
  border: 5px solid #0f172a;
  border-radius: 22px;
  box-shadow: 0 18px 30px -16px rgba(15, 23, 42, 0.45);
}

/* scanning tips */
.ai-tips {
  margin-top: 3rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: linear-gradient(135deg, #fff7ed 0%, #fdecea 55%, #fce7f3 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 28px;
}

.ai-tips-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.home .ai-tips-head h3 {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
}

.ai-tips-head p {
  margin-top: 0.3rem !important;
  color: var(--muted);
}

.ai-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ai-tip {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.ai-tip .p-ico {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  border-radius: 13px;
}

.ai-tip strong {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.ai-tip span {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- RedInk: video and press ---------- */
.ai-press {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.ai-press-list {
  display: grid;
  gap: 1.25rem;
}

.ai-news {
  display: flex;
  gap: 1.25rem;
  padding: 1.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
}

.ai-news-clip {
  flex-shrink: 0;
  width: 108px;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.ai-news-clip img {
  display: block;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 14px 24px -12px rgba(0, 0, 0, 0.7);
}

.ai-news-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  font-size: 1.35rem;
  color: #fff;
  background: var(--grad);
  border-radius: 16px;
}

.ai-news-src {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fca5a5;
}

.home .ai-news h3 {
  margin-bottom: 0.4rem !important;
  font-size: 1.08rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

.ai-news p {
  margin-bottom: 1rem !important;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #94a3b8;
}

.ai-news-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-app .h-dark .p-video figcaption .bi {
  color: #fca5a5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .ai-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-shots button {
    width: 140px;
  }
}

@media (max-width: 991.98px) {
  .ai-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-screens {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }

  .ai-flow-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .ai-shots {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
  }

  .ai-press {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-app .h-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-app .h-stat:nth-child(3)::before {
    display: none;
  }

  .ai-app .h-stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 767.98px) {
  .ai-tips-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-tabs {
    border-radius: 22px;
  }

  .ai-tabs button {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0.6rem 0.9rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 575.98px) {
  .ai-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-step-media {
    height: 260px;
  }

  .ai-screens {
    gap: 1rem;
  }

  .ai-flow-step {
    padding: 1.25rem;
  }

  .ai-shots button {
    width: 128px;
  }

  .ai-news {
    flex-direction: column;
  }
}
