/**
==========================================================================

@fileOverview
Homepage presentation layer for the QueryKey Cases marketing site.
Controls hero motion background, gradient fallbacks, and responsive
layout primitives shared with header/footer components.

@author
 * QueryKey Cases Web Team

@maintainer
 * Cases Engineering Lead

@usage
Imported by querykey-web/public/index.html after base tokens
to scope marketing-only visuals under the `.p-home` body selector.

@dependencies
Depends on global CSS tokens defined in assets/css/variables.css and
assumes hero-video.js populates background sources at runtime.

@notes
- Keep gradients and static fallbacks lightweight to honor bundle
  budgets enforced by npm run perf:budget.
- Every background asset referenced here must exist locally; no remote
  CDN fetches are permitted.

@license
QueryKey™ is a trademark of Farrel Wilson. All rights reserved.
========================================================================== */

/* Home Enterprise Theme - Extracted from index.html */

/* CSS Variables (Enterprise Theme) */
:root {
    --primary-navy: var(--qk-standard-band-dark);
    --primary-dark-blue: var(--qk-standard-band-mid);
    --accent-orange: var(--qk-premium-accent);
    --accent-orange-dark: #d66c00;
    --accent-blue: var(--qk-premium-accent-blue);
    --accent-blue-dark: #2F4AB2;
  --white-text: var(--qk-premium-title);
    --light-text: var(--qk-premium-text);
    --muted-text: var(--qk-premium-text-soft);
    --dark-text: #212529;
    --border-radius: 20px;
    --code-bg: #000;
    --card-bg: rgb(22 44 80 / 40%);
    --card-border: rgb(255 255 255 / 10%);

  /* Hero gradient: blue/navy only (no orange), matching reference image */
  --hero-fallback-gradient: linear-gradient(145deg, var(--primary-navy) 0%, #0b162b 50%, #111f3f 100%);
    --header-bg: rgb(15 29 56 / 85%);
    --body-bg-image: linear-gradient(145deg, var(--primary-navy) 0%, var(--primary-dark-blue) 100%), url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --section-bg-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --header-border: var(--qk-standard-band-divider);
    --secondary-btn-border: var(--light-text);
    --secondary-btn-hover-bg: var(--light-text);
    --secondary-btn-hover-text: var(--primary-navy);
    --code-text-color: var(--accent-orange);
    --footer-border: var(--qk-standard-band-divider);
    --transition-speed: 0.3s;

  /* Hero overlay tuning variables */
    --hero-pattern-opacity: 0.28; /* more prominent but still transparent */
    --hero-pattern-size: 60px; /* match the original SVG size for crispness */
    --hero-scrim-top-alpha: 0.35; /* reduced to let pattern show through more */
    --hero-scrim-bottom-alpha: 0.40; /* reduced to let pattern show through more */

    /* Vendorless UI Framework preview palette (light-mode cadence) */
    --vuf-light-canvas: var(--qk-standard-light-canvas);
    --vuf-light-band: var(--qk-standard-light-band);
    --vuf-light-surface: var(--qk-standard-light-surface);
    --vuf-light-border: var(--qk-standard-light-border);

    /* Home section tone mapping (dark defaults) */
    --home-canvas-bg: var(--qk-standard-band-dark);
    --home-section-dark-bg: var(--qk-standard-band-dark);
    --home-section-light-bg: var(--qk-standard-band-mid);
    --home-section-dark-image: var(--section-bg-image);
    --home-section-light-image: var(--section-bg-image);
    --home-section-blend-mode: overlay;
    --home-section-divider: var(--qk-standard-band-divider);
    --home-surface-bg: var(--card-bg);
    --home-surface-border: var(--card-border);
    --home-surface-shadow: 0 4px 6px rgb(0 0 0 / 10%);
}

body.light-mode {
    --primary-navy: #f0f2f5;
    --primary-dark-blue: #fff;
    --white-text: #1a202c;
    --light-text: #4a5568;
    --code-bg: #EDF2F7;
    --card-bg: rgb(255 255 255 / 96%);
    --card-border: rgb(0 0 0 / 10%);
    --header-bg: rgb(255 255 255 / 90%);
    --body-bg-image: linear-gradient(145deg, #eff2f8 0%, #fff 100%), url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --section-bg-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --header-border: rgb(0 0 0 / 10%);
    --secondary-btn-border: #4a5568;
    --secondary-btn-hover-bg: #2d3748;
    --secondary-btn-hover-text: #FFF;
    --code-text-color: #2d3748;
    --footer-border: rgb(0 0 0 / 10%);
    --light-orange-text: #D46900;
    --light-blue-text: #2844B4;
    --home-canvas-bg: var(--qk-standard-light-canvas);
    --home-section-dark-bg: var(--qk-standard-light-band);
    --home-section-light-bg: var(--qk-standard-light-surface);
    --home-section-dark-image: linear-gradient(180deg, rgb(226 233 245 / 78%), rgb(236 241 249 / 85%));
    --home-section-light-image: linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(251 253 255 / 98%));
    --home-section-blend-mode: normal;
    --home-section-divider: var(--qk-standard-light-divider);
    --home-surface-bg: var(--vuf-light-surface);
    --home-surface-border: var(--vuf-light-border);
    --home-surface-shadow: 0 8px 18px rgb(15 23 42 / 8%);
  --hero-pattern-opacity: 0.12;
  --hero-scrim-top-alpha: 0.12;
  --hero-scrim-bottom-alpha: 0.2;
}

/* --- Global Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

.p-home {
    font-family: QueryKeySans, sans-serif;
    background-color: var(--home-canvas-bg);
    color: var(--light-text);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.p-home.overlay-open {
  overflow: hidden;
}

.p-home .container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 0;
}

.p-home h1, .p-home h2, .p-home h3, .p-home h4 {
    color: var(--white-text);
    line-height: 1.3;
    font-weight: 700;
    transition: color var(--transition-speed) ease;
}

.p-home h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

/* Protocol label above hero headline */
.p-home .hero .hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 auto 14px;
  max-width: 700px;
}

.p-home .hero .hero-eyebrow a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.p-home .hero .hero-eyebrow a:hover,
.p-home .hero .hero-eyebrow a:focus {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

/* Hero headline specific override */
.p-home .hero .hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.15; /* slightly more line height for better spacing */
  font-weight: 800;
  letter-spacing: 0.005em; /* minimal positive spacing for width */
  color: #fff;
  margin-bottom: 10px;
  max-width: 100%; /* allow full width of container */
}

body.light-mode .p-home .hero .hero-title {
  color: #fff;
}

.p-home .hero .hero-title .highlight {
  color: var(--accent-orange);
  display: inline-block;
  white-space: nowrap; /* prevent "Verified Solutions." from breaking */
}

.p-home .hero .hero-title .hero-title-nowrap {
  white-space: nowrap; /* keep "Development with" on one line on mobile */
}

/* ATVP pill below hero title */
.p-home .hero .hero-atvp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 auto 14px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1;
}

/* Skinny screens: shrink ATVP pill */
@media (width <= 400px) {
  .p-home .hero .hero-atvp-pill {
    font-size: 0.62rem;
    padding: 5px 10px;
    gap: 6px;
    margin-bottom: 10px;
  }

  .p-home .hero .hero-atvp-pill .atvp-pill-icon {
    width: 6px;
    height: 6px;
  }
}

.p-home .hero .hero-atvp-pill .atvp-pill-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  flex-shrink: 0;
}

.p-home h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 50px;
}

.p-home h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.p-home p {
  margin-bottom: 1rem;
  max-width: 600px;
}

.p-home .center-text {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.p-home a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.3s ease;
}

.p-home a:hover {
  color: var(--accent-orange-dark);
}

.p-home .text-orange {
  color: var(--accent-orange);
}


/* --- Hero Section --- */
.p-home .hero {
    text-align: center;
  padding: 120px 20px;
  position: relative;
  overflow: hidden;

  /* keep fallback patterned background for browsers without video */
  background-image: var(--body-bg-image);
  background-blend-mode: color-dodge;
  transition: background-image var(--transition-speed) ease;
}

body.light-mode .p-home .hero {
  background-blend-mode: normal;
}

body.light-mode .p-home .hero .hero-media video {
  filter: saturate(1.05) contrast(1.05) brightness(1.2);
}

.p-home .hero .subtitle,
.p-home .hero .hero-subtitle,
.p-home .hero .page-hero-description {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 20px auto 30px;
  color: #fff;
}

/* Hero video container: video sits behind the pattern and content */
.p-home .hero .hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;

  /* Fallback when video is unavailable (mobile, reduced motion, or 404). */
  background: var(--hero-fallback-gradient);
}

.p-home .hero .hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;

  /* slight scale for edge bleed like pic 2 */
  transform: scale(1.03);
  filter: saturate(1.25) contrast(1.03) brightness(1.15) hue-rotate(-24deg) saturate(1.05);
  display: block !important; /* ensure it's not hidden by other rules */
  opacity: 1 !important;
}

/* Pattern overlay sits above video, creates transparent texture layer */
.p-home .hero .hero-pattern {
  position: absolute;
  inset: 0;
  z-index: 1; /* above video (z-index: 0), below scrim (z-index: 2) */
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238aa9ff' fill-opacity='0.28'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: var(--hero-pattern-size) var(--hero-pattern-size);
  opacity: var(--hero-pattern-opacity);

  /* Use screen blend mode for a transparent additive effect */
  mix-blend-mode: screen;
}

/* Dark scrim sits above pattern, provides contrast but lets pattern show */
.p-home .hero .hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2; /* above pattern (z-index: 1), below content (z-index: 3) */
  background: linear-gradient(180deg, rgb(7 17 48 / var(--hero-scrim-top-alpha)) 0%, rgb(5 12 32 / var(--hero-scrim-bottom-alpha)) 70%);
  pointer-events: none;
}

/* Hero content sits above scrim */
.p-home .hero .hero-content {
  position: relative;
  z-index: 3; /* ensure content is above pattern and scrim */
  max-width: 1400px; /* wider container for more words per line */
  width: 95%; /* use most of available space */
  margin: 0 auto;
  padding: 20px 40px; /* more horizontal padding for better spacing */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Reduce bottom gap so hero blends into next section */
.p-home .hero {
  padding-bottom: 60px;
}

.p-home .hero-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.p-home .btn {
  padding: 12px 28px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
}

.p-home .btn-primary {
  border: 2px solid var(--accent-orange);
  background-color: var(--accent-orange);
  color: var(--white-text);
  padding: 14px 36px;
  border-radius: 999px; /* pill style */
  font-size: 1.05rem;
}

.p-home .btn-primary:hover,
.p-home .btn-primary:focus-visible {
  background-color: var(--accent-orange-dark);
  border-color: var(--accent-orange-dark);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgb(0 0 0 / 20%);
}

.p-home .btn-secondary {
  border: 2px solid var(--accent-blue);
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
  padding: 12px 30px;
  border-radius: 999px; /* pill style */
  box-shadow: 0 6px 10px rgb(0 0 0 / 20%);
}

.p-home .btn-secondary:hover {
  background: linear-gradient(135deg, var(--accent-blue-dark) 0%, var(--accent-blue) 100%);
  border-color: var(--accent-blue-dark);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgb(0 0 0 / 26%);
}

/* Keep home hero secondary CTAs consistently blue in both themes. */
.p-home .hero-buttons .btn-secondary,
.p-home .hero-actions .btn-secondary {
  border: 2px solid var(--accent-blue) !important;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%) !important;
  color: #fff !important;
}

.p-home .hero .hero-buttons a.btn.btn-secondary,
.p-home .hero .hero-actions a.btn.btn-secondary,
.p-home .hero .hero-buttons a.btn.btn-secondary:visited,
.p-home .hero .hero-actions a.btn.btn-secondary:visited {
  border: 2px solid var(--accent-blue) !important;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%) !important;
  color: #fff !important;
}

body.light-mode.p-home .hero .hero-buttons .btn.btn-secondary,
body.light-mode.p-home .hero .hero-actions .btn.btn-secondary {
  border-color: var(--accent-blue) !important;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%) !important;
  color: #fff !important;
}

body.light-mode.p-home .hero .hero-buttons .btn.btn-secondary:hover,
body.light-mode.p-home .hero .hero-actions .btn.btn-secondary:hover,
body.light-mode.p-home .hero .hero-buttons .btn.btn-secondary:focus,
body.light-mode.p-home .hero .hero-actions .btn.btn-secondary:focus {
  border-color: var(--accent-blue-dark) !important;
  background: linear-gradient(135deg, var(--accent-blue-dark) 0%, var(--accent-blue) 100%) !important;
  color: #fff !important;
}

/* --- Shared Section Styles --- */
.p-home .section-bg {
    background-color: var(--home-section-light-bg);
    padding: 1px 0;
    transition: background-color var(--transition-speed) ease;
    background-image: var(--home-section-light-image);
    background-blend-mode: var(--home-section-blend-mode);
    border-top: 1px solid var(--home-section-divider);
}

.p-home .section-bg-dark {
    background-color: var(--home-section-dark-bg);
    padding: 1px 0;
    transition: background-color var(--transition-speed) ease;
    background-image: var(--home-section-dark-image);
    background-blend-mode: var(--home-section-blend-mode);
    border-top: 1px solid var(--home-section-divider);
}

/* --- Features Section --- */
.p-home .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 30px;
}

.p-home .feature-card {
  background: var(--home-surface-bg);
  padding: 30px;
  border-radius: var(--border-radius);
  border: 1px solid var(--home-surface-border);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--home-surface-shadow);
}

.p-home .feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 26px rgb(15 23 42 / 16%);
}

/* Keep expanded "Why QueryKey Cases?" cards visually subordinate to top step cards:
   faint white border at rest, slightly stronger on hover. */
.p-home .toggle-content-wrapper .feature-card {
  border-color: rgb(255 255 255 / 14%);
}

.p-home .toggle-content-wrapper .feature-card:hover {
  border-color: rgb(255 255 255 / 24%);
}

.p-home .feature-icon {
  font-size: 2.5rem;
  color: var(--accent-orange);
  margin-bottom: 15px;
}

/* New Toggle Section */
.p-home .toggle-section-container {
    padding-bottom: 50px;
}

.p-home .toggle-content-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease;
}

.p-home .toggle-content-wrapper.active {
    max-height: 3000px;
    opacity: 1;
}

.p-home .toggle-btn {
    background: var(--accent-orange);
    border: 2px solid var(--accent-orange);
    color: var(--white-text);
    cursor: pointer;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    width: 100%;
    margin: 20px auto 50px;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.p-home .toggle-btn:hover {
    background-color: var(--accent-orange-dark);
    border-color: var(--accent-orange-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgb(0 0 0 / 20%);
}

.p-home .toggle-btn.active {
    color: var(--white-text);
    background-color: var(--accent-orange-dark);
    border-color: var(--accent-orange-dark);
}

.p-home .toggle-btn .icon {
    transition: transform 0.5s ease;
}

.p-home .toggle-btn.active .icon {
  transform: rotate(180deg);
}

body.light-mode .p-home .toggle-btn {
    background: var(--light-orange-text);
    border-color: var(--light-orange-text);
    color: var(--white-text);
}

body.light-mode .p-home .toggle-btn .icon {
    color: var(--white-text);
}

body.light-mode .p-home .toggle-btn:hover {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--white-text);
}

/* --- How It Works Section --- */
.p-home .how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  text-align: center;
}

.p-home .step-card {
    background: var(--home-surface-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent-orange);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color var(--transition-speed) ease;
    box-shadow: var(--home-surface-shadow);
}

.p-home .step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgb(0 0 0 / 20%);
}

.p-home .step-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-orange);
  width: 50px;
  height: 50px;
  line-height: 50px;
  border-radius: 50%;
  border: 2px solid var(--accent-orange);
  margin: 0 auto 20px;
}

/* --- Developer Integration Section --- */
.p-home .dev-integration-card {
    background: var(--home-surface-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--home-surface-border);
    box-shadow: var(--home-surface-shadow);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.p-home .dev-audience-nav {
  display: flex;
  width: fit-content;
  gap: 10px;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--home-surface-border);
  border-radius: 999px;
}

.p-home .dev-audience-link {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--light-text);
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.p-home .dev-audience-link.active {
  background: var(--accent-orange);
  color: var(--white-text);
}

.p-home .dev-audience-link:hover {
  transform: translateY(-1px);
}

.p-home .dev-audience-panel {
  display: none;
}

.p-home .dev-audience-panel.active {
  display: block;
}

.p-home .dev-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--home-surface-border);
  margin-bottom: 30px;
}

.p-home .dev-tab-link {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.p-home .dev-tab-link.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.p-home .dev-tab-pane {
  display: none;
}

.p-home .dev-tab-pane.active {
  display: block;
}

.p-home .dev-tab-intro {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    margin-bottom: 15px;
}

/* Ensure Bootstrap helper note remains legible across dark/light themes. */
.p-home .dev-tab-note {
  margin-top: 20px;
  font-size: var(--font-size-sm);
  color: var(--light-text);
}

body.light-mode .p-home .dev-tab-note {
  color: var(--dark-text);
}

.p-home .agent-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 22px 0 24px;
}

.p-home .agent-onboarding-card {
  padding: 22px;
  border: 1px solid var(--home-surface-border);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.03);
}

.p-home .agent-onboarding-card h3 {
  margin-bottom: 10px;
}

.p-home .agent-onboarding-card p {
  margin-bottom: 14px;
}

.p-home .agent-onboarding-steps {
  margin: 0 0 0 20px;
  padding: 0;
  line-height: 1.7;
}

.p-home .agent-onboarding-steps li + li {
  margin-top: 6px;
}

.p-home .agent-onboarding-steps li::marker {
  color: var(--accent-orange);
  font-weight: 700;
}

.p-home .agent-onboarding-card .code-block {
  margin-top: 0;
}

.p-home .agent-onboarding-card pre {
  min-height: 24px;
}

/* Agents tab: narrow column centered on the page, copy and code left-aligned */
.p-home .home-agent-shell {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.p-home .home-agent-panel .code-caption {
  margin-top: 0;
}

.p-home .home-agent-intro {
  margin: 0 0 1rem;
  line-height: 1.65;
  color: var(--light-text);
  font-size: 1.02rem;
}

.p-home .home-agent-connect-row {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 0;
}

.p-home .home-agent-connect-row .btn-primary {
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
}

body.light-mode .p-home .home-agent-intro {
  color: var(--dark-text);
}

/* Embedded device pairing: spacing only (inherits dev card surface) */
.p-home .home-connect-agent-mount {
  margin-top: 1.25rem;
}

.p-home .home-connect-agent-mount .connect-agent-actions {
  justify-content: center;
}

body.light-mode .p-home .home-connect-agent-mount .connect-agent-lead,
body.light-mode .p-home .home-connect-agent-mount .connect-agent-note,
body.light-mode .p-home .home-connect-agent-mount .connect-agent-pairing-status,
body.light-mode .p-home .home-connect-agent-mount .connect-agent-steps {
  color: var(--dark-text);
}

body.light-mode .p-home .home-connect-agent-mount .connect-agent-status--loading {
  color: var(--dark-text);
}

.p-home .dev-tab-note a {
    color: var(--qk-accent-orange);
    text-decoration: underline;
}

.p-home .code-block {
    background-color: var(--code-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 15px;
    position: relative;
    transition: background-color var(--transition-speed) ease;
}

.p-home pre {
    color: var(--code-text-color);
    font-family: QueryKeyMono, monospace;
    white-space: pre-wrap;
    
    /* Avoid deprecated break-word; prefer modern wrapping */
    word-break: normal;
    overflow-wrap: anywhere;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color var(--transition-speed) ease;
}

.p-home .copy-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-orange);
    border: none;
    color: var(--white-text);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.p-home .copy-button:hover {
    background-color: var(--accent-orange-dark);
}

.p-home .code-caption {
    font-weight: bold;
    margin-bottom: 8px;
    font-family: QueryKeyMono, monospace;
}

body.light-mode .p-home .dev-audience-nav {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .p-home .dev-audience-link {
  color: var(--dark-text);
}

body.light-mode .p-home .agent-onboarding-card {
  background: rgba(0, 0, 0, 0.02);
}

/* --- CTA Section --- */
.p-home .cta-section {
  text-align: center;
}

.p-home .cta-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* --- Footer Highlights --- */
.p-home .footer-tagline {
  text-align: center;
}

.p-home .footer-tagline h4 {
  font-size: 1.2rem;
  color: var(--white-text);
  margin-bottom: 10px;
}

.p-home .footer-tagline p {
  color: var(--muted-text);
  max-width: none;
}

/* --- Animation --- */
.p-home .fade-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-home .fade-in.pending-animation {
  opacity: 0;
  transform: translateY(30px);
}

.p-home .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide in from left */
.p-home .slide-in-left {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-home .slide-in-left.pending-animation {
  opacity: 0;
  transform: translateX(-40px);
}

.p-home .slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.p-home .slide-in-right {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-home .slide-in-right.pending-animation {
  opacity: 0;
  transform: translateX(40px);
}

.p-home .slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up animation */
.p-home .scale-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-home .scale-in.pending-animation {
  opacity: 0;
  transform: scale(0.9);
}

.p-home .scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animation delays for grid items */
.p-home .fade-in:nth-child(1) {
  transition-delay: 0s;
}

.p-home .fade-in:nth-child(2) {
  transition-delay: 0.1s;
}

.p-home .fade-in:nth-child(3) {
  transition-delay: 0.2s;
}

.p-home .fade-in:nth-child(4) {
  transition-delay: 0.3s;
}

.p-home .fade-in:nth-child(5) {
  transition-delay: 0.4s;
}

.p-home .fade-in:nth-child(6) {
  transition-delay: 0.5s;
}

/* --- Forms & Pricing --- */
.p-home .form-group {
  margin-bottom: 20px;
}

.p-home .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.p-home .form-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--home-surface-border);
    background: var(--primary-navy);
    color: var(--white-text);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

/* Base focus before light-mode variant for ordering */
.p-home .form-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgb(247 127 0 / 50%);
  outline: none;
}

/* Move light-mode variant after base focus for correct ordering */
body.light-mode .p-home .form-input {
    background: #e2e8f0;
}

.p-home .form-text-link {
  display: block;
  text-align: right;
  font-size: 0.9rem;
  margin-top: 8px;
}

.p-home .pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.p-home .pricing-card {
    background: var(--home-surface-bg);
    border: 1px solid var(--home-surface-border);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--home-surface-shadow);
    cursor: pointer;
}

.p-home .pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 26px rgb(15 23 42 / 16%);
}

.p-home .pricing-card.featured {
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgb(247 127 0 / 30%);
}

.p-home .pricing-card h4 {
  font-size: 1.2rem;
}

.p-home .price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white-text);
  margin: 10px 0;
}

.p-home .price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--light-text);
}

.p-home .pricing-features {
  list-style: none;
  margin: 20px 0;
  font-size: 0.9rem;
}

.p-home .pricing-features li {
  margin-bottom: 10px;
}

.p-home #registration-form-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.p-home .plan-selection-info {
    text-align: center;
    margin: 30px 0 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Responsive --- */
@media (width <= 768px) {
    .p-home .container {
      padding: 60px 0;
    }

    h1 {
      font-size: 2.2rem;
    }

    h2 {
      font-size: 1.8rem;
    }
}

/* Responsive hero tweaks */
@media (width <= 900px) {
  .p-home .hero {
    padding: 60px 12px 40px;
  }

  .p-home .hero .hero-title {
    font-size: clamp(2rem, 7.5vw, 3rem);
  }

  .p-home .hero .subtitle {
    font-size: 1rem;
    max-width: 420px;
  }

  .p-home .hero .hero-media video {
    transform: scale(1.06);
  }

  .p-home .hero .hero-media {
    background: var(--hero-fallback-gradient);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
  }
}

/* --- Page-specific overrides for index.html --- */
.p-home .toggle-content-wrapper .features-grid {
    padding-top: 30px;
}

.p-home .dev-integration-card + .cta-buttons {
    margin-top: 40px;
}

.p-home .main-footer .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* Override h2 in dev integration section */
.p-home .section-bg .container h2:nth-of-type(2) {
    color: var(--accent-orange);
    font-size: 2.5rem;
    text-align: center;
}

/* Light-mode account modal is defined near base above */

/* --- API Features Grid --- */
.p-home .api-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.p-home .api-feature-card {
    background: var(--home-surface-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--home-surface-border);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--home-surface-shadow);
}

.p-home .api-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 26px rgb(15 23 42 / 16%);
}

.p-home .api-feature-card h3 {
    color: var(--white-text);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.p-home .api-feature-card p {
    color: var(--muted-text);
    font-size: 0.9rem;
}

/* --- Chat Widget Overrides --- */
body.p-home .qk-chat-button {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
  color: #fff;
  border: 2px solid rgb(255 255 255 / 18%);
  box-shadow: 0 12px 28px rgb(15 29 56 / 35%);
  z-index: 900;
}

body.light-mode.p-home .qk-chat-button {
  border: 2px solid rgb(0 0 0 / 12%);
  box-shadow: 0 12px 28px rgb(15 29 56 / 22%);
}

body.p-home .qk-chat-button:hover,
body.p-home .qk-chat-button:focus {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgb(15 29 56 / 45%);
}

body.p-home .qk-chat-panel {
  background: linear-gradient(160deg, rgb(17 34 60 / 95%), rgb(12 23 46 / 96%));
  border: 1px solid rgb(255 255 255 / 12%);
  color: var(--white-text);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 950;
}

@media (max-width: 1100px) {
  body.p-home .qk-chat-button {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  body.p-home .qk-chat-panel {
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 72px);
  }
}

body.light-mode.p-home .qk-chat-panel {
  background: linear-gradient(160deg, rgb(255 255 255 / 96%), rgb(230 235 245 / 94%));
  border: 1px solid rgb(0 0 0 / 8%);
  color: var(--dark-text);
  box-shadow: 0 22px 50px rgb(15 29 56 / 18%);
}

@media (max-width: 640px) {
  body.p-home .qk-chat-button {
    right: max(0.9rem, env(safe-area-inset-right));
    bottom: max(0.9rem, env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    box-shadow: 0 10px 22px rgb(15 29 56 / 32%);
  }

  body.p-home .qk-chat-panel {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 70px);
    width: min(calc(100vw - 1.5rem), 360px);
    max-height: min(70vh, 560px);
  }
}

@media (max-width: 480px) {
  body.p-home .qk-chat-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    bottom: max(0.8rem, env(safe-area-inset-bottom));
  }

  body.p-home .qk-chat-panel {
    right: max(0.5rem, env(safe-area-inset-right));
    width: min(calc(100vw - 1rem), 340px);
  }
}

body.p-home .qk-chat-header {
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

body.light-mode.p-home .qk-chat-header {
  border-bottom: 1px solid rgb(0 0 0 / 8%);
}

body.p-home .qk-chat-header h2,
body.p-home .qk-chat-header .qk-chat-subtitle {
  color: inherit;
}

body.p-home .qk-chat-message {
  background: rgb(62 99 238 / 18%);
  border: 1px solid rgb(62 99 238 / 25%);
}

body.p-home .qk-chat-message.user {
  background: rgb(247 127 0 / 22%);
  border-color: rgb(247 127 0 / 35%);
}

body.light-mode.p-home .qk-chat-message {
  background: rgb(62 99 238 / 12%);
  border: 1px solid rgb(62 99 238 / 18%);
}

body.light-mode.p-home .qk-chat-message.user {
  background: rgb(247 127 0 / 16%);
  border-color: rgb(247 127 0 / 25%);
}

body.p-home .qk-chat-footer textarea {
  background: rgb(17 34 60 / 75%);
  border: 1px solid rgb(255 255 255 / 14%);
  color: var(--white-text);
}

body.light-mode.p-home .qk-chat-footer textarea {
  background: rgb(242 245 252 / 85%);
  border: 1px solid rgb(0 0 0 / 12%);
  color: var(--dark-text);
}

body.p-home .qk-chat-footer button {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
  border: none;
  color: #fff;
  font-weight: 600;
}

body.p-home .qk-chat-footer button:hover,
body.p-home .qk-chat-footer button:focus {
  background: linear-gradient(135deg, var(--accent-orange-dark), #c75600);
}

body.p-home .qk-chat-suggestion {
  background: rgb(62 99 238 / 18%);
  border-color: rgb(62 99 238 / 25%);
  color: var(--white-text);
}

body.p-home .qk-chat-suggestion:hover,
body.p-home .qk-chat-suggestion:focus {
  background: rgb(62 99 238 / 30%);
}

body.light-mode.p-home .qk-chat-suggestion {
  color: var(--light-blue-text);
}

/*
==========================================================================
Home-specific adjustments
---------------------------------------------------------------------------
Remove the orange radial highlight from the hero overlay so the home page
hero differs slightly from other pages and matches the blue-only gradient
shown in the reference image (no orange in background gradient/overlay).
========================================================================== */
.p-home .hero::after {
  background: radial-gradient(circle at 82% 0%, rgb(62 99 238 / 18%), transparent 58%);
}

/* In-page anchor from hero “Get Started” — offset fixed/sticky shell header */
.p-home #developer-integration {
  scroll-margin-top: 5.5rem;
}
