/* ==========================================================================
   AI Project Universe V2.5
   Compact Project Universe mobile sections + AI Portfolio Hub mobile nav.
   ========================================================================== */

/* ---------------- Project Universe root mobile polish ---------------- */
@media (max-width: 767px) {
  .site-header {
    top: 6px !important;
    left: max(7px, env(safe-area-inset-left)) !important;
    right: max(7px, env(safe-area-inset-right)) !important;
    width: auto !important;
    min-height: 58px !important;
    padding: 6px 7px !important;
    gap: 7px !important;
    border-width: 3px !important;
    border-radius: 15px !important;
    box-shadow: 4px 5px 0 var(--ink) !important;
    transform: none !important;
  }

  .site-header.is-hidden {
    transform: translateY(-135%) !important;
  }

  .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 62px) !important;
    gap: 7px !important;
  }

  .brand__mark {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    font-size: 16px !important;
    border-width: 2px !important;
  }

  .brand strong {
    font-size: 13px !important;
    line-height: .9 !important;
  }

  .brand small {
    margin-top: 4px !important;
    font-size: 7px !important;
    line-height: 1 !important;
    letter-spacing: 2px !important;
  }

  .header-actions {
    flex: 0 0 auto !important;
    max-width: 54px !important;
  }

  .header-actions .icon-button,
  .header-actions .install-button {
    display: none !important;
  }

  .menu-button {
    display: grid !important;
    place-items: center;
    width: 48px !important;
    min-width: 48px !important;
    height: 40px !important;
    padding: 0 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    box-shadow: 2px 2px 0 var(--ink) !important;
  }

  .mobile-menu {
    top: 72px !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    width: auto !important;
    max-height: calc(100dvh - 82px) !important;
    padding: 8px !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
    box-shadow: 6px 7px 0 var(--ink) !important;
  }

  .mobile-menu:not([hidden]) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .mobile-menu a {
    display: grid !important;
    place-items: center !important;
    min-height: 48px !important;
    padding: 9px 7px !important;
    border: 2px solid var(--ink) !important;
    border-radius: 11px !important;
    background: var(--white) !important;
    text-align: center !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
  }

  .downloads-section {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
    padding: 38px 12px 44px !important;
  }

  .downloads-section > div:first-child {
    max-width: 100% !important;
  }

  .downloads-section .section-label {
    margin: 0 0 9px !important;
    font-size: 9px !important;
    letter-spacing: .08em !important;
  }

  .downloads-section h2 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(38px, 12vw, 54px) !important;
    line-height: .86 !important;
    letter-spacing: -.045em !important;
  }

  .download-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  .download-grid a {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    align-items: center !important;
    min-height: 88px !important;
    gap: 2px 12px !important;
    padding: 11px 12px !important;
    border-width: 3px !important;
    box-shadow: 5px 6px 0 var(--ink) !important;
  }

  .download-grid span {
    grid-row: 1 / 3 !important;
    align-self: center !important;
    font-size: 37px !important;
    line-height: 1 !important;
  }

  .download-grid b {
    align-self: end !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    letter-spacing: .01em !important;
  }

  .download-grid small {
    align-self: start !important;
    font-size: 8.5px !important;
    line-height: 1.25 !important;
    letter-spacing: .03em !important;
  }

  .cta {
    min-height: 430px !important;
    padding: 48px 14px 52px !important;
    overflow: hidden !important;
  }

  .cta__ghost {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 54vw !important;
    line-height: .8 !important;
    overflow: hidden !important;
  }

  .cta p {
    max-width: 100% !important;
    margin: 0 auto 18px !important;
    font-size: 9px !important;
    line-height: 1.35 !important;
    letter-spacing: .08em !important;
  }

  .cta h2 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 30px !important;
    font-size: clamp(46px, 14vw, 66px) !important;
    line-height: .82 !important;
    letter-spacing: -.045em !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .cta h2 span {
    -webkit-text-stroke-width: 2px !important;
  }

  .cta__button {
    width: min(100%, 344px) !important;
    max-width: calc(100vw - 28px) !important;
    min-height: 54px !important;
    padding: 13px 12px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    box-shadow: 6px 7px 0 var(--ink) !important;
  }

  .footer {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    padding: 36px 14px !important;
  }

  .footer__logo {
    font-size: 34px !important;
  }
}

/* ---------------- AI Portfolio Hub navigation ---------------- */
.ae25-backdrop,
.ae25-drawer-heading {
  display: none;
}

@media (max-width: 767px) {
  html.ae25-nav-open,
  body.ae25-nav-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.project-academic-evidence-v25 {
    overflow-x: clip !important;
  }

  body.project-academic-evidence-v25 .ae25-header {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 140 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 10px 0 13px !important;
    gap: 8px !important;
    border-bottom: 1px solid hsl(var(--primary) / .22) !important;
    background:
      linear-gradient(135deg, hsl(var(--background) / .97), hsl(var(--card) / .93)) !important;
    box-shadow: 0 9px 28px rgba(8, 8, 8, .24) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
  }

  body.project-academic-evidence-v25 .ae25-header h1 {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 96px) !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: hsl(var(--primary)) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    letter-spacing: .015em !important;
  }

  body.project-academic-evidence-v25 .ae25-header > div {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 5px !important;
  }

  body.project-academic-evidence-v25 .ae25-header button {
    display: grid !important;
    place-items: center !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 12px !important;
    background: hsl(var(--card) / .72) !important;
    color: hsl(var(--foreground)) !important;
    transition:
      transform .18s ease,
      border-color .18s ease,
      background .18s ease !important;
  }

  body.project-academic-evidence-v25 .ae25-header button:hover {
    border-color: hsl(var(--primary) / .55) !important;
    background: hsl(var(--primary) / .1) !important;
  }

  body.project-academic-evidence-v25 .ae25-header button:active {
    transform: scale(.93) !important;
  }

  body.project-academic-evidence-v25 .ae25-header button svg {
    width: 18px !important;
    height: 18px !important;
  }

  body.project-academic-evidence-v25 .ae25-backdrop {
    position: fixed !important;
    inset: 56px 0 0 !important;
    z-index: 118 !important;
    display: block !important;
    visibility: hidden;
    opacity: 0;
    border: 0;
    background: rgba(6, 6, 6, .68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity .22s ease, visibility .22s ease;
    pointer-events: none;
  }

  body.project-academic-evidence-v25 .ae25-backdrop.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  body.project-academic-evidence-v25 .ae25-drawer {
    position: fixed !important;
    inset:
      64px
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      auto !important;
    z-index: 125 !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(88vw, 340px) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom)) !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid hsl(var(--primary) / .32) !important;
    border-radius: 20px !important;
    background:
      linear-gradient(155deg, hsl(var(--card) / .99), hsl(var(--background) / .99)) !important;
    box-shadow:
      0 30px 90px rgba(0, 0, 0, .5),
      inset 0 1px 0 rgba(255,255,255,.05) !important;
    animation: ae25DrawerIn .24s cubic-bezier(.2,.8,.2,1) both;
  }

  @keyframes ae25DrawerIn {
    from {
      opacity: 0;
      transform: translate3d(18px, 0, 0) scale(.975);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  body.project-academic-evidence-v25 .ae25-drawer-heading {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-height: 60px !important;
    padding: 10px 10px 9px 14px !important;
    border-bottom: 1px solid hsl(var(--border)) !important;
    background:
      linear-gradient(90deg, hsl(var(--primary) / .1), transparent 58%) !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer-heading strong,
  body.project-academic-evidence-v25 .ae25-drawer-heading span {
    display: block !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer-heading strong {
    color: hsl(var(--foreground)) !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer-heading span {
    margin-top: 3px !important;
    color: hsl(var(--muted-foreground)) !important;
    font-size: 8.5px !important;
    line-height: 1.2 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer-close {
    position: relative !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border: 1px solid hsl(var(--primary) / .35) !important;
    border-radius: 12px !important;
    background: hsl(var(--primary) / .1) !important;
    color: transparent !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer-close::before,
  body.project-academic-evidence-v25 .ae25-drawer-close::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 17px;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: hsl(var(--primary));
  }

  body.project-academic-evidence-v25 .ae25-drawer-close::before {
    transform: rotate(45deg);
  }

  body.project-academic-evidence-v25 .ae25-drawer-close::after {
    transform: rotate(-45deg);
  }

  body.project-academic-evidence-v25 .ae25-drawer nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-content: start !important;
    gap: 7px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0 !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 13px !important;
    background: hsl(var(--muted) / .42) !important;
    color: hsl(var(--muted-foreground)) !important;
    font-size: 10.5px !important;
    line-height: 1.18 !important;
    font-weight: 650 !important;
    text-decoration: none !important;
    overflow-wrap: anywhere !important;
    transition:
      transform .17s ease,
      border-color .17s ease,
      background .17s ease,
      color .17s ease !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav a:hover {
    transform: translateY(-1px) !important;
    border-color: hsl(var(--primary) / .5) !important;
    background: hsl(var(--primary) / .1) !important;
    color: hsl(var(--foreground)) !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav a[aria-current="page"] {
    border-color: hsl(var(--primary) / .75) !important;
    background:
      linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / .78)) !important;
    color: hsl(var(--primary-foreground)) !important;
    box-shadow: 0 9px 22px hsl(var(--primary) / .2) !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav svg {
    flex: 0 0 17px !important;
    width: 17px !important;
    height: 17px !important;
  }

  body.project-academic-evidence-v25 main {
    padding-top: 56px !important;
  }

  body.project-academic-evidence-v25 .ae-hero {
    padding-top: 0 !important;
  }
}

@media (max-width: 359px) {
  body.project-academic-evidence-v25 .ae25-drawer {
    left: 7px !important;
    right: 7px !important;
    width: auto !important;
    max-width: none !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.project-academic-evidence-v25 .ae25-drawer nav a {
    min-height: 48px !important;
  }
}
