/* ==========================================================================
   Responsive
   ≥ 1200px  desktop: the 1440px design canvas scales with the viewport (renderer.js fit()) — untouched here.
   < 1200px  compact: fluid layout (html.is-compact is also set by fit()).
   <  760px  phone.
   Keep 1200px in sync with BREAKPOINT in assets/js/config.js.

   Compact tokens — Figma "OpenFairy — Tablet 768" (166:618) / "OpenFairy — Mobile 390" (166:619)
                                            tablet   phone
     --t-h1       hero headline              64      36   (Inter Tight 500, lh .96)
     --t-h2       section titles             52      34   (lh 1.02)
     --t-disp     S3 statement               60      40
     --t-feat     feature titles             32      26
     --t-item     list titles                24      20
     --t-card     card titles                21      18
     --t-lead     lead paragraphs            18      17
     --t-body     body copy                  16      15
     --g          page gutter                32      20
     --sec        section padding            96      72
     --stack      title → content            44      28
     --gap        grid gap                   14      12
     --cr / --cp  card radius / padding   22/20   20/16
   ========================================================================== */
.wing-slot{display:none}

@media (max-width:1199.98px){
  :root{
    --g:32px; --sec:96px; --stack:44px; --gap:14px; --cr:22px; --cp:20px;
    --t-h1:64px; --t-h2:52px; --t-disp:60px; --t-feat:32px; --t-item:24px; --t-card:21px; --t-lead:18px; --t-body:16px;
    --t-h3:var(--t-card);
  }
  #page{width:100%}
  #metrics,#brand,#brand-diagram,#capabilities,#use-cases,#membership,#get-started,.foot{width:auto}   /* ids: ".brand" is also a span class in titles */

  /* shared heading treatment */
  .m-title,.b-title,.c-title,.u-title,.mem-title,.gs-title{white-space:normal;text-wrap:wrap}
  .m-title,.c-title,.u-title,.mem-title,.gs-title{font-size:var(--t-h2);line-height:1.02;letter-spacing:-.055em}

  /* ================= hero ================= */
  #art{width:100%;height:auto;min-height:0;padding:16px var(--g) var(--sec);
    display:grid;grid-template-columns:minmax(0,317fr) minmax(0,355fr);column-gap:32px;align-content:start;
    grid-template-areas:"nav nav" "head head" "slot slot" "hint hint" "cta info"}
  #gl{width:100%;height:100%}
  #art .nav{grid-area:nav;position:relative;left:auto;right:auto;top:auto;height:48px}
  #art .head{grid-area:head;position:relative;left:auto;top:auto;margin-top:64px}
  #art h1{font-size:var(--t-h1);line-height:.96}
  #art .wing-slot{grid-area:slot;display:block;height:430px}
  #art .hint{grid-area:hint;position:relative;left:auto;bottom:auto;justify-self:center;margin:0 0 40px;transform:translateY(16px)}
  #art.ready .hint{transform:none}
  #art .cta{grid-area:cta;position:relative;left:auto;bottom:auto;align-self:end;margin:0;gap:20px}
  #art .cta .txt{gap:20px}
  #art .cta p{width:auto;max-width:none;font-size:var(--t-body);line-height:1.6}
  #art .cta p.sub{font-size:var(--t-lead);line-height:1.3}
  #art .info{grid-area:info;position:relative;right:auto;top:auto;bottom:auto;width:auto;align-self:end;margin:0}
  #art .provs{padding:19px}
  #art .callout,#art .side{display:none}
  .br-d{display:none}
  #pre{position:fixed}

  /* ================= 02 · metrics ================= */
  #metrics{height:auto;padding:var(--sec) var(--g) 0;overflow:hidden}
  .m-glow{display:none}
  .m-wrap{position:relative;left:auto;top:auto;width:auto;padding-bottom:0}
  .m-head{flex-direction:column;align-items:stretch;gap:16px}
  .m-sub{margin:0;width:auto;max-width:none;font-size:var(--t-body);line-height:1.6}
  /* cards: weekly tokens on its own row, then the other four */
  .m-cards{margin-top:var(--stack);height:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--gap);align-items:stretch}
  .m-card,.m-card.is-active{display:flex;flex-direction:column;justify-content:space-between;
    height:172px;min-height:0;padding:var(--cp);border-radius:var(--cr);cursor:default}
  .m-card[data-i="2"]{grid-column:1/-1;order:-1;height:220px}
  .m-card::before,.m-card.is-active::before{opacity:0}
  .m-card[data-i="2"]::before{opacity:1}
  .m-card .m-idx{background:var(--glass);border-color:var(--glass-edge);color:var(--ink)}
  .m-card[data-i="2"] .m-idx{background:var(--night);border-color:var(--night);color:var(--frost)}
  .m-num .n,.m-card.is-active .m-num .n{font-size:44px}
  .m-card[data-i="2"] .m-num .n{font-size:64px}
  .m-lbl{white-space:nowrap;overflow:hidden}

  /* ================= 03 · brand (diagram version) ================= */
  #brand-diagram{height:auto;padding:var(--sec) var(--g) 0;grid-template-columns:minmax(0,1fr);row-gap:var(--stack)}
  .b-title{font-size:var(--t-h2)}
  .b-lead{margin-top:20px;max-width:620px;font-size:var(--t-lead)}
  .b-cols{margin-top:28px;padding-top:20px;max-width:720px}
  .b-body{font-size:var(--t-body)}
  .b-diagram{min-height:400px}

  /* ================= 03 · statement ================= */
  section.statement{padding:var(--sec) var(--g)}
  .s-title{margin-top:0;font-size:var(--t-disp);line-height:1}
  .s-l2{padding-left:21.3%}       /* 150 / 704 */
  .s-l3{padding-left:10.65%}      /* 75 / 704 */
  .s-bottom{margin-top:var(--stack);grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:28px}
  .s-figure{height:400px}
  .s-figure img{width:190%}
  .s-lead{font-size:var(--t-lead);padding-bottom:24px}
  .s-rows li{padding:20px 0}
  .s-rows p{font-size:var(--t-body)}
  .s-rows .s-providers{gap:12px 20px}
  .s-providers img{height:16px}
  .s-providers img[alt=Doubao]{height:17px}
  .s-providers img[alt=Qwen]{order:1}      /* Figma tablet / mobile order: … Gemini, ChatGLM, Qwen, Doubao */
  .s-providers img[alt=Doubao]{order:2}

  /* ================= 04 · capabilities ================= */
  #capabilities{height:auto;padding:var(--sec) var(--g)}
  .c-title{position:static}
  .c-list{position:static;width:auto;margin-top:var(--stack)}
  .c-item{padding:22px 0}
  .c-item.is-active{padding-bottom:22px}
  .c-item-title .c-trigger{gap:16px}
  .c-name,.c-item.is-active .c-name{width:auto;font-size:var(--t-item);line-height:1.18;letter-spacing:-.035em}
  .c-desc{width:auto;max-width:none;padding:12px 0 4px;font-size:var(--t-body)}
  .c-visual{position:relative;left:auto;top:auto;width:auto;height:auto;margin-top:var(--stack);padding:24px;border-radius:24px}
  .c-scene{position:relative;inset:auto;display:none;transform:none;transition:none}
  .c-visual[data-step="1"] [data-scene="1"],.c-visual[data-step="2"] [data-scene="2"],
  .c-visual[data-step="3"] [data-scene="3"],.c-visual[data-step="4"] [data-scene="4"]{display:flex;animation:r-scene-in .6s cubic-bezier(.16,1,.3,1)}
  [data-scene="1"]{gap:14px;align-items:stretch}
  .c-providers{position:relative;left:auto;top:auto;width:auto;flex:1 1 0}
  .c-entry{position:relative;left:auto;top:auto;width:auto;flex:1 1 0;justify-content:center}
  .c-console{width:100%;max-width:640px}
  .c-code{overflow-x:auto}
  .c-route-model{overflow:hidden;text-overflow:ellipsis}

  /* ================= 05 · use cases ================= */
  #use-cases{padding:var(--sec) var(--g)}
  .u-rail{display:none}
  .u-cards{margin-top:var(--stack);grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap)}
  .u-card{height:auto;min-height:0;padding:var(--cp);border-radius:var(--cr);gap:16px}
  .u-name{margin:0;font-size:var(--t-card);line-height:1.18;letter-spacing:-.03em}
  .u-desc{margin:0;font-size:var(--t-body);line-height:1.6}
  .uses[data-bg="night"] .u-card{background:rgba(244,243,241,.05);border-color:rgba(244,243,241,.09)}
  .uses[data-bg="night"] .u-desc{color:rgba(244,243,241,.62)}
  .u-idx{padding:6px 12px;font-weight:600}
  .uses[data-bg="night"] .u-idx{background:rgba(244,243,241,.06);border-color:rgba(244,243,241,.12)}
  /* product window preview (usecases-variants.js): the desktop window scaled to the card width */
  .u-card:has(.u-prev) .u-viz{display:none}
  .u-prev{position:relative;aspect-ratio:576/470;border-radius:14px;overflow:hidden}
  .u-prev .u-win{left:0;top:0;width:576px;height:470px;transform:scale(var(--k,.5));transform-origin:0 0;box-shadow:none}

  /* ================= 06 · membership ================= */
  #membership{padding:var(--sec) var(--g)}
  .mem-title{margin-top:20px}
  .mem-lead{margin-top:20px;width:auto;max-width:704px;font-size:var(--t-lead)}
  .mem-btn{margin-top:32px}
  .mem-stage{height:auto;margin-top:var(--stack);display:flex;flex-flow:row wrap;justify-content:center;align-items:center;gap:10px}
  .mem-pass{position:relative;left:auto;top:auto;flex:0 0 auto;width:min(460px,100%);height:290px;margin:0 calc((100% - min(460px,100%)) / 2) 10px;order:-1}
  .mem-stage .mem-perk{position:relative;inset:auto;width:auto;height:auto;flex-direction:row;gap:8px;padding:12px 14px;border-radius:99px;font-size:11px;transform:none}
  .mem-stage .mem-perk>span:last-child{width:auto}
  .mem-stage .mem-perk img{width:16px;height:16px}
  .mem-perk .glyph{height:16px;font-size:12px;line-height:16px}
  .mem-pass{margin-bottom:10px}

  /* ================= 07 · get started ================= */
  #get-started{padding:0 var(--g) var(--sec)}
  .gs-panel{grid-template-columns:minmax(0,1fr);gap:32px;min-height:0;padding:56px 40px 0;border-radius:32px}
  .gs-copy{padding-bottom:0}
  .gs-title{margin-top:20px}
  .gs-lead{margin-top:20px;width:auto;font-size:var(--t-lead)}
  .gs-actions{margin-top:28px}
  .gs-console{width:100%}
  .gs-code{overflow-x:auto}

  /* ================= footer ================= */
  .foot{padding:56px var(--g) 28px}
  .foot-grid{grid-template-columns:2fr 1fr 1fr;column-gap:24px;row-gap:40px}
  .foot-tag{font-size:var(--t-lead)}
  .foot-desc{font-size:var(--t-body)}
  .foot-base{flex-wrap:wrap;gap:12px;margin-top:48px}
}
@keyframes r-scene-in{from{opacity:0;transform:translateY(10px)}}

/* ---------- phone (Figma 390) ---------- */
@media (max-width:759.98px){
  :root{
    --g:20px; --sec:72px; --stack:28px; --gap:12px; --cr:20px; --cp:16px;
    --t-h1:36px; --t-h2:34px; --t-disp:40px; --t-feat:26px; --t-item:20px; --t-card:18px; --t-lead:17px; --t-body:15px;
  }
  /* hero: single column */
  #art{grid-template-columns:minmax(0,1fr);grid-template-areas:"nav" "head" "slot" "hint" "cta" "info"}
  #art .nav .links{display:none}
  #art .nav .btn{display:none}
  #art .head{margin-top:40px}
  #art .wing-slot{height:280px}
  #art .hint{margin-bottom:36px}
  #art .cta,#art .cta .txt{gap:18px}
  #art .info{margin-top:28px}
  #art .provs{padding:17px}

  /* metrics: featured card, then 2 × 2 */
  .m-head{gap:14px}
  .m-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .m-card,.m-card.is-active{height:168px}
  .m-card[data-i="2"]{height:200px}
  .m-card .m-icon,.m-card .m-icon img{width:32px;height:32px}

  /* brand diagram: runs top → bottom (wires switch to vertical in brand.js) */
  .b-cols{grid-template-columns:1fr;gap:20px}
  .b-diagram{display:flex;flex-direction:column;align-items:center;gap:44px;min-height:0;padding:28px 18px}
  .b-src,.b-out{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:8px}
  .b-src .b-cap{flex:0 0 100%;text-align:center}
  .b-hub .b-cap,.b-out .b-cap{display:none}
  .b-node{height:32px;padding:0 12px;font-size:12.5px}
  .b-node img{height:12px}

  /* statement: one flowing title, single column */
  .s-ln{display:inline;white-space:normal}
  .s-l2,.s-l3{padding-left:0}
  .s-bottom{grid-template-columns:1fr;row-gap:28px}
  .s-figure{height:300px}
  .s-figure img{width:122%}
  .s-title{max-width:345px}
  .s-lead{padding-bottom:20px}
  .s-rows li{padding:18px 0}
  .s-rows .s-providers{gap:12px 18px}

  /* capabilities */
  .c-item{padding:24px 0}
  .c-item.is-active{padding-bottom:28px}
  .c-desc{padding-top:14px}
  .c-item-title .c-trigger{gap:14px}
  .c-visual{padding:15px}
  [data-scene="1"]{flex-direction:column;gap:12px}
  .c-providers{flex:none;padding:16px}
  .c-entry{flex:none;padding:16px 16px 22px}
  .c-console{padding:12px;border-radius:20px}
  .c-code{font-size:11px;padding:12px}
  .c-route{gap:10px;padding:10px}
  .c-route-bar{width:40px}
  .c-log{font-size:11px;padding:12px}
  .c-log-rows li{grid-template-columns:64px 32px 1fr auto;column-gap:4px}

  /* use cases: single column */
  .u-cards{grid-template-columns:1fr}

  /* membership */
  .mem-title,.mem-lead{margin-top:18px}
  .mem-title .ln{display:inline}
  .mem-btn{margin-top:28px}
  .mem-stage{margin-top:40px;gap:8px}
  .mem-pass{height:270px;padding:22px 20px;margin-bottom:10px}
  .mem-addr-v{font-size:32px}

  /* get started */
  .gs-panel{padding:32px 20px 0;gap:28px;border-radius:24px}
  .gs-title,.gs-lead{margin-top:18px}
  .gs-actions{margin-top:24px;flex-direction:column;align-items:stretch;gap:10px}
  .gs-actions .btn{justify-content:center}
  .gs-row{padding:14px 12px}
  .gs-code{white-space:pre-wrap;overflow-x:visible}

  /* footer: brand on top, link columns side by side */
  .foot-grid{grid-template-columns:1fr 1fr}
  .foot-brand{grid-column:1/-1}
}

/* ---------- touch screens: no custom cursor ---------- */
@media (hover:none){
  #cur{display:none}
  #art{cursor:auto}
  .btn{cursor:pointer}
  .m-card{cursor:default}
}

/* no column hairlines on the light sections (S3 statement, S4 capabilities, S5 when light, S6 membership).
   The dark / orange S5 band and the orange S7 card keep theirs. */
.s-grid,.caps::before,.mem::before,.uses[data-bg="light"]::before{display:none}
