/* MIRABO Biotechnology - Responsive Design */
/* Mobile-first approach with breakpoints */

/* ========================================
   BREAKPOINTS
   - Mobile: < 640px
   - Tablet: 640px - 1024px
   - Desktop: > 1024px
   ======================================== */

/* ========================================
   MOBILE OPTIMIZATIONS (< 640px)
   ======================================== */
@media (max-width: 640px) {
  /* Force full width */
  html, body {
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Container - full width on mobile */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin: 0 !important;
  }
  
  /* Hero section - full width */
  .hero {
    width: 100%;
    min-height: 100vh !important;
    padding: 6rem 0 4rem !important;
  }
  
  /* Hero content */
  .hero__content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* All sections full width */
  section {
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Navigation - Show mobile menu toggle */
  .nav__links {
    display: none !important;
  }
  
  .nav__cta {
    display: none;
  }
  
  .nav__toggle {
    display: flex !important;
  }
  
  .nav__logo img {
    height: 32px;
    width: auto;
  }
  
  .nav {
    padding: 0 !important;
    width: 100%;
  }
  
  /* Typography scaling */
  :root {
    --text-hero: 2.5rem;
    --text-h1: 2rem;
    --text-h2: 1.75rem;
    --text-h3: 1.5rem;
    --text-h4: 1.25rem;
    --text-body: 1rem;
  }
  
  .hero__content {
    max-width: 100%;
    padding: 0 1rem;
  }
  
  .hero__title {
    font-size: 2.5rem;
    line-height: 1.05;
    margin-bottom: 1rem;
  }
  
  .hero__subtitle {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }
  
  .hero__cta {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .hero__cta .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    display: flex;
    align-items: center;
  }
  
  /* Hide scroll indicator on mobile to avoid overlap */
  .hero__scroll {
    display: none !important;
  }
  
  /* Navigation */
  .header {
    height: 60px !important;
  }
  
  .nav {
    padding: 0.75rem 1rem;
    height: 60px;
  }
  
  .nav__logo img {
    height: 28px;
  }
  
  /* Sections */
  section {
    padding: 3rem 0 !important;
    width: 100%;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  /* Platform sticky cards - 手机端居中 */
  .sticky-card > div > div.grid {
    display: flex !important;
    flex-direction: column !important;
  }
  
  .sticky-card .space-y-6 {
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }
  
  .sticky-card .space-y-6 > div,
  .sticky-card .space-y-6 > h3,
  .sticky-card .space-y-6 > p {
    text-align: center !important;
  }
  
  .sticky-card .space-y-6 > ul {
    text-align: left !important;
  }
  
  /* 保持 IGNIS 动画的 grid 布局 */
  .sticky-card .grid.grid-cols-6 {
    display: grid !important;
    flex-direction: unset !important;
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .tech-card {
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
  }
  
  .tech-card:nth-child(1),
  .tech-card:nth-child(2),
  .tech-card:nth-child(3) {
    top: 0 !important;
    position: relative !important;
  }
  
  /* Platform cards */
  .platform-card {
    padding: 2rem 1.5rem;
  }
  
  .platform-card__title {
    font-size: 1.5rem;
  }
  
  /* Footer */
  .footer {
    padding: 3rem 0 2rem !important;
  }
  
  .footer__grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem 1rem !important;
    text-align: left !important;
  }
  
  .footer__col:first-child {
    grid-column: 1 / -1 !important;
    margin-bottom: 1rem;
  }
  
  /* Hide Follow Us on mobile, keep WeChat */
  .footer__col:nth-child(4) {
    display: none;
  }
  
  .footer__col--wechat {
    display: block !important;
    align-items: flex-start !important;
  }
  
  .footer__wechat-title {
    justify-content: flex-start !important;
  }
  
  .footer__col {
    text-align: left !important;
  }
  
  .footer__col h4 {
    margin-bottom: 1rem !important;
    font-size: 1rem !important;
  }
  
  .footer__col ul {
    list-style: none;
    padding: 0;
  }
  
  .footer__col ul li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
  }
  
  .footer__col p {
    font-size: 0.875rem;
  }
  
  .footer__bottom {
    text-align: center !important;
    margin-top: 2rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Stats grid - 2 columns layout like platform page */
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-top: 1.5rem !important;
  }
  
  .stat-card {
    padding: 1rem 0.75rem !important;
    text-align: center !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  /* About page location cards (with inline background) - override */
  .stat-card[style*="background:"] {
    grid-column: 1 / -1 !important;
    padding: 0 !important;
    text-align: left !important;
    border: none !important;
    min-height: 280px !important;
  }
  
  .stat-card[style*="background:"] .stat-title,
  .stat-card[style*="background:"] .stat-desc {
    text-align: left !important;
  }
  
  .stat-icon {
    margin-bottom: 0.5rem !important;
    display: flex !important;
    justify-content: center !important;
  }
  
  .stat-icon img {
    width: 36px !important;
    height: 36px !important;
  }
  
  .stat-title {
    font-size: 0.85rem !important;
    margin-bottom: 0.75rem !important;
    text-align: center !important;
  }
  
  .stat-desc {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
  }
  
  /* Section header spacing */
  .section-platform {
    padding-top: 2rem !important;
  }
  
  .section-platform .container {
    margin-bottom: 1rem !important;
  }
  
  .section-platform .container .section-badge {
    margin-bottom: 0.25rem !important;
  }
  
  .section-platform .container h2 {
    margin-bottom: 0.25rem !important;
  }
  
  .section-platform .container p.section-tagline {
    margin-bottom: 0 !important;
  }
  
  /* Override Tailwind mb classes */
  .section-platform .mb-8 {
    margin-bottom: 0.25rem !important;
  }
  
  .section-platform .mb-20 {
    margin-bottom: 0 !important;
  }
  
  /* First sticky card top margin */
  .section-platform .relative {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Platform sticky cards - compact */
  .sticky-card {
    position: relative !important;
    margin-bottom: 1.5rem !important;
  }
  
  .sticky-card .glass-panel {
    padding: 1.5rem !important;
    border-radius: 1rem !important;
  }
  
  /* Hide animation graphics on mobile */
  .sticky-card .grid > div:last-child:not(.space-y-6) {
    display: none !important;
  }
  
  .sticky-card h3 {
    font-size: 1.5rem !important;
  }
  
  .sticky-card .text-2xl {
    font-size: 1rem !important;
  }
  
  .sticky-card .text-lg {
    font-size: 0.8rem !important;
  }
  
  .sticky-card ul.space-y-4 {
    gap: 0.5rem !important;
  }
  
  .sticky-card ul li {
    font-size: 0.75rem !important;
  }
  
  .sticky-card a {
    font-size: 0.85rem !important;
    margin-top: 0.5rem !important;
  }

  /* Industry cards */
  .industry-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .industry-card {
    height: 400px !important;
  }
  
  .industry-card__content {
    padding: 2rem !important;
  }
  
  .industry-card__title {
    font-size: 1.5rem !important;
  }
  
  .industry-card__desc {
    font-size: 0.9rem !important;
  }
}

/* ========================================
   TABLET OPTIMIZATIONS (641px - 1024px)
   ======================================== */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Navigation - Show mobile menu on tablet too */
  .nav__links {
    display: none !important;
  }
  
  .nav__toggle {
    display: flex !important;
  }
  
  /* Typography scaling */
  :root {
    --text-hero: 4rem;
    --text-h1: 3rem;
    --text-h2: 2.25rem;
    --text-h3: 1.875rem;
    --text-h4: 1.5rem;
  }
  
  /* Hero section */
  .hero {
    padding: 8rem 2rem 6rem;
  }
  
  .hero__title {
    font-size: 4rem;
    line-height: 1.05;
  }
  
  .hero__subtitle {
    font-size: 1.125rem;
  }
  
  /* Sections */
  section {
    padding: 6rem 2rem;
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .tech-card {
    margin-bottom: 3rem;
  }
  
  /* Navigation */
  .nav__menu {
    gap: 1.5rem;
  }
}

/* ========================================
   DESKTOP OPTIMIZATIONS (> 1024px)
   ======================================== */
@media (min-width: 1025px) {
  /* Container max-width */
  .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
  }
  
  /* Hero section */
  .hero {
    padding: 10rem 2rem 8rem;
  }
  
  /* Sections */
  section {
    padding: 8rem 2rem;
  }
  
  /* Cards */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* ========================================
   CUSTOM CURSOR - DISABLE ON MOBILE
   ======================================== */
@media (max-width: 1024px) {
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
  
  body {
    cursor: auto !important;
  }
  
  a, button {
    cursor: pointer !important;
  }
}

/* ========================================
   CANVAS PARTICLES - REDUCE ON MOBILE
   ======================================== */
@media (max-width: 768px) {
  #hero-canvas {
    opacity: 0.5;
  }
  
  /* Section platform header spacing */
  .section-platform {
    padding-top: 2rem !important;
  }
  
  .section-platform > .container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  
  .section-platform .section-tagline {
    margin-bottom: 1rem !important;
  }
  
  /* Override Tailwind classes */
  .section-platform .mb-8 {
    margin-bottom: 0.25rem !important;
  }
  
  .section-platform .mb-20 {
    margin-bottom: 2rem !important;
  }
  
  .section-platform > .relative {
    margin-top: 0 !important;
  }
  
  /* Sticky cards - remove sticky positioning and inline top */
  .sticky-card {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 1.5rem !important;
    margin-left: 1rem !important;
    margin-right: 1rem !important;
  }
  
  .sticky-card:first-child {
    margin-top: 2rem !important;
  }
  
  .sticky-card .mb-32 {
    margin-bottom: 0 !important;
  }
}

/* ========================================
   STICKY CARDS - DISABLE ON MOBILE
   ======================================== */
@media (max-width: 768px) {
  .tech-card {
    position: relative !important;
    top: 0 !important;
  }
}

/* ========================================
   ABOUT PAGE RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .about-hero {
    padding: 6rem 1rem 4rem;
  }
  
  .about-hero__title {
    font-size: 2rem;
  }
  
  .locations-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .mission-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .mission-card {
    padding: 1rem 0.75rem !important;
  }
  
  .mission-card__icon img {
    width: 36px;
    height: 36px;
  }
  
  .mission-card .mission-card__icon {
    height: 40px;
    margin-bottom: 0.25rem !important;
  }
  
  .mission-card__label {
    font-size: 0.85rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .mission-card__text {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }
  
  .workflow-steps {
    grid-template-columns: 1fr;
  }
  
  /* INTEGRATED WORKFLOW - 2 columns */
  .approach-timeline {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .timeline-item {
    padding: 1rem 0.75rem !important;
  }
  
  .timeline-item h3 {
    font-size: 0.85rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .timeline-item p {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }
  
  .timeline-item .stat-icon svg {
    width: 36px;
    height: 36px;
  }
  
  .timeline-item .stat-icon {
    margin-bottom: 0.5rem !important;
  }
  
  .timeline-number {
    font-size: 1.5rem !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    color: rgba(75, 141, 255, 0.15) !important;
  }
  
  /* Solutions page - partnership step number to bottom left */
  .step-number {
    top: auto !important;
    bottom: 1.5rem !important;
    right: auto !important;
    left: 1.5rem !important;
    font-size: 2rem !important;
  }
  
  .partnership-step {
    padding: 2rem !important;
  }
  
  /* Solutions page - SUCCESS STORIES cards */
  .case-studies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .case-study-card {
    padding: 1rem 0.75rem !important;
  }
  
  .case-study-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0.5rem;
  }
  
  .case-study-icon svg {
    width: 36px;
    height: 36px;
  }
  
  .case-study-title {
    font-size: 0.85rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .case-study-description {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }
  
  /* Platform page - center tech-points list */
  .tech-points {
    display: block !important;
    text-align: left !important;
    padding-left: 15% !important;
    padding-right: 10% !important;
  }
  
  .tech-card {
    text-align: center !important;
  }
  
  /* Index page - green bullet align with first line */
  .sticky-card li > span.flex-shrink-0 {
    top: -0.1em;
  }
  
  /* Contact page - form compact */
  #contactForm {
    gap: 0.75rem !important;
  }
  
  #contactForm .space-y-6 > * + * {
    margin-top: 0.75rem !important;
  }
  
  .form-group {
    margin-bottom: 0 !important;
  }
  
  .form-label {
    font-size: 0.75rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .form-input {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  .form-input.pl-12 {
    padding-left: 2.5rem !important;
  }
  
  textarea.form-input {
    min-height: 80px !important;
  }
  
  .glass-panel.p-8 {
    padding: 1.25rem !important;
  }
}

/* ========================================
   PLATFORM PAGE RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .platform-hero {
    padding: 6rem 1rem 4rem;
  }
  
  .platform-title {
    font-size: 2rem;
  }
  
  .platform-cards {
    grid-template-columns: 1fr;
  }
  
  .platform-card {
    min-height: auto;
  }
}

/* ========================================
   SOLUTIONS PAGE RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .solutions-hero {
    padding: 6rem 1rem 4rem;
  }
  
  .solution-card {
    grid-template-columns: 1fr;
  }
  
  .solution-card__image {
    height: 250px;
  }
}

/* ========================================
   CONTACT PAGE RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .contact-hero {
    padding: 6rem 1rem 4rem;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-form {
    padding: 2rem 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}
