﻿/* ==========================================================================
   Speak.Hub.Landing - Responsive Stylesheet
   Optimized for All Viewports: Desktops, Tablets, iPhone 16 Pro Max (440px)
   and Small Android / iOS Mobile Screens.
   ========================================================================== */

/* Universal Responsive Rules */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   1. Laptop & Landscape Tablets (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .mockup-canvas {
    grid-template-columns: 180px 1fr;
  }

  .mockup-canvas .mockup-pane:last-child {
    display: none;
  }

  .contact-section-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .pricing-card.featured {
    transform: none;
  }
}

/* ==========================================================================
   2. Tablets & Mobile Devices (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section {
    padding: 3.75rem 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .section-title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .section-desc {
    font-size: 1rem;
  }

  /* Navigation Drawer */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-xl);
    transform: translateY(-150%);
    transition: transform var(--transition-normal);
    z-index: calc(var(--z-header) - 1);
  }

  .nav-menu.open {
    transform: translateY(0);
  }

  .nav-toggle-btn {
    display: block;
  }

  .nav-actions .btn-primary {
    display: none;
  }

  /* Grids & Cards */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Hero Elements */
  .hero-title {
    font-size: clamp(2rem, 6.5vw, 2.85rem);
  }

  .hero-desc {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 3rem;
  }

  .stat-item {
    padding: 1.15rem 0.85rem;
  }

  .stat-number {
    font-size: 1.75rem;
    word-break: break-word;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* Hero Mockup */
  .hero-mockup-wrapper {
    max-width: 100%;
  }

  .hero-mockup-glow {
    filter: blur(40px);
    opacity: 0.15;
  }

  .mockup-canvas {
    grid-template-columns: 1fr;
    padding: 1rem;
    min-height: auto;
  }

  .mockup-canvas .mockup-pane:first-child,
  .mockup-canvas .mockup-pane:last-child {
    display: none;
  }

  /* Simulator Section */
  .simulator-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .simulator-toolbar-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .simulator-toolbar-devices {
    display: flex;
    gap: 0.35rem;
    width: 100%;
  }

  .simulator-device-btn,
  #simulator-reset-btn {
    flex: 1;
    padding: 0.4rem 0.35rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .simulator-mockup-canvas {
    grid-template-columns: 1fr !important;
    padding: 1rem;
    gap: 1rem;
  }

  .simulator-mobile-only-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .simulator-palette-pane {
    max-height: 280px;
  }

  .sim-palette-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .sim-palette-subheading,
  .sim-palette-tip {
    grid-column: 1 / -1;
  }

  .mockup-block-item {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  #simulator-canvas {
    min-height: 320px !important;
    max-height: 460px;
  }

  .simulator-inspector-pane {
    max-height: 450px;
  }

  @media (max-width: 768px) {
    .simulator-inspector-pane {
      display: none;
    }
    .simulator-inspector-pane.is-mobile-open {
      display: flex;
      animation: fadeIn 0.2s ease-in-out;
    }
  }

  /* Architecture Box */
  .tech-highlight-card {
    padding: 1.75rem 1.25rem;
  }

  /* Pricing Period Switch */
  .pricing-switch-wrapper {
    margin-bottom: 2.5rem;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Contact Form */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .contact-form-wrapper {
    padding: 1.75rem 1.25rem;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding-bottom: 4.5rem;
  }

  .footer-bottom > div:last-child {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  /* Floating Widgets on Mobile */
  .floating-widget {
    bottom: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }

  .floating-action-btn {
    width: 44px;
    height: 44px;
  }

  .floating-action-btn svg {
    width: 22px;
    height: 22px;
  }

  .floating-tooltip {
    display: none !important;
  }

  /* Audio Floating Controller (Compact Floating Circle on Mobile) */
  .audio-controller-widget {
    bottom: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    gap: 0;
  }

  .audio-icon-disc {
    width: 36px;
    height: 36px;
    box-shadow: none;
  }

  .audio-equalizer-bars,
  .audio-widget-info {
    display: none !important;
  }
}

/* ==========================================================================
   3. iPhone 16 Pro Max & Standard Smartphones (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-inner {
    padding: 0;
  }

  .brand-logo {
    font-size: 1.2rem;
    gap: 0.5rem;
  }

  .brand-logo-icon {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

  .hero-tag {
    font-size: 0.775rem;
    padding: 0.3rem 0.75rem;
  }

  .hero-title {
    font-size: 2rem;
    letter-spacing: -0.02em;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .stat-item {
    padding: 0.85rem 0.5rem;
    text-align: center;
  }

  .stat-number {
    font-size: 1.45rem;
  }

  .stat-label {
    font-size: 0.725rem;
    line-height: 1.3;
  }

  /* Browser Header on Small Screens */
  .browser-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .browser-online-badge-wrap {
    display: none;
  }

  .browser-address-bar {
    font-size: 0.725rem;
    padding: 0.25rem 0.5rem;
  }

  /* Simulator Palette */
  #simulator-blocks-list {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .mockup-block-item {
    padding: 0.45rem 0.5rem;
    font-size: 0.775rem;
  }

  /* Pricing Cards */
  .pricing-switch-wrapper {
    font-size: 0.85rem;
    gap: 0.4rem 0.6rem;
  }

  .pricing-switch-label {
    font-size: 0.85rem;
  }

  .pricing-card {
    padding: 1.5rem 1rem;
  }

  .pricing-amount {
    font-size: 2.15rem;
  }

  /* Contact Form */
  .contact-form-wrapper {
    padding: 1.25rem 0.85rem;
  }

  .form-title {
    font-size: 1.25rem;
  }

  .contact-direct-card {
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .contact-icon-box {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}
