/* Instagram-inspired mobile framing for the MANZAR home feed. */
.mobile-stories,
.mobile-tabbar { display: none; }

@media (max-width: 600px) {
  html { scroll-padding-top: 112px; }
  body { background: #f2efe7; color: #171815; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  #particles { opacity: .12; }

  .nav {
    top: 0;
    height: 58px;
    padding: 0;
    background: rgba(242, 239, 231, .98);
    border-bottom: 1px solid rgba(23, 24, 21, .14);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav.scrolled { background: rgba(242, 239, 231, .98); backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .nav-inner { height: 58px; min-height: 58px; padding: 0 15px; }
  .brand { font-family: 'DM Sans', system-ui, sans-serif; font-size: 1.28rem; font-weight: 800; letter-spacing: -.055em; color: #173b33; }
  .brand span { color: #d94b2b; text-shadow: none; }
  .brand-divider, .brand-cutm { display: none; }
  .menu-toggle {
    width: 38px; height: 38px; display: flex;
    border: 0; border-radius: 50%; background: transparent;
  }
  .menu-toggle span { background: #173b33; width: 21px; }
  .menu.open {
    position: fixed;
    inset: 58px 0 calc(55px + env(safe-area-inset-bottom)) !important;
    z-index: 110;
    display: flex;
    width: auto;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 18px 22px;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: #f2efe7;
    border-top: 1px solid rgba(23, 24, 21, .14);
    box-shadow: none;
    transform: none;
  }
  .menu.open a,
  .menu.open .nav-btn,
  .menu.open .nav-cta,
  .menu.open .nav-login {
    width: 100%;
    max-width: none;
    min-height: 48px;
    margin: 0;
    padding: 13px 6px;
    border: 0;
    border-bottom: 1px solid rgba(23, 24, 21, .14);
    border-radius: 0;
    color: #171815;
    background: transparent;
    box-shadow: none;
    font-size: .98rem;
    line-height: 1.2;
    text-align: left;
  }
  .menu.open .nav-cta {
    justify-content: center;
    margin-top: 12px;
    padding: 13px 16px;
    border: 0;
    color: #fff;
    background: #d94b2b;
    text-align: center;
  }

  .announce-bar {
    top: 58px !important;
    z-index: 48;
    min-height: 36px;
    background: #173b33;
    color: #fff;
    border: 0;
    box-shadow: none;
  }
  .announce-inner { min-height: 36px; padding: 2px 10px; gap: 4px; }
  .announce-nav { width: 27px; height: 27px; }
  .announce-nav img { width: 22px; height: 22px; }
  .announce-slide { color: #fff; }

  .mobile-stories {
    display: flex;
    position: relative;
    z-index: 1;
    gap: 13px;
    overflow-x: auto;
    padding: 9px 13px 11px;
    margin-top: 94px;
    background: #f2efe7;
    border-bottom: 1px solid rgba(23, 24, 21, .12);
    scrollbar-width: none;
  }
  .mobile-stories::-webkit-scrollbar { display: none; }
  .story-link {
    display: flex;
    flex: 0 0 62px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #292b25;
    font: 500 .66rem/1.2 'DM Sans', system-ui, sans-serif;
    white-space: nowrap;
  }
  .story-ring {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    overflow: hidden;
    border: 2px solid #f2efe7;
    border-radius: 50%;
    outline: 2px solid #d94b2b;
    background: #173b33;
  }
  .story-ring img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .story-home .story-ring { outline-color: #85877c; padding: 5px; background: #fff; }
  .story-home .story-ring img { object-fit: contain; }
  .story-letter { color: #f2efe7; font: 800 1.2rem/1 'DM Sans', system-ui, sans-serif; }

  .hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 20px 0 30px;
    background: #173b33;
    text-align: left;
  }
  .hero::before { background: linear-gradient(145deg, #173b33, #102c26); }
  .hero::after { inset: auto 0 0; height: 4px; }
  .hero-content { width: 100%; padding: 0 17px 17px; }
  .hero-content::before { margin-bottom: 10px; font-size: .56rem; }
  .hero .eyebrow { font-size: .59rem; letter-spacing: .17em; margin-bottom: 4px; }
  .hero .title { font-size: clamp(3.1rem, 17vw, 5rem); line-height: .92; letter-spacing: -.045em; }
  .hero .tagline { margin: 8px 0 9px; font-size: .96rem; line-height: 1.35; }
  .hero-institution { display: none; }
  .hero-date { width: auto; margin: 0; padding-top: 9px; border-top: 1px solid rgba(242, 239, 231, .25); font-size: .59rem; letter-spacing: .06em; }
  .countdown { gap: 7px; justify-content: flex-start; margin: 12px 0 14px; }
  .cd-block { width: 52px; min-width: 0; padding: 5px 2px; border: 0; border-radius: 4px; background: rgba(255,255,255,.09); box-shadow: none; text-align: center; }
  .cd-num { font-size: 1.12rem; color: #f3b49e; text-shadow: none; }
  .cd-label { font-size: .46rem; letter-spacing: .06em; color: #e3e4dc; }
  .cd-sep { padding-bottom: 7px; font-size: 1rem; color: #f3b49e; text-shadow: none; }
  .hero-actions { display: flex; align-items: center; gap: 15px; }
  .hero-actions .btn { min-height: 38px; padding: .65rem .85rem; border-radius: 5px; font-size: .72rem; }
  .hero-text-link { color: #f2efe7; font-size: .72rem; }
  .hero-photo {
    order: 2;
    width: 100%; height: auto; aspect-ratio: 1.22 / 1;
    margin: 0; padding: 0; border: 0; outline: 0; transform: none;
    box-shadow: none; background: #102c26;
  }
  .hero-photo::before { display: none; }
  .hero-photo img { height: 100%; object-position: center 45%; filter: saturate(.92); }
  .hero-photo figcaption { padding: 7px 10px; font-size: .48rem; }
  .scroll-hint { display: none; }

  .section { padding: 37px 16px; scroll-margin-top: 110px; }
  .section-tag { margin-bottom: 6px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
  .section-title { font-size: 1.8rem; line-height: 1.02; }
  .about { background: #f2efe7; }
  .about .wrap { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .about-affiliation { padding: 10px; background: #e7e2d7; }
  .about-text { font-size: .91rem; line-height: 1.6; }
  .about-visual { width: 100%; margin: 8px 0; border: 0; box-shadow: none; transform: none; }
  .about-visual img { aspect-ratio: 1.25 / 1; }
  .pillars { gap: 7px; }
  .pillar { min-width: 0; flex: 1; padding: 10px 7px; font-size: .66rem; }

  .events { background: #e8e4da; }
  .events .wrap { width: 100%; }
  .events .section-title { margin-bottom: 18px; }
  .group-label { margin: 22px 0 10px; font-size: .79rem; letter-spacing: .04em; }
  .events .grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
  .card { height: auto; }
  .card-face { min-height: 0; padding: 0 12px 13px; background: #f8f6ef; border: 1px solid rgba(23,24,21,.13); box-shadow: none; }
  .event-art { width: calc(100% + 24px); height: 155px; margin: 0 -12px 10px; }
  .card-icon { font-size: 1.15rem; }
  .card-face h4 { margin: 3px 0 0; font-size: 1rem; }
  .card-tag { font-size: .75rem; }
  .card-face .hint { font-size: .65rem; }
  .rules { scroll-margin-top: 110px; }
  .register { padding: 36px 18px; }
  .register .section-title { font-size: 1.8rem; }
  .register .about-text { font-size: .9rem; }
  .register .btn { width: 100%; margin: 4px 0; }
  .qr-visit { padding: 28px 17px; }
  .qr-visit-inner { gap: 18px; }
  .qr-visit-image { max-width: 190px; }
  .footer { padding: 34px 18px 23px; }
  .footer .foot-name { font-size: 3rem; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    z-index: 100;
    right: 0; bottom: 0; left: 0;
    height: calc(55px + env(safe-area-inset-bottom));
    padding: 0 9px env(safe-area-inset-bottom);
    align-items: center;
    justify-content: space-around;
    background: rgba(242, 239, 231, .98);
    border-top: 1px solid rgba(23, 24, 21, .16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .mobile-tabbar a { width: 48px; height: 48px; display: grid; place-items: center; color: #20221e; }
  .mobile-tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-tabbar .is-current svg { fill: #20221e; stroke-width: 1.2; }
  .manzar-chat-launch { bottom: calc(68px + env(safe-area-inset-bottom)) !important; }
  .manzar-chat-panel { bottom: calc(122px + env(safe-area-inset-bottom)) !important; }
}
