/* ============================================================
   AI Dentist – Responsive Stylesheet
   Mobile-first breakpoints
   ============================================================ */

/* ---------- Large Desktop (≥1400px) ---------- */
@media (min-width: 1400px) {
  :root {
    --section-padding: 78px;
  }

  .container {
    max-width: 1200px;
  }

  .app-screen-item img {
    width: 155px;
  }
}

/* ---------- Desktop Timeline (≥992px) ---------- */
@media (min-width: 992px) {
  .timeline-track {
    display: block;
    position: absolute;
    top: 18px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent), var(--color-warning));
    opacity: 0.25;
    z-index: 0;
  }

  .timeline-row {
    position: relative;
    z-index: 1;
  }

  .timeline-step::after {
    content: '';
    position: absolute;
    top: 18px;
    right: -12%;
    width: 24%;
    height: 2px;
    background: transparent;
  }
}

/* Hero columns scale independently without vertically offsetting the poster. */
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
}

.hero-copy-column,
.hero-image-column {
  min-width: 0;
}

.hero-section {
  padding: calc(var(--navbar-height) + 28px) 0 32px;
  background: radial-gradient(ellipse at 82% 44%, rgba(var(--color-secondary-rgb), 0.08), transparent 48%), var(--color-bg);
}

.hero-title {
  font-size: clamp(48px, 5vw, 72px);
}

.hero-title .highlight-coral,
.hero-title .sub-heading-teal {
  display: block;
}

.hero-subtitle {
  max-width: none;
}

.hero-artwork {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(680px, calc(100svh - var(--navbar-height) - 132px));
  background: url('../images/hero-premium-v2.png') center bottom / contain no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
}

.hero-mobile-artwork {
  display: none;
}

.hero-mobile-banner-copy {
  display: none;
}

.hero-image-column {
  position: relative;
  isolation: isolate;
}

.hero-image-column::before {
  content: '';
  position: absolute;
  inset: 8% -3% 5%;
  border-radius: 48% 48% 40% 40%;
  background: radial-gradient(ellipse at 50% 45%, var(--color-secondary-glow), var(--color-secondary-soft) 62%, transparent 72%);
}

.hero-download {
  background: linear-gradient(120deg, var(--color-accent), var(--color-accent-end));
  box-shadow: 0 12px 32px rgba(var(--color-accent-rgb), 0.12);
}

.hero-download-disclaimer {
  max-width: 560px;
}

.hero-trust {
  margin-top: 20px;
  padding-top: 16px;
  gap: 16px !important;
}

@media (min-width: 992px) and (max-height: 800px) {
  .hero-section {
    padding-top: calc(var(--navbar-height) + 20px);
    padding-bottom: 20px;
  }

  .hero-eyebrow { margin-bottom: 12px; }
  .hero-title { font-size: clamp(46px, 4.6vw, 64px); margin-bottom: 14px; }
  .sub-heading-teal { font-size: clamp(26px, 2.4vw, 34px); }
  .hero-subtitle { font-size: 16px; margin-bottom: 18px; }
  .hero-download { grid-template-columns: minmax(0, 1fr) 158px; padding: 14px; }
  .hero-download h2 { font-size: 18px; margin-bottom: 10px; }
  .hero-download-copy { padding-right: 16px; }
  .hero-download-qr { padding-left: 16px; }
  .hero-download-qr img { width: 118px; height: 118px; }
  .hero-download-disclaimer { margin: 10px 0 14px; }
  .btn-hero-secondary { padding: 10px 16px; font-size: 16px; }
  .hero-trust { margin-top: 14px; padding-top: 12px; }
  .trust-item strong { font-size: 14px; }
}

@media (max-width: 991.98px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .hero-content {
    max-width: 640px;
    margin: 0 auto;
  }

  .hero-artwork {
    height: auto;
    aspect-ratio: 520 / 660;
    max-width: 460px;
    margin: 0 auto;
  }
}

/* ---------- Tablet (768px – 991px) ---------- */
@media (max-width: 991.98px) {
  :root {
    --section-padding: 4.5rem;
    --navbar-height: 116px;
  }

  /* Compact, scrollable navigation keeps the fixed header clear of page content. */
  #mainNavbar .container {
    display: block;
  }

  #mainNavbar .navbar-brand {
    display: inline-flex !important;
    min-height: 40px;
    margin-right: 0;
  }

  .mobile-nav-menu {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px 0;
    margin-top: 4px;
    gap: 4px;
  }

  .mobile-nav-menu .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 10px !important;
  }

  .navbar-actions {
    margin-top: 1rem;
    padding-bottom: 0.75rem;
  }

  /* Hero */
  .hero-section {
    min-height: auto;
    padding-bottom: 4rem;
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-trust {
    justify-content: center;
  }

  .hero-mockup-wrap,
  .hero-visual {
    margin-top: 1.5rem;
  }

  .hero-float-1,
  .hero-float-2 {
    display: none;
  }

  /* Features */
  .feature-col {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  /* Report */
  .report-preview-img {
    height: 300px;
  }

  .report-card {
    margin-top: 1rem;
  }

  /* Dentist */
  .dentist-card {
    flex-wrap: wrap;
  }

  .dentist-book-btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  /* App carousel */
  .app-carousel {
    padding: 0 2.75rem 2.5rem;
  }

  .app-screen-item img {
    width: 120px;
  }

  /* CTA */
  .cta-banner {
    padding: 2.5rem 2rem;
    text-align: center;
  }

  .cta-buttons {
    justify-content: center !important;
  }

  /* Section headers */
  .section-header.text-center + .row,
  .section-header + .timeline,
  .section-header + .app-slider-wrap {
    margin-top: 0;
  }
}

/* ---------- Mobile (≤767px) ---------- */
@media (max-width: 767.98px) {
  .row.g-5 {
    --bs-gutter-x: 1.5rem;
  }

  .footer-links a {
    overflow-wrap: anywhere;
  }

  :root {
    --section-padding: 55px;
    --radius-lg: 18px;
  }

  /* Navbar */
  .brand-name {
    font-size: 1.05rem;
  }

  .nav-link {
    padding: 0.6rem 0.5rem !important;
  }

  /* Hero */
  .hero-title {
    font-size: 43px;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }

  .hero-trust {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .trust-divider {
    display: none;
  }

  .phone-mockup {
    max-width: 280px;
    padding: 0.5rem;
  }

  .hero-poster-img {
    max-width: 100%;
    max-height: 520px;
  }

  .hero-blob-1 {
    width: 300px;
    height: 300px;
  }

  .hero-blob-2 {
    width: 250px;
    height: 250px;
  }

  /* Features – 2 columns */
  .feature-col {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .feature-card {
    padding: 1.5rem 1.25rem;
  }

  /* Timeline – Vertical on mobile */
  .timeline-track {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 18px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary), var(--color-accent), var(--color-warning));
    opacity: 0.2;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline-step {
    text-align: left;
    padding: 1.25rem 0 1.25rem 3rem;
    position: relative;
  }

  .timeline-number {
    position: absolute;
    left: 0;
    top: 1.25rem;
    margin-bottom: 0;
    width: 36px;
    height: 36px;
  }

  .timeline-icon {
    display: inline-block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  /* Report */
  .report-preview-img {
    height: 240px;
  }

  .report-card {
    padding: 1.75rem;
  }

  .report-score-num {
    font-size: 2.75rem;
  }

  .report-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Chat */
  .chat-body {
    min-height: 200px;
  }

  /* Dentist */
  .dentist-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .dentist-meta {
    justify-content: center;
  }

  .map-illustration {
    min-height: 240px;
  }

  /* Family */
  .family-card {
    padding: 1.5rem 1rem;
  }

  .family-score {
    font-size: 1.5rem;
  }

  /* App */
  .app-carousel {
    padding: 0 2rem 2rem;
  }

  .app-screens-track {
    gap: 0.75rem;
  }

  .app-screen-item img {
    width: 100px;
  }

  .app-nav-btn {
    width: 36px;
    height: 36px;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 1.5rem;
  }

  /* Pricing */
  .pricing-card {
    padding: 2rem 1.5rem;
  }

  .pricing-price {
    font-size: 2.5rem;
  }

  /* FAQ */
  .faq-accordion .accordion-button {
    font-size: 0.88rem;
    padding: 1rem 1.15rem;
  }

  /* CTA */
  .cta-banner {
    padding: 2rem 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .cta-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .site-footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-about {
    max-width: 100%;
  }
}

/* ---------- Small Mobile (≤575px) ---------- */
@media (max-width: 575.98px) {
  /* Features – single column */
  .feature-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .hero-title {
    font-size: 43px;
  }

  .section-title {
    font-size: 30px;
  }

  .app-screen-item {
    flex: 0 0 45%;
  }

  .app-screen-item img {
    width: 100%;
    max-width: 130px;
    margin: 0 auto;
  }

  .app-screens-track {
    justify-content: center;
  }

  /* Timeline single column full width */
  .timeline-step {
    padding-left: 3.5rem;
  }
}

/* ---------- Extra Small (≤400px) ---------- */
@media (max-width: 400px) {
  .hero-eyebrow {
    font-size: 0.75rem;
  }

  .score-ring {
    width: 90px;
    height: 90px;
  }

  .score-value {
    font-size: 1.6rem;
  }

  .pricing-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.85rem;
  }
}

/* ---------- Compact responsive navigation and phone hero ---------- */
@media (max-width: 991.98px) {
  :root {
    --navbar-height: 72px;
  }

  #mainNavbar {
    min-height: var(--navbar-height);
    padding: 10px 0;
  }

  #mainNavbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  #mainNavbar .navbar-brand {
    min-height: 0;
    margin: 0;
  }

  #mainNavbar .navbar-brand img {
    width: 40px;
    height: 40px;
  }

  .mobile-nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .mobile-nav-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 82px;
    padding: 9px 13px;
    border-radius: 12px;
    background: var(--color-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(var(--color-accent-rgb), 0.2);
  }

  .mobile-nav-trigger i {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav-menu {
    display: none;
    flex: 0 0 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 4px 0 0;
    padding: 10px 0 2px;
    border-top: 1px solid var(--color-border-light);
    overflow: visible;
  }

  .mobile-nav-toggle:checked + .mobile-nav-trigger {
    background: var(--color-accent-hover);
  }

  .mobile-nav-toggle:checked ~ .mobile-nav-menu {
    display: grid;
  }

  .mobile-nav-menu .nav-link {
    min-width: 0;
    padding: 9px 10px !important;
    border-radius: 10px;
    background: var(--color-surface-soft);
    text-align: left;
    white-space: normal;
  }

  .mobile-nav-menu .nav-link:last-child {
    grid-column: 1 / -1;
    background: rgba(var(--color-accent-rgb), 0.1);
    color: var(--color-accent) !important;
    text-align: center;
  }

  .hero-section {
    padding-top: calc(var(--navbar-height) + 28px);
  }

  .hero-image-column {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 8px 8px 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
  }

  .hero-image-column::before {
    inset: 5% 1% 10%;
  }

  .hero-artwork {
    width: 100%;
    height: 500px;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 18px 18px 0 0;
    background-position: center bottom;
    background-size: contain;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    padding-bottom: 48px;
    text-align: left;
  }

  .hero-layout {
    gap: 24px;
  }

  .hero-content {
    width: 100%;
  }

  .hero-mobile-artwork {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(470px, 112vw, 560px);
    margin: 0 0 22px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.98) 36%, rgba(255, 255, 255, 0.68) 49%, rgba(255, 255, 255, 0) 65%),
      url('../images/hero-premium-v2.png') right -8px bottom / auto 90% no-repeat,
      radial-gradient(circle at 70% 68%, rgba(var(--color-secondary-rgb), 0.15), rgba(var(--color-secondary-rgb), 0.04) 62%, var(--color-surface) 78%);
    box-shadow: 0 16px 38px rgba(18, 59, 104, 0.09);
    overflow: hidden;
  }

  .hero-mobile-banner-copy {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 48%;
    padding: 24px 0 22px 22px;
  }

  .hero-content > .hero-eyebrow,
  .hero-content > .hero-title {
    display: none;
  }

  .hero-mobile-banner-copy .hero-eyebrow {
    margin-bottom: 12px;
    max-width: 170px;
    font-size: 10px;
    line-height: 1.35;
  }

  .hero-mobile-banner-copy .hero-title {
    margin: 0;
    font-size: clamp(31px, 8vw, 40px);
    line-height: 0.98;
  }

  .mobile-title-word {
    display: block;
    margin-bottom: 3px;
  }

  .mobile-title-teal {
    color: var(--color-teal-dark);
  }

  .hero-image-column {
    display: none;
  }

  .hero-eyebrow {
    margin-bottom: 14px;
  }

  .hero-title {
    margin-bottom: 18px;
    font-size: clamp(36px, 10.5vw, 44px);
    line-height: 1.04;
  }

  .sub-heading-teal {
    margin-top: 10px;
    font-size: clamp(25px, 7.4vw, 31px);
  }

  .hero-subtitle {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.6;
  }

  .hero-download {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
    border-radius: 20px;
  }

  .hero-download-copy {
    padding-right: 0;
  }

  .hero-download h2 {
    margin-bottom: 14px;
    font-size: 18px;
    text-align: left;
  }

  .hero-store-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .hero-store-link {
    min-width: 0;
    min-height: 58px;
    justify-content: center;
    padding: 10px 8px;
  }

  .hero-store-link i {
    font-size: 22px;
  }

  .hero-store-link strong {
    font-size: 14px;
  }

  .hero-download-qr {
    display: flex;
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 0;
  }

  .hero-download-disclaimer {
    margin-bottom: 16px;
  }

  .hero-trust {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start !important;
    gap: 8px !important;
    margin-top: 12px;
    padding-top: 14px;
    text-align: center;
  }

  .trust-item,
  .trust-badge {
    align-items: center;
    justify-content: center;
    gap: 4px !important;
  }

  .trust-item strong,
  .trust-badge span {
    font-size: 11px;
    line-height: 1.35;
  }

  .trust-divider {
    display: none;
  }

  .hero-image-column {
    width: min(100%, 350px);
  }

  .hero-artwork {
    height: 410px;
  }

  .hero-benefits {
    padding: 13px 4px;
  }

  .hero-benefits li {
    gap: 4px;
    font-size: 9px;
  }

  .hero-benefits i {
    font-size: 17px;
  }

  .chat-bubble {
    max-width: 92%;
  }
}

@media (max-width: 400px) {
  #mainNavbar .brand-name {
    font-size: 0.98rem;
  }

  .mobile-nav-trigger {
    min-width: 74px;
    padding: 8px 10px;
  }

  .hero-title {
    font-size: 34px;
  }

  .sub-heading-teal {
    font-size: 24px;
  }

  .hero-store-link small {
    font-size: 7px;
  }

  .hero-store-link strong {
    font-size: 12px;
  }

  .hero-artwork {
    height: 370px;
  }
}

/* ---------- Print ---------- */
@media print {
  .hero-bg,
  .hero-float-icon,
  #mainNavbar,
  .app-nav-btn,
  .app-indicators,
  .cta-banner,
  .chat-input-bar {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }

  .section {
    padding: 2rem 0;
    break-inside: avoid;
  }

  .card-lift:hover {
    transform: none;
    box-shadow: var(--shadow-xs);
  }
}

/* ---------- Landscape Mobile ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--navbar-height) + 2rem);
    padding-bottom: 3rem;
  }

  .phone-mockup {
    max-width: 220px;
  }
}

/* ---------- High DPI ---------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .phone-frame {
    box-shadow: var(--shadow-xl), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  }
}

/* ---------- Dark mode preference (subtle, not full dark theme) ---------- */
@media (prefers-color-scheme: dark) {
  /* Keep light theme for healthcare trust – no overrides */
}

/* ---------- Hover capability (touch devices) ---------- */
@media (hover: none) {
  .card-lift:hover {
    transform: none;
    box-shadow: var(--shadow-xs);
  }

  .app-screen-item:hover img {
    transform: none;
  }
}
