/* ============================================================
   WQL PHASE 9B-2 — HOMEPAGE RESPONSIVE + INFORMATION HIERARCHY
   All rules are gated by html.wql-9b2 so ?legacy=1 can disable them.
   ============================================================ */

/* ---------- Desktop polish ---------- */

html.wql-9b2 .topbar{
  position:sticky;
  top:0;
  z-index:1000;
  background:color-mix(in srgb,var(--surface) 94%,transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

html.wql-9b2 .hero{
  padding-top:54px;
  padding-bottom:42px;
}

html.wql-9b2 .hero-grid{
  align-items:center;
}

html.wql-9b2 .hero h1{
  letter-spacing:-.035em;
}

html.wql-9b2 .hero-card{
  box-shadow:0 22px 60px rgba(7,32,67,.12);
}

html.wql-9b2 .notice{
  gap:10px;
}

html.wql-9b2 .trust{
  height:100%;
}

html.wql-9b2 .trust h3{
  line-height:1.45;
}

html.wql-9b2 .trust p{
  line-height:1.75;
}

html.wql-9b2 .wql-mobile-strategy-summary{
  display:none;
}


/* ---------- Hamburger controls ---------- */

html.wql-9b2 .wql-home-menu-toggle{
  display:none;
  width:44px;
  height:44px;
  flex:0 0 44px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  color:var(--ink);
  padding:0;
  cursor:pointer;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
}

html.wql-9b2 .wql-home-menu-toggle span{
  width:18px;
  height:2px;
  border-radius:99px;
  background:currentColor;
  transition:
    transform .18s ease,
    opacity .18s ease;
}

html.wql-9b2 .wql-home-menu-toggle.open span:nth-child(1){
  transform:translateY(7px) rotate(45deg);
}

html.wql-9b2 .wql-home-menu-toggle.open span:nth-child(2){
  opacity:0;
}

html.wql-9b2 .wql-home-menu-toggle.open span:nth-child(3){
  transform:translateY(-7px) rotate(-45deg);
}

html.wql-9b2 .wql-home-nav-backdrop{
  position:fixed;
  inset:0;
  z-index:900;
  background:rgba(5,18,38,.26);
}


/* ============================================================
   TABLET / MOBILE NAV
   ============================================================ */

@media(max-width:900px){

  html.wql-9b2 .nav{
    position:relative;
  }

  html.wql-9b2 .navlinks{
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    z-index:1001;

    display:grid !important;
    gap:6px;

    padding:10px;
    border:1px solid var(--line);
    border-radius:18px;
    background:var(--surface);
    box-shadow:0 18px 50px rgba(8,30,65,.18);

    opacity:0;
    visibility:hidden;
    transform:translateY(-8px);
    pointer-events:none;

    transition:
      opacity .18s ease,
      visibility .18s ease,
      transform .18s ease;
  }

  html.wql-9b2 .navlinks.wql-mobile-open{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
    pointer-events:auto;
  }

  html.wql-9b2 .navlinks a{
    display:flex;
    align-items:center;
    min-height:46px;
    padding:10px 14px;
    border-radius:12px;
  }

  html.wql-9b2 .navlinks a.active{
    background:var(--surface2);
  }

  html.wql-9b2 .wql-home-menu-toggle{
    display:flex;
  }

  html.wql-9b2 .nav-actions{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
  }

}


/* ============================================================
   MOBILE HOMEPAGE
   ============================================================ */

@media(max-width:560px){

  html.wql-9b2,
  html.wql-9b2 body{
    max-width:100%;
    overflow-x:hidden;
  }

  html.wql-9b2 .wrap{
    width:calc(100% - 28px);
  }


  /* Header */

  html.wql-9b2 .nav{
    min-height:66px;
    height:auto;
    gap:8px;
    padding-top:8px;
    padding-bottom:8px;
  }

  html.wql-9b2 .brand{
    gap:9px;
    min-width:0;
    max-width:calc(100% - 106px);
  }

  html.wql-9b2 .brand img{
    width:40px;
    height:40px;
    flex:0 0 40px;
  }

  html.wql-9b2 .brand strong{
    display:block;
    font-size:16px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  html.wql-9b2 .brand small{
    display:none;
  }

  html.wql-9b2 .nav-actions{
    flex:0 0 auto;
  }

  html.wql-9b2 .icon-btn{
    width:44px;
    height:44px;
    padding:0;
  }


  /* Hero — show the actual product sooner */

  html.wql-9b2 .hero{
    padding:28px 0 18px;
  }

  html.wql-9b2 .hero-grid{
    gap:18px;
  }

  html.wql-9b2 .hero .eyebrow{
    font-size:11px;
  }

  html.wql-9b2 .hero h1{
    margin:9px 0 12px;
    font-size:34px;
    line-height:1.08;
    letter-spacing:-.04em;
  }

  html.wql-9b2 .hero p{
    font-size:14px;
    line-height:1.68;
  }

  html.wql-9b2 .hero-actions{
    margin-top:16px;
    gap:8px;
  }

  html.wql-9b2 .hero-actions .btn{
    min-height:44px;
    padding:9px 8px;
    font-size:14px;
  }

  html.wql-9b2 .hero-card{
    padding:16px;
    border-radius:18px;
  }

  html.wql-9b2 .hero-card .live-row{
    gap:7px;
  }

  html.wql-9b2 .hero-card .live-row h3{
    font-size:17px;
  }

  html.wql-9b2 .hero-metrics{
    margin:14px 0 0;
    gap:8px;
  }

  html.wql-9b2 .metric-dark{
    padding:10px;
  }

  html.wql-9b2 .metric-dark small{
    font-size:10px;
  }

  html.wql-9b2 .metric-dark strong{
    font-size:18px;
  }

  html.wql-9b2 .mini-chart{
    display:none;
  }


  /* Latest announcement is secondary content */

  html.wql-9b2 .hero + .section{
    padding-top:12px;
    padding-bottom:16px;
  }

  html.wql-9b2 #notice{
    display:grid;
    grid-template-columns:auto auto minmax(0,1fr);
    gap:8px 9px;
    align-items:center;
    padding:13px 14px;
    border-radius:15px;
  }

  html.wql-9b2 #notice > span:first-child{
    grid-row:1 / span 2;
  }

  html.wql-9b2 #notice > strong{
    font-size:14px;
  }

  html.wql-9b2 #notice .tag{
    justify-self:start;
    font-size:11px;
  }

  html.wql-9b2 #notice [data-announcement-actions]{
    grid-column:2 / -1;
    margin-left:0 !important;
    margin-top:2px;
    display:flex !important;
    gap:6px !important;
  }

  html.wql-9b2 #notice [data-announcement-actions] .btn{
    min-height:34px;
    padding:6px 10px;
    border-radius:10px;
    font-size:12px;
  }


  /* Strategy section */

  html.wql-9b2 #strategies.section{
    padding-top:22px;
  }

  html.wql-9b2 #strategies .section-head{
    margin-bottom:12px;
  }

  html.wql-9b2 #strategies .section-head h2{
    font-size:26px;
  }

  html.wql-9b2 #pageSync{
    font-size:11px;
    line-height:1.5;
  }

  html.wql-9b2 .tabs,
  html.wql-9b2 .filters{
    gap:7px;
  }

  html.wql-9b2 .tabs button,
  html.wql-9b2 .filters button{
    padding:8px 12px;
    font-size:13px;
  }


  /* Strategy cards: mobile information hierarchy */

  html.wql-9b2 .strategy-card{
    padding:16px;
    border-radius:17px;
  }

  html.wql-9b2 .strategy-card .card-title{
    align-items:flex-start;
    margin-bottom:14px;
  }

  html.wql-9b2 .strategy-card .card-title h3{
    font-size:21px;
    line-height:1.25;
  }

  html.wql-9b2 .strategy-card .card-title .sub{
    font-size:12px;
  }

  html.wql-9b2 .strategy-card .status-line{
    margin-top:6px;
    font-size:11px;
    line-height:1.5;
  }

  html.wql-9b2 .strategy-card .risk-level-box{
    min-width:64px !important;
  }

  html.wql-9b2 .strategy-card .risk-level-label span{
    font-size:10px;
  }

  html.wql-9b2 .strategy-card .risk-level-value{
    font-size:22px;
  }

  html.wql-9b2 .wql-mobile-strategy-summary{
    display:grid;
    gap:8px;
    margin-top:4px;
  }

  html.wql-9b2 .wql-mobile-summary-block{
    display:grid;
    grid-template-columns:92px minmax(0,1fr);
    align-items:center;
    gap:10px;
    padding:11px 12px;
    border-radius:13px;
    background:var(--surface2);
    border:1px solid var(--line);
  }

  html.wql-9b2 .wql-mobile-summary-label{
    font-size:11px;
    font-weight:800;
    letter-spacing:.04em;
    color:var(--muted);
  }

  html.wql-9b2 .wql-mobile-summary-main{
    min-width:0;
  }

  html.wql-9b2 .wql-mobile-summary-value{
    font-size:17px;
    font-weight:900;
    line-height:1.25;
    overflow-wrap:anywhere;
  }

  html.wql-9b2 .wql-mobile-summary-sub{
    display:block;
    margin-top:3px;
    font-size:10px;
    line-height:1.45;
    color:var(--muted);
  }

  html.wql-9b2 .wql-mobile-performance-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    margin-top:4px;
  }

  html.wql-9b2 .wql-mobile-performance-grid > div{
    min-width:0;
    text-align:center;
    padding:8px 4px;
    border-radius:10px;
    background:var(--surface);
    border:1px solid var(--line);
  }

  html.wql-9b2 .wql-mobile-performance-grid small{
    display:block;
    margin-bottom:4px;
    color:var(--muted);
    font-size:9px;
  }

  html.wql-9b2 .wql-mobile-performance-grid strong{
    font-size:14px;
    overflow-wrap:anywhere;
  }

  /* Hide desktop-dense detail on phones only. Data remains on detail page. */
  html.wql-9b2 .strategy-card > .risk-box,
  html.wql-9b2 .strategy-card > .float-box,
  html.wql-9b2 .strategy-card > .perf-highlight,
  html.wql-9b2 .strategy-card > .stats-row{
    display:none !important;
  }


  /* Trust section — reduce wall-of-text feeling */

  html.wql-9b2 #why.section{
    padding-top:28px;
  }

  html.wql-9b2 #why .section-head p{
    font-size:14px;
  }

  html.wql-9b2 .trust-grid{
    gap:10px;
  }

  html.wql-9b2 .trust{
    padding:16px;
    border-radius:15px;
  }

  html.wql-9b2 .trust .num{
    font-size:11px;
  }

  html.wql-9b2 .trust h3{
    margin:7px 0;
    font-size:16px;
    line-height:1.4;
  }

  html.wql-9b2 .trust p{
    margin-bottom:0;
    font-size:13px;
    line-height:1.65;
  }


  /* CTA */

  html.wql-9b2 .cta{
    margin-top:24px;
    padding:18px;
  }

  html.wql-9b2 .cta h2{
    font-size:21px;
  }

  html.wql-9b2 .cta p{
    font-size:13px;
  }

  html.wql-9b2 .cta .hero-actions{
    margin-top:0;
  }

  html.wql-9b2 .cta .hero-actions .btn{
    font-size:13px;
  }


  /* Footer */

  html.wql-9b2 .footer{
    font-size:13px;
  }

  html.wql-9b2 .risk-disclosure{
    line-height:1.7;
  }
}


/* Extra-small phones */

@media(max-width:380px){

  html.wql-9b2 .wrap{
    width:calc(100% - 22px);
  }

  html.wql-9b2 .hero h1{
    font-size:31px;
  }

  html.wql-9b2 .brand strong{
    font-size:15px;
  }

  html.wql-9b2 .wql-mobile-summary-block{
    grid-template-columns:78px minmax(0,1fr);
  }

  html.wql-9b2 .wql-mobile-summary-value{
    font-size:16px;
  }

  html.wql-9b2 .wql-mobile-performance-grid strong{
    font-size:13px;
  }
}
