/* ── TG//OS mobile page ──────────────────────────────────────────────────────
   On a phone/tablet a module renders as a real Light Fighter Manifesto website
   page — the same top bar, Anton masthead, beveled retro windows, and footer as
   Store / Resources (tg-system.css). A phone can't run the desktop OS, so this is
   the site's mobile face. Tokens are copied from tg-system.css so the look is
   identical; everything is scoped under #tg-mobile so it never touches the module's
   own (desktop / in-OS) styling.

   The module's real body stays in the DOM (search still indexes it) but is hidden
   on touch; #tg-mobile is what a phone and a mobile crawler see.
   Shown on touch ((hover:none) and (pointer:coarse)) OR at ≤640px (below any usable split-screen) — the OS is
   desktop-only, so any phone-sized viewport gets this page, never the OS. */

#tg-mobile{display:none}

/* desktop standalone (a module opened outside the OS, e.g. straight from search):
   a single beveled pill that deep-links into the OS with this module open. */
#tg-oslink{display:none}
/* desktop standalone (a module opened outside the OS, e.g. from search): a sticky top
   banner directing the visitor into the full interactive course. Hidden inside the OS
   iframe (no tg-standalone class) and on touch (the mobile page has its own CTA). */
@media(hover:hover) and (pointer:fine) and (min-width:641px){
  /* !important: module-skin.css sets body{padding:0!important}, which otherwise
     kills this offset and the fixed banner covers the hero kicker */
  body.tg-standalone{padding-top:48px!important}
  body.tg-standalone #tg-oslink{display:flex;position:fixed;top:0;left:0;right:0;z-index:2147483000;
    align-items:center;justify-content:center;gap:13px;height:48px;padding:0 18px;
    background:#1c1f23;border-bottom:2px solid #cf362f;color:#a6a49e;text-decoration:none;
    font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.9rem;letter-spacing:.05em;text-transform:uppercase}
  body.tg-standalone #tg-oslink b{font-weight:400;color:#fff;background:#cf362f;padding:6px 15px;
    box-shadow:inset 2px 2px 0 #4a4f57,inset -2px -2px 0 #0a0b0c}
  body.tg-standalone #tg-oslink:hover b{filter:brightness(1.12)}
  body.tg-standalone #tg-oslink:active b{box-shadow:inset 2px 2px 0 #0a0b0c,inset -2px -2px 0 #4a4f57}
}

@media(hover:none) and (pointer:coarse),(max-width:640px){
  body>*:not(#tg-mobile){display:none!important}          /* hide the module body (stays in DOM for search) */
  body.tg-standalone #tg-oslink{display:none!important}   /* no desktop pill on a phone */
  html,body{background:#131417!important;overflow:auto!important;height:auto!important}

  #tg-mobile{
    /* tokens copied verbatim from tg-system.css :root */
    --bg:#131417;--face:#2b2e33;--well:#181a1c;--panel:#1d1f24;--screen:#15171c;
    --t1:#e9e7e1;--t2:#a6a49e;--t3:#969389;--accent:#cf362f;
    --ln:rgba(255,255,255,.07);--os-lt:#4a4f57;--os-dk:#0a0b0c;
    --raise:inset 2px 2px 0 var(--os-lt),inset -2px -2px 0 var(--os-dk);
    --sink:inset 2px 2px 0 var(--os-dk),inset -2px -2px 0 var(--os-lt);
    --fd:'Anton','Inter',sans-serif;--fb:'Inter',sans-serif;--fl:'JetBrains Mono',ui-monospace,monospace;
    display:flex;flex-direction:column;min-height:100vh;
    background:var(--bg);color:var(--t1);font-family:var(--fb);line-height:1.6;
    -webkit-font-smoothing:antialiased;
  }
  #tg-mobile *{box-sizing:border-box;margin:0;padding:0}

  /* top bar — identical to Store / Resources */
  #tg-mobile .tm-top{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:center;
    flex-wrap:wrap;gap:8px 16px;padding:10px 16px;background:var(--face);box-shadow:var(--raise)}
  #tg-mobile .tm-brand{display:flex;align-items:center;gap:9px;font-family:var(--fl);font-size:1rem;
    letter-spacing:.1em;text-transform:uppercase;color:#fff;text-decoration:none;white-space:nowrap}
  #tg-mobile .tm-brand .mk{width:13px;height:13px;background:var(--accent);box-shadow:var(--raise)}
  #tg-mobile .tm-nav{display:flex;gap:2px;font-family:var(--fl);font-size:.88rem;letter-spacing:.05em;text-transform:uppercase}
  #tg-mobile .tm-nav a{color:var(--t2);padding:4px 9px;text-decoration:none}
  #tg-mobile .tm-nav a.on{color:#fff;background:var(--accent);box-shadow:var(--raise)}

  /* masthead */
  #tg-mobile .tm-wrap{flex:1;width:100%;max-width:1180px;margin:0 auto;padding:clamp(24px,7vw,40px) clamp(14px,4vw,26px) 0}
  #tg-mobile .tm-kick{font-family:var(--fl);font-size:.95rem;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);margin-bottom:6px}
  #tg-mobile .tm-h1{font-family:var(--fd);font-weight:400;font-size:clamp(2.8rem,16vw,4.6rem);line-height:.9;
    letter-spacing:.01em;text-transform:uppercase;color:var(--t1)}
  #tg-mobile .tm-lead{color:var(--t2);font-size:1.05rem;line-height:1.62;margin-top:14px}

  /* retro window */
  #tg-mobile .win{background:var(--face);box-shadow:var(--raise);margin-top:26px}
  #tg-mobile .win-tb{display:flex;align-items:center;gap:9px;padding:8px 10px}
  #tg-mobile .win-tb .sq{width:13px;height:13px;flex:0 0 auto;background:var(--accent);box-shadow:var(--raise)}
  #tg-mobile .win-tb .tt{flex:1;min-width:0;font-family:var(--fl);font-size:1rem;letter-spacing:.1em;
    text-transform:uppercase;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #tg-mobile .win-tb .ctl{display:flex;gap:5px;flex:0 0 auto}
  #tg-mobile .win-tb .ctl i{width:20px;height:16px;background:var(--face);box-shadow:var(--raise);
    display:flex;align-items:center;justify-content:center;font-family:var(--fl);font-size:.82rem;font-style:normal;color:var(--t1)}
  #tg-mobile .win-body{background:var(--well);box-shadow:var(--sink);margin:0 6px 6px;padding:clamp(14px,4vw,20px)}

  /* contents list */
  #tg-mobile .tm-unit{display:flex;gap:13px;align-items:baseline;padding:11px 2px;border-bottom:1px solid var(--ln)}
  #tg-mobile .tm-unit:last-child{border-bottom:0}
  #tg-mobile .tm-unit .n{flex:0 0 auto;min-width:22px;font-family:var(--fl);font-size:.9rem;color:var(--accent)}
  #tg-mobile .tm-unit .l{color:var(--t1);font-size:1.02rem;line-height:1.4}

  /* open-on-desktop */
  #tg-mobile .tm-desk p{color:var(--t2);font-size:1.04rem;line-height:1.62}
  #tg-mobile .tm-desk .why{margin-top:12px;font-family:var(--fl);font-size:.95rem;letter-spacing:.04em;
    text-transform:uppercase;color:var(--accent)}

  /* footer — identical to the rest of the site */
  #tg-mobile footer{padding:24px;text-align:center;font-family:var(--fl);font-size:.9rem;letter-spacing:.08em;
    text-transform:uppercase;color:var(--t3);border-top:1px solid var(--ln);margin-top:32px}
}
