/* ═══════════════════════════════════════════
   VCT Platform — Responsive Optimization
   Version 1.0 • 2026
   5 Breakpoints: 1280 / 1024 / 768 / 480 / 360
   ═══════════════════════════════════════════ */

/* ══════════════════════════════════════
   BASE RESPONSIVE ENHANCEMENTS
   ══════════════════════════════════════ */

/* Smooth font rendering */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Partners grid — replaces inline styles */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

/* Safe-area support for notched devices */
body.imm-page {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Touch optimizations — minimum 44px tap targets */
@media (pointer: coarse) {
  .btn-imm,
  .imm-hamburger,
  .imm-theme-toggle,
  .imm-lang-toggle,
  .floating-cta,
  .overlay-menu__link,
  .side-nav__item,
  .imm-footer__links a,
  .imm-footer__social a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Prevent double-tap zoom on interactive elements */
  button, a, input, select, textarea {
    touch-action: manipulation;
  }

  /* Better touch feedback */
  .imm-module,
  .imm-stat,
  .tech-item,
  .imm-price-card,
  .belt-item {
    -webkit-tap-highlight-color: transparent;
  }

  /* Disable hover tilt effect on touch — handled in JS but CSS fallback */
  .imm-module:hover,
  .imm-stat:hover,
  .tech-item:hover,
  .imm-price-card:hover {
    transform: none !important;
  }
  .imm-module:active,
  .imm-stat:active,
  .tech-item:active,
  .imm-price-card:active {
    transform: scale(0.98) !important;
    transition-duration: 0.15s;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .orb { display: none !important; }
  #particles-canvas { display: none !important; }
  .scroll-indicator { display: none !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  /* Disable scroll-snap for reduced motion */
  html:has(body.imm-page) {
    scroll-behavior: auto !important;
  }
  .imm-section {
    height: auto !important;
  }
  .imm-section .imm-section__content,
  .imm-section .imm-tag,
  .imm-section .imm-heading,
  .imm-section .imm-subtitle {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ══════════════════════════════════════
   BREAKPOINT: ≤ 1280px — Large Tablet / Small Desktop
   ══════════════════════════════════════ */
@media (max-width: 1280px) {
  .imm-section {
    padding: 100px 48px 60px;
  }

  .imm-section__content {
    max-width: 1100px;
  }

  .imm-modules {
    gap: 14px;
  }

  .imm-module {
    padding: 30px 24px;
  }

  .heritage-grid {
    gap: 48px;
  }

  .contact-grid {
    gap: 48px;
  }

  .imm-pricing {
    gap: 14px;
  }

  .imm-price-card {
    padding: 40px 24px;
  }
}

/* ══════════════════════════════════════
   BREAKPOINT: ≤ 1024px — Tablet Landscape
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Section padding reduction */
  .imm-section {
    padding: 90px 32px 60px;
  }

  /* Grids: 2 columns */
  .imm-modules {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  /* Heritage: stack */
  .heritage-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Contact: stack */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Brand logo: hide */
  .imm-brand {
    display: none;
  }

  /* Partners inline grid override */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Pricing cards padding */
  .imm-price-card {
    padding: 36px 20px;
  }
}

/* ══════════════════════════════════════
   BREAKPOINT: ≤ 768px — Tablet Portrait / Large Phone
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide side nav — use hamburger instead */
  .side-nav {
    display: none;
  }

  .imm-section {
    padding: 80px 20px 48px;
    min-height: unset;
    height: auto;
  }


  /* Hide section counter on mobile */
  .section-counter {
    display: none;
  }

  /* Hero remains full height */
  .hero-imm {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  /* Hero content */
  .hero-imm__content {
    padding: 0 16px;
  }

  .hero-imm__logo {
    letter-spacing: -2px;
  }

  .hero-imm__tagline {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    max-width: 90%;
  }

  .hero-imm__version {
    padding: 6px 18px;
    font-size: 0.68rem;
    letter-spacing: 2px;
    margin-bottom: 28px;
  }

  /* Hero buttons: stack vertically */
  .hero-imm__cta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn-imm {
    width: 100%;
    justify-content: center;
    max-width: 300px;
    padding: 14px 28px;
    font-size: 0.78rem;
  }

  /* Module grid: single column */
  .imm-modules {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .imm-module {
    padding: 28px 22px;
  }

  .imm-module__name {
    font-size: 1.1rem;
  }

  /* Stats: 2 columns still works */
  .imm-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .imm-stat {
    padding: 28px 16px;
  }

  /* Pricing: single column */
  .imm-pricing {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .imm-price-card {
    padding: 36px 24px;
  }

  /* Tech: 2 columns */
  .tech-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tech-item {
    padding: 24px 16px;
  }

  /* Heritage belts: single column */
  .heritage-belts {
    grid-template-columns: 1fr;
  }

  /* Partners inline grid override — force responsive */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 12px !important;
  }

  /* Topbar adjustments */
  .imm-topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 10px 14px;
  }

  /* Floating CTA: compact */
  .floating-cta {
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    font-size: 0.65rem;
    letter-spacing: 1px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* Headings */
  .imm-heading {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 16px;
  }

  .imm-subtitle {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  /* Contact info */
  .contact-info {
    padding: 20px 0;
  }

  .contact-info__value {
    font-size: 1rem;
  }

  /* Form inputs: ensure full width */
  .contact-form {
    width: 100%;
  }

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

  /* Footer */
  .imm-footer {
    padding: 40px 20px;
  }

  .imm-footer__links {
    gap: 8px;
  }

  .imm-footer__links a {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .imm-footer__disclaimer {
    font-size: 0.65rem;
    padding: 0 12px;
  }

  /* Scroll indicator */
  .scroll-indicator {
    bottom: 24px;
  }

  /* Overlay menu adjustments */
  .overlay-menu__link {
    padding: 8px 16px;
  }

  /* Hide orbs for performance */
  .orb {
    display: none;
  }

  /* Reduce particle density — canvas stays but JS handles density */
  #particles-canvas {
    opacity: 0.5;
  }

  /* Blockquote in heritage */
  blockquote {
    margin: 16px 0 !important;
    padding-left: 16px !important;
  }

  blockquote p {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
  }

  /* Style overrides for inline-styled elements */
  [style*="text-align:center"] {
    text-align: center;
  }

  [style*="margin-bottom:48px"],
  [style*="margin-bottom: 48px"] {
    margin-bottom: 32px !important;
  }

  [style*="margin-bottom:40px"],
  [style*="margin-bottom: 40px"] {
    margin-bottom: 28px !important;
  }
}

/* ══════════════════════════════════════
   BREAKPOINT: ≤ 480px — Mobile
   ══════════════════════════════════════ */
@media (max-width: 480px) {
  /* Sections tighter */
  .imm-section {
    padding: 70px 16px 40px;
  }

  /* Stats: single column */
  .imm-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .imm-stat {
    padding: 24px 16px;
  }

  .imm-stat__num {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  /* Tech: single column */
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Partners inline grid: stack on mobile */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Hero fine-tuning */
  .hero-imm__logo {
    letter-spacing: -1px;
    margin-bottom: 16px;
  }

  .hero-imm__version {
    padding: 5px 14px;
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
  }

  .hero-imm__tagline {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .btn-imm {
    max-width: 100%;
    padding: 13px 24px;
  }

  /* Modules padding */
  .imm-module {
    padding: 24px 18px;
  }

  .imm-module__icon {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }

  .imm-module__name {
    font-size: 1rem;
  }

  .imm-module__desc {
    font-size: 0.82rem;
  }

  /* Pricing card */
  .imm-price-card {
    padding: 32px 20px;
  }

  .imm-price-amount {
    font-size: 2rem;
  }

  /* Topbar */
  .imm-topbar {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 8px 12px;
    border-radius: 16px;
  }

  .imm-hamburger {
    width: 40px;
    height: 40px;
  }

  .imm-theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .imm-lang-toggle {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  /* Floating CTA: icon only on very small screens */
  .floating-cta {
    padding: 12px 16px;
    font-size: 0;
    gap: 0;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    justify-content: center;
    align-items: center;
  }

  .floating-cta__icon {
    font-size: 1.2rem;
  }

  /* Footer compact */
  .imm-footer {
    padding: 32px 16px;
  }

  .imm-footer__brand {
    font-size: 1.2rem;
  }

  .imm-footer__org {
    font-size: 0.72rem;
    letter-spacing: 1px;
  }

  .imm-footer__links {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .imm-footer__links a {
    display: block;
    width: 100%;
    text-align: center;
  }

  /* Headings */
  .imm-heading {
    font-size: clamp(1.5rem, 6vw, 2rem);
    letter-spacing: -0.5px;
  }

  .imm-subtitle {
    font-size: 0.88rem;
  }

  .imm-tag {
    font-size: 0.65rem;
    padding: 6px 16px;
    letter-spacing: 1.5px;
  }

  /* Contact */
  .contact-info__value {
    font-size: 0.95rem;
  }

  .contact-info__label {
    font-size: 0.62rem;
  }

  /* Belt items */
  .belt-item {
    padding: 12px 14px;
  }

  .belt-name {
    font-size: 0.78rem;
  }

  /* Heritage heading inline override */
  h4[style*="letter-spacing:3px"] {
    font-size: 0.65rem !important;
    letter-spacing: 2px !important;
  }

  /* Overlay menu font smaller */
  .overlay-menu__link {
    font-size: clamp(1.2rem, 5vw, 2rem);
  }

  .overlay-menu__footer {
    bottom: 24px;
  }
}

/* ══════════════════════════════════════
   BREAKPOINT: ≤ 360px — Small Mobile
   ══════════════════════════════════════ */
@media (max-width: 360px) {
  .imm-section {
    padding: 64px 12px 32px;
  }

  .hero-imm__content {
    padding: 0 8px;
  }

  .imm-heading {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }

  .imm-module {
    padding: 20px 14px;
  }

  .imm-price-card {
    padding: 28px 16px;
  }

  .imm-price-amount {
    font-size: 1.7rem;
  }

  .imm-topbar {
    top: 4px;
    left: 4px;
    right: 4px;
    padding: 6px 10px;
  }

  .form-input,
  .form-textarea,
  .form-select {
    padding: 12px 14px;
  }
}

/* ══════════════════════════════════════
   LANDSCAPE PHONE
   ══════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-imm {
    min-height: 100vh;
    padding: 60px 40px;
  }

  .hero-imm__logo {
    font-size: clamp(2rem, 8vw, 4rem) !important;
    margin-bottom: 12px;
  }

  .hero-imm__tagline {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .hero-imm__version {
    margin-bottom: 16px;
  }

  .hero-imm__cta {
    flex-direction: row;
  }

  .btn-imm {
    width: auto;
    max-width: none;
    padding: 10px 24px;
    font-size: 0.72rem;
  }

  .scroll-indicator {
    display: none;
  }

  .imm-section {
    min-height: 0;
    height: auto;
    padding: 64px 32px 40px;
  }

  /* Disable scroll-snap in landscape phone */
  html:has(body.imm-page) {
    /* No longer needed since scroll-snap was removed globally, but keep block for overriding future properties if necessary */
  }

  .imm-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .imm-modules {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ══════════════════════════════════════
   HIGH DPI / RETINA SUPPORT
   ══════════════════════════════════════ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Thinner borders on retina */
  .imm-module,
  .imm-stat,
  .tech-item,
  .imm-price-card,
  .belt-item {
    border-width: 0.5px;
  }
}

/* ══════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════ */
@media print {
  .imm-topbar,
  .side-nav,
  .overlay-menu,
  .floating-cta,
  .scroll-indicator,
  .orb,
  #particles-canvas {
    display: none !important;
  }

  .imm-section {
    min-height: unset;
    height: auto;
    padding: 24px 0;
    page-break-inside: avoid;
  }


  .hero-imm {
    min-height: unset;
  }

  body.imm-page {
    background: #fff !important;
    color: #000 !important;
  }

  .imm-heading,
  .imm-module__name,
  .imm-stat__num,
  .imm-price-name {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    background: none !important;
  }

  .imm-module,
  .imm-stat,
  .tech-item,
  .imm-price-card {
    background: #fff !important;
    border: 1px solid #ddd !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }
}
