/* launcher.css — หน้า Launchpad ของ project.premier
   สีทั้งหมดอยู่ที่ :root (โหมดสว่าง) + ชุดโหมดมืดด้านล่าง */

@font-face{font-family:'Plex Thai';font-weight:400;font-display:swap;src:url(../fonts/plexthai-400-thai.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:'Plex Thai';font-weight:400;font-display:swap;src:url(../fonts/plexthai-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122}
@font-face{font-family:'Plex Thai';font-weight:500;font-display:swap;src:url(../fonts/plexthai-500-thai.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:'Plex Thai';font-weight:500;font-display:swap;src:url(../fonts/plexthai-500-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122}
@font-face{font-family:'Plex Thai';font-weight:600;font-display:swap;src:url(../fonts/plexthai-600-thai.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:'Plex Thai';font-weight:600;font-display:swap;src:url(../fonts/plexthai-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122}
@font-face{font-family:'Plex Thai';font-weight:700;font-display:swap;src:url(../fonts/plexthai-700-thai.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:'Plex Thai';font-weight:700;font-display:swap;src:url(../fonts/plexthai-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122}

:root{
  color-scheme: light;
  --bg: #F1F3F6;
  --bg-glow: #FFFFFF;
  --ink: #1F2328;
  --ink-2: #5F6670;
  --ink-3: #8A919B;
  --glass: rgba(255,255,255,.62);
  --glass-line: rgba(255,255,255,.9);
  --tile-rim: #FFFFFF;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 24px -8px rgba(16,24,40,.18);
  --shadow-hi: 0 2px 4px rgba(16,24,40,.08), 0 22px 40px -12px rgba(16,24,40,.28);
  --focus: #1A73E8;
  --tile: clamp(96px, 22vw, 132px);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --bg: #0F1217;
    --bg-glow: #1A2030;
    --ink: #E8EAED;
    --ink-2: #A9B0BA;
    --ink-3: #79818C;
    --glass: rgba(26,31,41,.6);
    --glass-line: rgba(255,255,255,.08);
    --tile-rim: #2A303B;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 26px -8px rgba(0,0,0,.6);
    --shadow-hi: 0 2px 4px rgba(0,0,0,.5), 0 24px 44px -12px rgba(0,0,0,.75);
    --focus: #8AB4F8;
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --bg: #0F1217; --bg-glow: #1A2030; --ink: #E8EAED; --ink-2: #A9B0BA; --ink-3: #79818C;
  --glass: rgba(26,31,41,.6); --glass-line: rgba(255,255,255,.08); --tile-rim: #2A303B;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 26px -8px rgba(0,0,0,.6);
  --shadow-hi: 0 2px 4px rgba(0,0,0,.5), 0 24px 44px -12px rgba(0,0,0,.75);
  --focus: #8AB4F8;
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Plex Thai','IBM Plex Sans Thai','Segoe UI',Tahoma,sans-serif;
  color:var(--ink);
  background:radial-gradient(1200px 700px at 50% 45%, var(--bg-glow), var(--bg) 70%) fixed, var(--bg);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
#bg{position:fixed;inset:0;z-index:0;pointer-events:none}

.page{
  position:relative;z-index:1;
  min-height:100dvh;
  display:grid;
  grid-template-rows:auto 1fr auto;
  padding:0 16px;
}

/* ---------- แถบหัว ---------- */
.top{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  max-width:1120px;width:100%;margin:0 auto;padding:20px 0;
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}
.brand img{
  width:48px;height:48px;border-radius:12px;display:block;
  box-shadow:var(--shadow);
}
.brand-name{display:block;font-weight:700;font-size:17px;letter-spacing:.02em;line-height:1.2}
.brand-sub{display:block;font-size:12.5px;color:var(--ink-2);letter-spacing:.04em}
.clock{text-align:right;line-height:1.25}
.clock-t{display:block;font-weight:600;font-size:22px;font-variant-numeric:tabular-nums}
.clock-d{display:block;font-size:12.5px;color:var(--ink-2)}

/* ---------- กลางจอ ---------- */
.main{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 0 48px}
.hero{text-align:center;margin-bottom:clamp(28px,6vh,56px);text-shadow:0 0 12px var(--bg),0 0 4px var(--bg)}
.hero h1{
  margin:0 0 8px;
  font-size:clamp(26px,4.6vw,40px);font-weight:700;letter-spacing:-.01em;line-height:1.25;
}
.hero p{margin:0;color:var(--ink-2);font-size:clamp(14px,2vw,16px)}
.dots{display:inline-flex;gap:6px;margin-bottom:14px}
.dots i{width:8px;height:8px;border-radius:50%;display:block}
.dots i:nth-child(1){background:#4285F4}.dots i:nth-child(2){background:#EA4335}
.dots i:nth-child(3){background:#FBBC05}.dots i:nth-child(4){background:#34A853}

.dock{
  background:var(--glass);
  border:1px solid var(--glass-line);
  border-radius:32px;
  padding:clamp(22px,4vw,36px) clamp(18px,5vw,48px);
  backdrop-filter:blur(18px) saturate(1.4);
  -webkit-backdrop-filter:blur(18px) saturate(1.4);
  box-shadow:var(--shadow);
  max-width:100%;
}
.apps{
  list-style:none;margin:0;padding:0;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(calc(var(--tile) + 24px), 1fr));
  gap:clamp(20px,4vw,44px);
  justify-items:center;
  min-width:min(560px, calc(100vw - 72px));
}

.app{
  display:flex;flex-direction:column;align-items:center;gap:10px;
  width:calc(var(--tile) + 40px);
  text-decoration:none;color:inherit;text-align:center;
  border-radius:24px;padding:6px 4px;
  outline:none;
  animation:pop .6s cubic-bezier(.2,.9,.3,1.25) both;
  animation-delay:calc(.15s + var(--i) * .08s);
}
.tile{
  position:relative;display:grid;place-items:center;
  width:var(--tile);height:var(--tile);
  border-radius:24%;
  background:linear-gradient(160deg, var(--t1), var(--t2));
  box-shadow:
    0 0 0 4px var(--tile-rim),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -6px 14px rgba(0,0,0,.18),
    var(--shadow);
  transition:transform .25s cubic-bezier(.2,.9,.3,1.2), box-shadow .25s ease;
}
.tile::after{ /* ประกายด้านบน */
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 46%);
}
.glyph{width:66%;height:66%;filter:drop-shadow(0 3px 4px rgba(0,0,0,.22))}
.lock{
  position:absolute;right:-6px;top:-6px;
  width:28px;height:28px;border-radius:50%;
  display:grid;place-items:center;
  background:var(--tile-rim);color:var(--ink-2);
  box-shadow:var(--shadow);
}
.lock svg{width:15px;height:15px}
.name{font-weight:600;font-size:15.5px;line-height:1.3}
.desc{font-size:12.5px;color:var(--ink-2);line-height:1.35}

.app[href]:hover .tile,
.app[href]:focus-visible .tile{
  transform:translateY(-6px) scale(1.04);
  box-shadow:
    0 0 0 4px var(--tile-rim),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -6px 14px rgba(0,0,0,.18),
    0 18px 36px -8px color-mix(in srgb, var(--glow) 65%, transparent),
    var(--shadow-hi);
}
.app[href]:active .tile{transform:translateY(-2px) scale(.97)}
.app:focus-visible{box-shadow:0 0 0 3px var(--focus)}
.app.is-soon{opacity:.45;cursor:default}

/* ---------- ท้าย ---------- */
.foot{
  max-width:1120px;width:100%;margin:0 auto;padding:18px 0 22px;
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
  font-size:12.5px;color:var(--ink-3);
}

@keyframes pop{from{opacity:0;transform:translateY(14px) scale(.92)}to{opacity:1;transform:none}}

@media (max-width:560px){
  .top{padding:14px 0}
  .brand img{width:40px;height:40px;border-radius:10px}
  .brand-name{font-size:15px}
  .clock-t{font-size:18px}
  .clock-d{display:none}
  .dock{border-radius:26px}
  .apps{min-width:0;grid-template-columns:repeat(2, 1fr);gap:16px}
  .app{width:auto}
  .foot{justify-content:center;text-align:center}
}

@media (prefers-reduced-motion: reduce){
  .app{animation:none}
  .tile{transition:none}
  .app[href]:hover .tile,.app[href]:focus-visible .tile{transform:none}
}
