/* =====================================================================
   MOBILE FIXES — loaded last, overrides the older phone rules
   ===================================================================== */

/* 1) No sideways scrolling (decorative rings/circles stick out a bit) */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }

/* 5) CV section was tinted dark navy in light mode (all screen sizes) */
[data-theme="light"] .cv-section { background: rgba(255, 255, 255, 0.45); }
[data-theme="light"] .btn-outline {
  background: #ffffff;
  color: #0b132b;
  border-color: rgba(2, 132, 199, 0.35);
}
[data-theme="light"] .btn-outline:hover { background: #0284c7; border-color: #0284c7; color: #fff; }

/* IoT: 4 cards → one row of 4 on wide screens, 2 + 2 on tablets.
   Taller video boxes suit the vertical phone videos. */
/* Flex instead of grid so a shorter last row sits in the middle */
.iot-grid { display: flex !important; flex-wrap: wrap; justify-content: center; }
@media (min-width: 1101px) {
  .iot-grid { max-width: 1140px; gap: 16px; }
  .iot-grid > .iot-card { flex: 0 0 calc((100% - 48px) / 4); min-width: 0; }
  .iot-video-wrapper { height: auto !important; aspect-ratio: 3 / 4; }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .iot-grid { gap: 16px; }
  .iot-grid > .iot-card { flex: 0 0 calc(50% - 8px); min-width: 0; }
  .iot-video-wrapper { height: auto !important; aspect-ratio: 4 / 3; }
}
.iot-tiktok iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.iot-tiktok-link { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.iot-tiktok-link:hover { filter: brightness(0.95); text-decoration: underline; }

@media (max-width: 600px) {
  /* 6) typing cursor stays on the same line as the text */
  .hero-subtitle-line { display: block; text-align: center; }
  .hero-subtitle-line .typing-text { display: inline; }
  .typing-cursor { font-size: 1em; vertical-align: baseline; }

  /* 2) readable minimum text sizes */
  .stat-label-text { font-size: 0.72rem; line-height: 1.25; }

  /* project category tabs: readable, swipe sideways if they don't fit */
  .category-tabs-wrapper {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
    max-width: 100%;
    padding: 2px 2px 8px;
    margin: 0 auto 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .category-tabs-wrapper::-webkit-scrollbar { display: none; }
  .cat-tab-btn {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: 0.8rem;
    gap: 6px;
    letter-spacing: 0;
  }
  .cat-tab-btn i { font-size: 0.85rem; }
  .cat-count-badge { font-size: 0.68rem; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; }

  /* 3) IoT: two cards side by side; an odd last card sits in the middle */
  .iot-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .iot-grid > .iot-card { flex: 0 0 calc(50% - 6px); min-width: 0; }
  .iot-video-wrapper { height: auto !important; aspect-ratio: 4 / 5; background: #000; }
  .iot-video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
  .iot-card-content { padding: 10px 10px 12px !important; }
  .iot-card-badge { font-size: 0.62rem; letter-spacing: 0.3px; }
  .iot-card-title { font-size: 0.9rem; line-height: 1.25; margin: 4px 0 6px; }
  .iot-card-desc {
    font-size: 0.76rem; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .iot-tech-tags { gap: 4px !important; }
  .iot-tech-tag { font-size: 0.66rem; padding: 3px 7px; }

  /* 7) contact cards: one per row so the e-mail fits on one line */
  .contact-info-cards { grid-template-columns: 1fr !important; }
  .contact-item-card { flex-direction: row !important; align-items: center !important; padding: 14px !important; }
  .contact-val, .contact-val a { overflow-wrap: anywhere; font-size: 0.88rem; }

  /* certificates + contact labels */
  .cert-id-badge { font-size: 0.68rem; }
  .cert-track { font-size: 0.8rem; }
  .contact-label { font-size: 0.72rem; }

  /* less empty space between the contact form and the footer */
  .contact-section { padding-bottom: 30px; }
  .fx-footer { margin-top: 20px; }
}
