/* ===================================================================
   OPTYWISE WEBSITE - COMPREHENSIVE MOBILE RESPONSIVENESS FIXES
   Applied across all pages for mobile, tablet, and desktop breakpoints
   =================================================================== */

/* Mobile Navigation - Hamburger Menu */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  z-index: 70;
}

.mobile-nav-toggle svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 2px;
}

/* Tablet Breakpoint: 768px - 1023px */
@media (max-width: 1023px) {
  /* Header adjustments */
  .header-container {
    padding: 0 20px;
  }

  .logo-text {
    font-size: 17px;
  }

  .logo-img {
    width: 26px;
    height: 26px;
  }

  nav .nav-links {
    gap: 18px;
    font-size: 13px;
  }

  nav {
    gap: 20px;
  }

  .btn-primary {
    padding: 10px 18px;
    font-size: 13px;
  }
}

/* Mobile Breakpoint: 320px - 767px */
@media (max-width: 767px) {
  /* ===== HEADER & NAVIGATION ===== */
  .header-container {
    padding: 0 16px;
    height: 64px;
  }

  .logo-img {
    width: 24px;
    height: 24px;
  }

  .logo-text {
    font-size: 16px;
  }

  /* Hide desktop navigation */
  nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 13, 27, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 24px 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  nav.mobile-nav-open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
  }

  .nav-link {
    padding: 16px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link.active {
    border-bottom-color: #14C7C3;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
    font-size: 16px;
  }

  /* Show hamburger menu */
  .mobile-nav-toggle {
    display: block;
  }

  /* ===== HERO SECTIONS ===== */
  .hero {
    margin-top: -64px;
    padding-top: 64px;
  }

  .hero-content {
    padding: 64px 20px 56px;
  }

  .hero-title {
    font-size: 36px !important;
    line-height: 1.15;
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 28px;
  }

  .hero-eyebrow {
    font-size: 11px;
    margin-bottom: 16px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
    font-size: 15px;
  }

  .hero-tags {
    font-size: 12px;
    gap: 8px;
    justify-content: center;
  }

  .hero-underline {
    white-space: normal;
  }

  /* Hero gradient adjustments */
  .hero-gradient-purple {
    width: 500px;
    height: 500px;
    top: -150px;
    right: -80px;
  }

  .hero-gradient-teal {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -120px;
  }

  /* Hero image container - hide on mobile */
  .hero-image-container,
  .hero-overlay {
    display: none;
  }

  /* ===== PRISM RAIL ===== */
  .prism-rail {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .prism-item {
    padding: 16px 20px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .prism-item:last-child {
    border-bottom: none;
  }

  .prism-label {
    font-size: 11px;
  }

  .prism-duration {
    font-size: 11px;
  }

  /* ===== SECTIONS ===== */
  section {
    padding: 72px 20px;
  }

  .section-container {
    padding: 0;
  }

  .section-eyebrow {
    font-size: 11px;
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 28px !important;
    line-height: 1.2;
    margin-bottom: 16px !important;
  }

  .section-description {
    font-size: 15px;
    line-height: 1.65;
  }

  .section-description-lg {
    font-size: 16px;
  }

  /* ===== GRIDS - Collapse to single column ===== */
  .problem-grid,
  .conviction-grid,
  .who-grid,
  .fde-grid,
  .different-grid,
  .why-fde-grid,
  .pod-grid,
  .ownership-grid,
  .capabilities-grid,
  .values-grid,
  .proof-grid,
  .form-grid,
  .solutions-grid,
  .audit-branches-grid,
  .hardening-grid,
  .industries-grid,
  .work-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }

  /* Specific grid adjustments */
  .capabilities-grid {
    gap: 20px;
  }

  .prism-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .prism-card {
    border-radius: 14px !important;
    border: 1px solid #ECEAF1 !important;
  }

  .prism-card:first-child,
  .prism-card:last-child {
    border-radius: 14px !important;
  }

  .prism-card:not(:first-child) {
    border-left: 1px solid #ECEAF1 !important;
  }

  /* ===== CARDS ===== */
  .fde-card,
  .different-card,
  .why-fde-card,
  .pod-card,
  .value-card,
  .capability-card,
  .solution-card,
  .audit-branch-card,
  .industry-card,
  .case-card {
    padding: 24px 20px;
  }

  .fde-card-title,
  .different-card-title,
  .why-fde-card-title,
  .pod-card-title,
  .value-title,
  .capability-title,
  .solution-title,
  .audit-branch-title {
    font-size: 18px;
  }

  .fde-card-text,
  .different-card-text,
  .why-fde-card-text,
  .pod-card-description,
  .value-description,
  .capability-description,
  .solution-description,
  .audit-branch-description {
    font-size: 14px;
  }

  /* ===== PROOF SECTION ===== */
  .proof-stat {
    font-size: 42px !important;
  }

  .proof-stat-small {
    font-size: 32px !important;
  }

  .proof-stat-label {
    font-size: 22px;
  }

  .proof-description {
    font-size: 13px;
  }

  /* ===== PRISM FRAMEWORK PAGE ===== */
  .prism-flow {
    flex-direction: column;
    gap: 48px;
  }

  .flow-line {
    display: none;
  }

  .prism-stage {
    width: 100%;
  }

  .stage-circle,
  .prism-step-circle {
    width: 80px;
    height: 80px;
    font-size: 36px;
  }

  .stage-label,
  .prism-step-label {
    font-size: 15px;
  }

  .stage-duration,
  .prism-step-duration {
    font-size: 12px;
  }

  .stage-hint {
    font-size: 11px;
    max-width: 100%;
  }

  /* PRISM Detail Cards */
  .prism-detail-card {
    padding: 28px 20px;
  }

  .prism-detail-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .prism-detail-letter {
    font-size: 42px;
  }

  .prism-detail-title {
    font-size: 24px;
  }

  .prism-detail-description {
    font-size: 15px;
  }

  .prism-detail-list li {
    font-size: 14px;
    padding-left: 22px;
  }

  .stage-detail-card {
    padding: 28px 20px;
    border-left-width: 4px;
  }

  .stage-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .stage-detail-letter {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .stage-detail-title {
    font-size: 24px;
  }

  .stage-deliverables {
    padding: 20px 16px;
  }

  /* ===== PRISM STEPPER ===== */
  .prism-stepper {
    padding: 40px 0;
  }

  .prism-steps {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .prism-flow-line {
    display: none;
  }

  /* ===== FORMS (Contact Page) ===== */
  .form-content {
    padding: 32px 24px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-input,
  .form-textarea {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .form-textarea {
    min-height: 120px;
  }

  .btn-submit {
    padding: 16px 28px;
    font-size: 16px;
  }

  .contact-card {
    position: static;
    padding: 28px 24px;
    margin-top: 24px;
  }

  .contact-heading {
    font-size: 20px;
  }

  /* ===== CTA SECTIONS ===== */
  .cta-section {
    padding: 80px 20px;
  }

  .cta-title {
    font-size: 32px !important;
    line-height: 1.2;
  }

  .cta-description {
    font-size: 16px;
    margin-bottom: 28px;
  }

  .btn-cta {
    width: 100%;
    padding: 18px 32px;
    font-size: 16px;
  }

  /* ===== FOOTER ===== */
  footer {
    padding-top: 56px;
  }

  .footer-container {
    padding: 48px 20px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 36px;
    padding-bottom: 40px;
  }

  .footer-brand-img {
    width: 28px;
    height: 28px;
  }

  .footer-brand-text {
    font-size: 18px;
  }

  .footer-tagline {
    font-size: 13px;
  }

  .footer-heading {
    font-size: 11px;
    margin-bottom: 14px;
  }

  .footer-links {
    gap: 10px;
    font-size: 13px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 0 24px;
    font-size: 12px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  /* ===== TOUCH TARGETS ===== */
  /* Ensure all interactive elements meet 44px minimum */
  .btn-primary,
  .btn-hero-primary,
  .btn-hero-secondary,
  .btn-cta,
  .btn-submit,
  .nav-link,
  .social-link,
  .filter-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* ===== CONTENT PADDING ===== */
  .problem-content,
  .conviction-content,
  .who-content,
  .security-edge-content {
    padding-top: 0;
  }

  /* ===== LISTS ===== */
  .security-list,
  .who-tags {
    gap: 12px;
  }

  .who-tag {
    font-size: 12px;
    padding: 8px 14px;
  }

  /* ===== IMAGES ===== */
  .fde-image,
  .team-photo {
    min-height: 240px;
    height: auto;
  }

  .industry-card-image,
  .case-card-image {
    height: 180px;
  }

  /* ===== INDUSTRY & WORK CARDS ===== */
  .industry-card:nth-child(5) {
    grid-column: 1;
  }

  .industry-card:nth-child(5) .industry-card-image {
    height: 200px;
  }

  .industry-card-content {
    padding: 24px 20px 28px;
  }

  .industry-card-title {
    font-size: 22px;
  }

  .case-card-content {
    padding: 20px 18px 24px;
  }

  .case-card-title {
    font-size: 19px;
  }

  .case-card-description {
    font-size: 13.5px;
  }

  .case-card-metrics {
    gap: 16px;
  }

  .case-metric-value {
    font-size: 18px;
  }

  .case-metric-label {
    font-size: 11px;
  }

  /* ===== FILTER BAR ===== */
  .filter-bar {
    padding: 24px 0;
  }

  .filter-container {
    padding: 0 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  /* ===== NAPKIN INFOGRAPHIC ===== */
  .napkin-infographic {
    padding: 40px 20px;
    border-radius: 16px;
  }

  .infographic-container {
    padding: 60px 20px;
  }

  /* ===== TIMELINE NOTE ===== */
  .timeline-note-section {
    padding: 64px 20px;
  }

  .timeline-note {
    padding: 20px 20px;
  }

  .timeline-note-title {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .timeline-note-text {
    font-size: 14px;
  }

  /* ===== MISC ADJUSTMENTS ===== */
  .cicd-diagram {
    padding: 32px 20px;
  }

  .ownership-item {
    padding: 18px 20px;
    gap: 12px;
  }

  .ownership-icon {
    width: 20px;
    height: 20px;
  }

  .ownership-text {
    font-size: 14px;
  }

  /* Reduce large spacing on mobile */
  .fde-header,
  .prism-header,
  .capabilities-header,
  .proof-header,
  .different-header,
  .pod-header,
  .ownership-header,
  .values-header,
  .team-header,
  .prism-detail-header,
  .security-edge-header,
  .ai-auditing-header,
  .solutions-header,
  .industries-header,
  .section-intro {
    margin-bottom: 40px;
  }
}

/* Landscape mobile adjustments: 568px - 667px */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-content {
    padding: 48px 20px 40px;
  }

  section {
    padding: 56px 20px;
  }

  .hero-title {
    font-size: 32px !important;
  }
}

/* Small mobile: 320px - 374px */
@media (max-width: 374px) {
  .header-container {
    padding: 0 12px;
  }

  .hero-title {
    font-size: 32px !important;
  }

  .section-title {
    font-size: 26px !important;
  }

  .cta-title {
    font-size: 28px !important;
  }

  .hero-content,
  section,
  .footer-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .btn-hero-primary,
  .btn-hero-secondary,
  .btn-cta {
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* Tablet landscape and small desktop: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Adjust grid columns for tablet */
  .capabilities-grid,
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .proof-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .prism-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .prism-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  .pod-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pod-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  section {
    padding: 88px 24px;
  }
}

/* Prevent horizontal scroll */
@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  * {
    max-width: 100%;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-img,
  .footer-brand-img {
    image-rendering: -webkit-optimize-contrast;
  }
}
