/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE.CSS — breakpoints (unchanged from source) + RTL mirroring
   ═══════════════════════════════════════════════════════════════════ */

/* ── iPad Pro / Large Tablets (1024px and below) ── */
@media (max-width: 1024px) {
  .shell { grid-template-columns: 200px 1fr; }
  .main { padding: 1.6rem 1.8rem; }
  .hero-ascii { font-size: clamp(1rem, 2.5vw, 1.6rem); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── iPad / Tablets (768px and below) ── */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 36px;
    grid-template-areas:
      "topbar"
      "main"
      "statusbar";
  }
  .sidebar { display: none; }
  .topbar { padding: 0 1rem; gap: .6rem; flex-wrap: nowrap; }
  .topbar-subtitle { display: none; }
  .topbar-title { font-size: 1.15rem; }
  .nav-tabs { display: none; } /* replaced by animated mobile menu */
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar-clock { font-size: .68rem; }
  .header-controls { margin-left: 0; }
  .main { padding: 1.4rem 1.2rem; }
  .hero-ascii { font-size: clamp(.75rem, 2.2vw, 1.2rem); }
  .cards { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .ceo-block { grid-template-columns: auto 1fr; gap: 1rem; }
  .service-table th:nth-child(3),
  .service-table td:nth-child(3) { display: none; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .split-2 { display: block !important; }
  .split-2 > div { margin-bottom: 1.5rem; }
  .prizes { flex-direction: column !important; }
  .countdown { gap: .7rem; }
  .countdown-num { font-size: 1.6rem; }
  .statusbar { font-size: .6rem; gap: .7rem; }
  .statusbar span:nth-child(4),
  .statusbar span:nth-child(5) { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── iPhone / Small Phones (480px and below) ── */
@media (max-width: 480px) {
  .shell { grid-template-rows: auto 1fr 30px; }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: .5rem .8rem;
    gap: .4rem;
  }
  .topbar-dots { order: 1; }
  .topbar-title { order: 2; font-size: 1rem; }
  .topbar-logo { order: 2; height: 20px; }
  .topbar-clock { order: 3; font-size: .62rem; margin-left: auto; }
  [dir="rtl"] .topbar-clock { margin-left: 0; margin-right: auto; }
  .header-controls { order: 4; }
  .mobile-menu-btn { order: 5; }

  .main { padding: 1rem .85rem; }

  .hero-ascii {
    font-size: .62rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 1.1;
    display: block;
    white-space: pre;
  }
  .hero-tagline { font-size: .7rem; letter-spacing: .1em; }
  .hero-tagline-2 { font-size: .68rem; letter-spacing: .06em; }

  .cards { grid-template-columns: 1fr; gap: .6rem; }
  .card { padding: .85rem .9rem; }

  .ceo-block { grid-template-columns: 1fr; gap: .9rem; padding: 1rem; }
  .ceo-avatar { width: 54px; height: 54px; font-size: 1.5rem; }

  .skill-lbl { width: 100px; font-size: .7rem; }
  .skill-pct { font-size: .68rem; }

  .service-table { font-size: .72rem; }
  .service-table th, .service-table td { padding: .4rem .5rem; }
  .service-table th:nth-child(4),
  .service-table td:nth-child(4) { display: none; }

  .contact-grid { grid-template-columns: 1fr; }

  .event-hero { padding: 1.2rem; }
  .event-name { font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .countdown { gap: .5rem; }
  .countdown-box { min-width: 52px; padding: .45rem .5rem; }
  .countdown-num { font-size: 1.35rem; }
  .countdown-lbl { font-size: .55rem; }
  .event-actions { flex-direction: column; }
  .btn { justify-content: center; font-size: .74rem; }

  .cat-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .cat-item { padding: .65rem .7rem; }
  .cat-name { font-size: .75rem; }

  .statusbar { font-size: .58rem; gap: .5rem; padding: 0 .6rem; }
  .statusbar .sep { display: none; }

  .prompt-line { font-size: .72rem; overflow-x: auto; white-space: nowrap; }
}

/* ── iPhone SE / Very Small (360px and below) ── */
@media (max-width: 360px) {
  .hero-ascii { font-size: .52rem; }
  .cards { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .countdown-box { min-width: 44px; }
  .countdown-num { font-size: 1.1rem; }
}

/* ── Touch devices: larger tap targets ── */
@media (hover: none) and (pointer: coarse) {
  .nav-tab { min-height: 40px; }
  .sidebar-item { min-height: 44px; }
  .btn { min-height: 44px; padding: .6rem 1.2rem; }
  .card { -webkit-tap-highlight-color: rgba(185,188,196,.08); }
}

/* ── Safe area insets for iPhone X+ notch/home bar ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .statusbar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(32px + env(safe-area-inset-bottom));
  }
  .topbar {
    padding-left: max(.8rem, env(safe-area-inset-left));
    padding-right: max(.8rem, env(safe-area-inset-right));
  }
  @media (max-width: 480px) {
    body { padding-bottom: env(safe-area-inset-bottom); }
  }
}

/* ── Scrollable main on mobile ── */
@media (max-width: 768px) {
  html, body { height: 100%; overflow: hidden; }
  .shell { height: 100%; overflow: hidden; }
  .main { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════ ANIMATED MOBILE MENU ═══════════════════════ */
.mobile-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: min(78vw, 300px);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  padding: 1.4rem 0;
}
[dir="rtl"] .mobile-menu { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); transform: translateX(-100%); }
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .6rem;
}
.mobile-menu-close {
  background: transparent; border: none; color: var(--dim); font-size: 1.3rem; cursor: pointer;
}
.mobile-menu .sidebar-item,
.mobile-menu .sidebar-section { animation: none; }
