/* Holmes Academy — handheld layout. Load after the page styles. */
.h-mobile-nav { display: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (max-width: 760px) {
  :root {
    --h-header-offset: 122px;
    --h-mobile-nav-height: 68px;
    --h-mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  html { scroll-padding-top: var(--h-header-offset); }
  body.heroes-edition {
    font-size: 17px;
    line-height: 1.85;
    padding-bottom: calc(var(--h-mobile-nav-height) + var(--h-mobile-safe-bottom));
  }
  .academy .container { width: calc(100% - 32px); }
  .heroes-edition .section { padding-block: 52px; }
  .heroes-edition .section-title {
    font-size: clamp(30px, 8.1vw, 34px);
    line-height: 1.45;
    letter-spacing: 0;
  }
  .academy .eyebrow { font-size: 13px; line-height: 1.75; gap: 9px; }
  .eyebrow::before { width: 22px; }
  .section-heading { margin-bottom: 26px; }
  .section-heading .eyebrow { margin-bottom: 10px; }
  .section-intro { margin-top: 15px; font-size: 17px; line-height: 1.85; }
  .heroes-edition .btn { min-height: 50px; font-size: 16px; border-radius: 12px; }
  .btn-link { min-height: 44px; font-size: 15px; }

  /* The compact masthead keeps every social destination within thumb reach. */
  .heroes-edition .nav-shell { min-height: 64px; gap: 12px; padding-block: 4px; }
  .site-header .brand { min-width: 0; gap: 9px; }
  .site-header .brand img { width: 37px; height: 50px; object-fit: contain; }
  .site-header .brand strong { font-size: 22px; line-height: 1.35; }
  .site-header .brand small { font-size: 12px; line-height: 1.5; margin-top: 2px; }
  .site-header .nav-actions { gap: 0; }
  .site-header .menu-toggle { width: 44px; height: 44px; border-radius: 12px; }
  .h-social-header .h-social-row { min-height: 44px; padding-block: 0; justify-content: center; }
  .h-social-header .h-social-follow { width: 100%; justify-content: center; gap: 0; }
  .h-social-header .h-social-label,
  .h-social-header .h-social-phone { display: none; }
  .h-social-header .h-social-links { width: min(100%, 328px); justify-content: space-between; gap: 4px; }
  .h-social-header .h-social-link { width: 44px; height: 44px; flex-basis: 44px; }
  .h-social-header .h-social-icon { width: 20px; height: 20px; }
  .heroes-edition .site-menu {
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    padding: 10px;
    gap: 6px;
    border-radius: 16px;
    background: #08234a;
    box-shadow: 0 18px 45px #0006;
    max-height: calc(100dvh - 210px - var(--h-mobile-safe-bottom));
    overscroll-behavior: contain;
  }
  .heroes-edition .site-menu.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heroes-edition .site-menu > a {
    min-height: 48px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    border: 1px solid #ffffff12;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.65;
    white-space: normal;
    color: #e4eaf4;
  }
  .heroes-edition .site-menu > a.is-active { background: #f6c60a12; color: #f6c60a; border-color: #f6c60a52; }
  .heroes-edition .site-menu .conference-nav { color: #f6c60a; }
  .site-menu .conference-nav > span { font-size: 12px; border: 0; padding: 0; }
  .heroes-edition .site-menu .mobile-contact { display: flex; }

  /* Content is readable immediately; motion supports the first impression. */
  .heroes-edition .intro {
    animation: h-mobile-enter .35s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: 0s !important;
  }
  .motion-ready .heroes-edition .reveal {
    transition-duration: .4s;
    transition-delay: 0s !important;
  }
  .motion-ready .heroes-edition .reveal:not(.is-visible) { transform: translateY(12px); }
  .heroes-edition .hero-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-block: 26px 26px;
  }
  .hero-copy { padding: 0; }
  .heroes-edition .hero .eyebrow { margin-bottom: 13px; font-size: 12px; gap: 8px; }
  .hero .iraq-flag { width: 26px; height: 18px; }
  .heroes-edition .hero h1 { font-size: clamp(38px, 10.3vw, 44px); line-height: 1.33; }
  .hero h1 > span::after { width: 54px; height: 3px; bottom: -7px; }
  .heroes-edition .hero-description { font-size: 17px; line-height: 1.85; margin-top: 22px; max-width: 540px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-top: 21px; }
  .heroes-edition .hero-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 10px 8px;
    gap: 6px;
    font-size: 14px;
    line-height: 1.65;
    white-space: normal;
  }
  .hero-actions .icon { width: 18px; height: 18px; }
  .hero-event-link,
  .hero-bottom { display: none; }
  .heroes-edition .hero-visual {
    width: min(100%, 350px);
    max-width: 350px;
    aspect-ratio: 1.12;
    margin-inline: auto;
    margin-top: 4px;
  }
  .h-iq-art { width: 87%; }
  .heroes-edition .visual-label-one { top: 3%; left: 0; font-size: 12px; padding: 5px 10px; }
  .heroes-edition .hero-visual figcaption { bottom: -4px; font-size: 12px; }
  .h-cube-shortcut { bottom: 9%; right: 0; gap: 8px; padding: 8px 10px; border-radius: 11px; }
  .h-cube-shortcut small { font-size: 12px; line-height: 1.6; }
  .h-cube-shortcut strong { font-size: 14px; line-height: 1.5; margin-top: 0; }
  .h-cube-shortcut > .icon { display: none; }
  .h-mini-cube { width: 29px; height: 29px; gap: 2px; }
  .ticker { padding-block: 11px; }
  .ticker-track span { font-size: 15px; padding-inline: 16px; }
  .ticker-track b { font-size: 12px; margin-inline: 14px; }

  /* Course cards become compact, full-width choices. */
  .path-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .path-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 12px;
    min-height: 0;
    padding: 20px;
    border-radius: 16px;
  }
  .path-top { grid-column: 1 / -1; font-size: 13px; line-height: 1.6; }
  .path-top b { font-size: 12px; }
  .path-symbol { grid-column: 2; grid-row: 2; align-self: center; width: 36px; height: 36px; margin: 0; }
  .path-card h3 { grid-column: 1; grid-row: 2; font-size: 25px; line-height: 1.5; }
  .path-card h3 br { display: none; }
  .path-card > p { grid-column: 1 / -1; font-size: 16px; line-height: 1.85; margin: 0; }
  .path-button { grid-column: 1 / -1; min-height: 48px; font-size: 15px; margin-top: 1px; padding: 12px 0 0; }

  .approach-layout,
  .results-layout,
  .about-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .approach-copy > p:not(.eyebrow),
  .about-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.9; margin-block: 18px; }
  .approach-step { gap: 16px; padding-block: 18px; }
  .approach-step > span { font-size: 18px; min-width: 26px; }
  .approach-step h3 { font-size: 24px; margin-bottom: 7px; }
  .approach-step p { font-size: 16px; line-height: 1.85; }
  .results-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.9; margin-top: 18px; }
  .qualification-stat { gap: 15px; margin-block: 22px 14px; padding-block: 18px; }
  .qualification-stat > strong { font-size: 47px; }
  .qualification-stat > p { font-size: 16px; line-height: 1.75; }
  .qualification-stat > p > span,
  .result-source { font-size: 12px; line-height: 1.8; }
  .result-stat { padding: 22px 12px; border: 1px solid var(--line); border-radius: 16px; }
  .stat-number { gap: 12px; }
  .stat-number strong { font-size: clamp(72px, 20vw, 90px); }
  .stat-number > span { font-size: 19px; }
  .result-stat > p { font-size: 16px; line-height: 1.85; margin-top: 15px; }
  .stat-year { font-size: 13px; margin-top: 16px; }
  .about-year {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 20px;
    padding: 17px 0;
    border-block: 1px solid var(--line);
    border-inline-end: 0;
    align-items: center;
  }
  .about-year > strong { grid-column: 1; grid-row: 1 / 3; font-size: 68px; line-height: 1.2; }
  .about-year-label { grid-column: 2; font-size: 13px; align-self: end; }
  .about-year-bottom { grid-column: 2; font-size: 13px; gap: 7px; flex-wrap: wrap; align-self: start; }
  .pillars { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 24px; padding-top: 24px; }
  .pillar > span { font-size: 13px; }
  .pillar h3 { font-size: 23px; margin-block: 7px; }
  .pillar p { font-size: 16px; line-height: 1.85; }

  /* The cube geometry remains unchanged; only its surrounding controls adapt. */
  .h-cube-layout { gap: 20px; }
  .h-cube-heading { gap: 17px; padding-top: 0; }
  .h-cube-heading .eyebrow { margin-bottom: 10px; }
  .h-section-copy { font-size: 17px; line-height: 1.85; }
  .h-game-note { font-size: 13px; line-height: 1.8; margin-top: 10px; }
  .hc-stage-meta { font-size: 12px; letter-spacing: .4px; }
  .hc-stage-meta b { font-size: 12px; }
  .hc-stage-caption { font-size: 12px; }
  .hc-touch-hint { padding: 12px 0 17px; font-size: 13px; line-height: 1.85; }
  .hc-console { gap: 14px 12px; }
  .hc-session-wins { font-size: 13px; line-height: 1.75; }
  .hc-status p { font-size: 16px; line-height: 1.8; }
  .hc-statistics dt { font-size: 12px; }
  .hc-statistics dd { font-size: 27px; }
  .hc-statistics dd > span { font-size: 13px; }
  .hc-shuffle { min-height: 56px; font-size: 13px !important; padding-inline: 9px; }
  .hc-actions button { min-height: 52px; font-size: 15px; }
  .hc-actions .hc-shuffle { min-height: 52px; font-size: 15px !important; }


  .h-team .section-heading { margin-bottom: 25px; }
  .h-team .section-intro { font-size: 17px; line-height: 1.85; }
  .h-partner-line { gap: 10px; padding-block: 15px; margin-bottom: 24px; }
  .h-partner-lockup { gap: 8px; flex-wrap: wrap; }
  .h-partner-lockup strong { font-size: 18px; }
  .h-partner-lockup > span { font-size: 21px; margin-inline: 3px; }
  .h-partner-lockup img { width: 27px; height: 36px; }
  .h-partner-line .btn-link { min-height: 44px; font-size: 14px; }
  .h-faculty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .h-portrait-frame { aspect-ratio: 4 / 5; border-radius: 12px 12px 0 0; }
  .h-faculty-index { top: 10px; left: 10px; font-size: 12px; }
  .h-faculty-caption { padding-block: 13px 16px; }
  .h-faculty-caption > span:first-child { font-size: 12px; margin-bottom: 4px; }
  .h-faculty-caption h3 { font-size: clamp(19px, 5.1vw, 23px); line-height: 1.6; }
  .h-faculty-subject { font-size: 15px; line-height: 1.75; gap: 6px; margin-top: 5px; }
  .h-faculty-subject::before { width: 11px; }
  .h-team-afterword { margin-top: 4px; padding-top: 22px; gap: 12px; }
  .h-team-afterword p { font-size: 16px; line-height: 1.85; }
  .h-team-afterword > a { font-size: 15px; min-height: 44px; margin-inline-start: 0; }

  .h-memory-topline { font-size: 12px; gap: 12px; padding-bottom: 17px; margin-bottom: 28px; }
  .h-memory-topline > span:last-child { letter-spacing: .02em; }
  .h-memory-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .h-memory-copy h2 { margin-bottom: 19px; }
  .h-memory-copy .h-memory-lead { font-size: 18px !important; line-height: 1.85 !important; }
  .h-memory-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.9; margin-block: 14px; }
  .h-memory-bridge { padding-top: 20px; margin-top: 21px; gap: 14px; }
  .h-memory-bridge small { font-size: 13px; }
  .h-memory-bridge h3 { font-size: 23px; line-height: 1.55; margin-block: 7px 11px; }
  .h-memory-bridge p { font-size: 16px; line-height: 1.85; }
  .h-memory-copy > .btn { margin-top: 22px; width: 100%; }
  .h-memory-art { width: min(100%, 350px); padding: 20px 20px 14px; }
  .h-memory-poster { padding: 22px; box-shadow: 9px 10px 0 #f6c60a, 0 20px 40px #0003; }
  .h-poster-heading { gap: 12px; padding-bottom: 13px; }
  .h-poster-heading > span { font-size: 12px; }
  .h-quote-mark { width: 76px; height: 58px; margin-block: 20px 12px; }
  .h-memory-poster blockquote > span { font-size: 18px; line-height: 1.8; margin-bottom: 10px; }
  .h-memory-poster blockquote > strong { font-size: clamp(30px, 8.5vw, 36px); line-height: 1.4; }
  .h-memory-poster figcaption { margin-top: 22px; gap: 10px; font-size: 13px; }
  .h-memory-poster figcaption small { font-size: 12px; }
  .h-poster-rule { width: 24px; flex-shrink: 0; }
  .h-memory-art-caption { margin-top: 28px; font-size: 12px; }
  .h-memory-timeline { gap: 10px; margin-top: 34px; padding-top: 24px; }
  .h-memory-timeline > div { flex: 1; min-width: 0; }
  .h-memory-timeline > div > span { font-size: 12px; }
  .h-memory-timeline > div > strong { display: block; font-size: 15px; line-height: 1.7; }
  .h-memory-timeline .h-timeline-line { flex: 0 0 10px; }

  /* Archive typography; the gallery owns its image layout. */
  .h-archive { margin-top: 37px; padding-top: 27px; }
  .h-archive-heading { gap: 12px; align-items: center; margin-bottom: 20px; }
  .h-archive-heading .eyebrow { font-size: 12px; }
  .h-archive-heading h3 { font-size: 29px; line-height: 1.5; }
  .h-archive-count { font-size: 12px; padding: 5px 10px; gap: 6px; }
  .h-archive-card { border-radius: 10px; }
  .h-archive-frame { border-radius: 10px; }
  .h-archive-frame img { object-fit: contain; }
  .h-archive-caption { font-size: 13px; line-height: 1.75; gap: 9px; padding-block: 10px 3px; }
  .h-archive-caption > span:not(.h-archive-open) { padding-inline-start: 9px; min-width: 0; }
  .h-archive-open { width: 44px; height: 44px; flex-shrink: 0; }
  .h-archive-footer { font-size: 13px; line-height: 1.9; padding-top: 18px; margin-top: 14px; }
  .h-archive-source { min-height: 44px; }
  .h-photo-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); border-radius: 14px; }
  .h-photo-toolbar h2 { font-size: 17px; }
  .h-photo-toolbar h2 > small { font-size: 12px; }
  .h-photo-counter { font-size: 13px; }
  .h-photo-close,
  .h-photo-nav { width: 44px; height: 44px; }
  .h-photo-caption { font-size: 14px; line-height: 1.85; }
  .h-photo-footer-meta { font-size: 12px; }
  .h-photo-original { min-height: 44px; }

  .future-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .future-item { padding-top: 21px; }
  .future-item h3 { font-size: 25px; line-height: 1.55; margin-block: 12px; }
  .future-item p { font-size: 17px; line-height: 1.85; }
  .contact-copy h2 { font-size: 35px; line-height: 1.4; }
  .contact-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.85; margin-top: 18px; }
  .contact-actions { align-items: stretch; margin-top: 24px; gap: 14px; }
  .contact-actions > .btn { min-height: 54px; }
  .contact-actions .phone-list { width: 100%; margin-block: 0; }
  .contact-actions .phone-item { width: 100%; min-height: 60px; justify-content: space-between; gap: 12px; padding: 12px 14px; }
  .contact-actions .phone-item span { font-size: 13px; line-height: 1.6; opacity: 1; color: var(--muted); }
  .contact-actions .phone-item bdi { font-size: 20px; white-space: nowrap; }
  .contact-signature { font-size: 13px; line-height: 1.8; gap: 9px; }
  .site-footer { padding-top: 26px; }
  .footer-top { gap: 20px 14px; padding-block: 7px 23px; }
  .site-footer .brand { gap: 9px; }
  .site-footer .brand img { width: 38px; height: 51px; object-fit: contain; }
  .site-footer .brand strong { font-size: 22px; }
  .site-footer .brand small { font-size: 12px; line-height: 1.7; }
  .back-top { width: 44px; height: 44px; flex-shrink: 0; }
  .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; font-size: 15px; }
  .footer-links a { display: flex; align-items: center; min-height: 44px; }
  .h-footer-contact { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-block: 23px; }
  .h-footer-social-title { font-size: 16px; margin-bottom: 12px; }
  .h-footer-contact .h-social-links { justify-content: space-between; gap: 6px; max-width: 300px; }
  .h-footer-phone { width: 100%; padding: 15px 18px; border-radius: 13px; }
  .h-footer-phone small { font-size: 13px; }
  .h-footer-phone bdi { font-size: 23px; }
  .footer-bottom { gap: 9px; padding-block: 20px 24px; font-size: 12px; line-height: 1.85; }
  .heroes-edition .motion-toggle {
    width: 44px;
    height: 44px;
    left: 12px;
    bottom: calc(var(--h-mobile-nav-height) + var(--h-mobile-safe-bottom) + 12px);
    box-shadow: 0 4px 16px #0003;
  }
  .holmes-dialog { padding: 26px 20px; border-radius: 18px; }
  .holmes-dialog h2 { font-size: 28px; }
  .holmes-dialog p { font-size: 17px; line-height: 1.85; }
  .dialog-close { width: 44px; height: 44px; }
  .dialog-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dialog-actions .btn { width: 100%; min-height: 50px; }

  /* Native anchors remain usable before JavaScript initializes. */
  .h-mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 105;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    direction: rtl;
    min-height: calc(var(--h-mobile-nav-height) + var(--h-mobile-safe-bottom));
    padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(5px + var(--h-mobile-safe-bottom)) max(6px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #355074;
    background: #051c40;
    box-shadow: 0 -6px 24px #0003;
  }
  .h-mobile-nav-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 58px;
    padding: 4px 2px;
    border-radius: 13px;
    color: #c1cce0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    white-space: nowrap;
    text-align: center;
    transition: color .2s ease, background .2s ease;
  }
  .h-mobile-nav-icon { display: grid; place-items: center; width: 44px; height: 27px; border-radius: 12px; transition: background .2s ease; }
  .h-mobile-nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .h-mobile-nav-icon .h-mobile-whatsapp { fill: currentColor; stroke: none; width: 21px; height: 21px; }
  .h-mobile-nav-link.is-active,
  .h-mobile-nav-link[aria-current="location"] { color: #f6c60a; }
  .h-mobile-nav-link.is-active .h-mobile-nav-icon,
  .h-mobile-nav-link[aria-current="location"] .h-mobile-nav-icon { background: #f6c60a18; }
  .h-mobile-nav-link:active { background: #ffffff0b; }
  .h-mobile-nav-link:focus-visible { outline: 2px solid #f6c60a; outline-offset: -2px; }
  .h-mobile-nav-contact { color: #fff; }

  @keyframes h-mobile-enter {
    from { opacity: 1; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 360px) {
  .hero-actions { grid-template-columns: minmax(0, 1fr); }
  .heroes-edition .hero-actions .btn { white-space: nowrap; }
  .site-header .brand strong { font-size: 21px; }
  .site-header .brand small { font-size: 12px; }
  .heroes-edition .hero-visual { width: 100%; }
  .path-card { padding: 18px; gap: 11px; }
  .path-card h3 { font-size: 24px; }
  .h-faculty-subject { font-size: 14px; }
  .h-memory-poster { padding: 20px; }
  .h-memory-poster blockquote > span { font-size: 17px; }
  .h-memory-timeline > div > strong { font-size: 14px; }
  .h-archive-heading h3 { font-size: 27px; }
  .contact-actions .phone-item { flex-direction: column; align-items: flex-start; gap: 3px; }
  .site-footer .brand strong { font-size: 21px; }
  .site-footer .brand small { font-size: 12px; }
  .h-mobile-nav-link { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .h-mobile-nav-link,
  .h-mobile-nav-icon { transition: none; }
}
@media print {
  .h-mobile-nav { display: none !important; }
  body.heroes-edition { padding-bottom: 0; }
}
