/* ════════════════════════════════════════════════════════════════════
   Binlight Studio 站台樣式

   設計系統直接沿用 Sonarium 宣傳頁的原始設計：
     /Users/mao/sonar/web_public_preview/direction-b-board.html
   色票取自遊戲本體 lib/theme.dart（identity palette，勿改色票）。
   ════════════════════════════════════════════════════════════════════ */
:root{
  --bg:#071624;
  --surface:#0A2033;
  --rule:#1B3A52;
  --accent:#58D5E8;
  --target:#7FE8C8;
  --text:#E6F0F7;
  --muted:#9FB6C6;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,
    "PingFang TC","Hiragino Sans CNS","Noto Sans CJK TC",
    "Microsoft JhengHei",sans-serif;
  font-size:17px; line-height:1.8;
  -webkit-font-smoothing:antialiased;
  overflow-wrap:anywhere;
}
.wrap{max-width:62rem; margin:0 auto; padding:0 1.15rem}
h1,h2,h3{line-height:1.35; font-weight:600}
p{margin:.9rem 0}
strong{color:#FFF; font-weight:600}
a{color:var(--accent)}

/* ---------- 頂列 ---------- */
.topbar{
  position:sticky; top:0; z-index:5;
  background:rgba(7,22,36,.94);
  border-bottom:1px solid var(--rule);
  backdrop-filter:blur(6px);
}
.topbar .wrap{
  padding-top:.35rem; padding-bottom:.35rem;
  display:flex; gap:1.1rem; align-items:center; font-size:.94rem;
}
.topbar .brand{
  color:var(--muted); margin-right:auto; letter-spacing:.04em;
  display:inline-flex; align-items:center; gap:.5rem; text-decoration:none;
}
.topbar .brand img{width:24px; height:24px; display:block}
.topbar .brand b{color:var(--text); font-weight:600; letter-spacing:.1em}
.topbar nav{display:flex; gap:.2rem}
.topbar nav a{
  color:var(--accent); text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; min-width:44px; padding:0 .5rem;
}
.topbar nav a[aria-current]{
  color:var(--text); text-decoration:underline; text-underline-offset:4px;
}
.topbar nav a:hover,.topbar nav a:focus-visible{text-decoration:underline}
section[id]{scroll-margin-top:3.6rem}

/* ---------- Hero ---------- */
.hero{
  display:grid; gap:2.5rem; align-items:center;
  padding:3.5rem 0 3rem; grid-template-columns:1fr;
}
@media (min-width:860px){
  .hero{grid-template-columns:1.05fr .95fr; padding:5rem 0 4rem}
}
.applogo{
  display:block; width:80px; height:80px;
  border-radius:22.37%; border:1px solid var(--rule); margin:0 0 24px;
}
.eyebrow{color:var(--muted); letter-spacing:.16em; font-size:.8rem; margin:0 0 1rem}
.hero h1{font-size:2.15rem; margin:0 0 1rem}
@media (min-width:860px){.hero h1{font-size:2.7rem}}
.hero .lede{color:var(--muted); font-size:1.08rem; margin:0 0 1.8rem}

.cta{
  display:inline-block; padding:.78rem 1.6rem; border-radius:999px;
  background:var(--accent); color:#04121D; font-weight:600;
  text-decoration:none; font-size:1rem;
}
.cta:hover{background:#7FE3F2}
.cta:focus-visible{outline:2px solid var(--text); outline-offset:3px}
.cta-ghost{
  display:inline-block; padding:.78rem 1.6rem; border-radius:999px;
  border:1px solid var(--rule); color:var(--text);
  text-decoration:none; font-weight:600; font-size:1rem;
}
.cta-ghost:hover{border-color:var(--muted)}
.cta-row{display:flex; gap:.7rem; flex-wrap:wrap; align-items:center}
.finep{color:var(--muted); font-size:.88rem; margin:.7rem 0 0}

/* ---------- 純 CSS 聲納盤面（照抄原設計）---------- */
.board{
  --cell:clamp(30px,8.2vw,46px);
  display:grid;
  grid-template-columns:repeat(8,var(--cell));
  grid-template-rows:repeat(8,var(--cell));
  justify-content:center;
  border:1px solid var(--rule); border-radius:10px; overflow:hidden;
  background:rgba(10,32,51,.55); margin:0 auto; position:relative;
}
.board i{
  border-right:1px solid rgba(27,58,82,.85);
  border-bottom:1px solid rgba(27,58,82,.85);
  display:grid; place-items:center;
  font-size:.82rem; font-style:normal; color:var(--accent);
}
.board i.t{background:rgba(127,232,200,.72)}
.board i.n::after{content:attr(data-n)}
.board::after{
  content:""; position:absolute; inset:0; margin:auto;
  width:22%; aspect-ratio:1; border-radius:50%;
  border:1px solid var(--accent); opacity:0;
  animation:ping 5.5s ease-out infinite;
}
@keyframes ping{
  0%{transform:scale(.35); opacity:.55}
  70%{opacity:0}
  100%{transform:scale(3.6); opacity:0}
}
@media (prefers-reduced-motion:reduce){.board::after{animation:none}}

/* ---------- 賣點卡 ---------- */
.section-head{
  font-size:.8rem; letter-spacing:.16em; color:var(--muted); margin:0 0 1.4rem;
}
.cards{display:grid; gap:1rem; margin:0 0 4rem; grid-template-columns:1fr}
@media (min-width:720px){.cards{grid-template-columns:1fr 1fr}}
.card{
  background:var(--surface); border:1px solid var(--rule);
  border-radius:12px; padding:1.3rem 1.25rem;
}
.card h3{font-size:1.06rem; margin:0 0 .4rem; color:var(--accent)}
.card p{margin:0; color:var(--text); font-size:.98rem}

/* ---------- 產品卡（工作室首頁）---------- */
.product{
  display:flex; gap:1.3rem; align-items:flex-start;
  background:var(--surface); border:1px solid var(--rule);
  border-radius:12px; padding:1.5rem; text-decoration:none; color:inherit;
  transition:border-color .15s;
}
.product:hover{border-color:#2A5A78}
.product img{width:72px; height:72px; border-radius:22.37%;
  border:1px solid var(--rule); flex:none}
.product h3{margin:0 0 .3rem; font-size:1.15rem; color:var(--text)}
.product p{margin:0 0 .7rem; color:var(--muted); font-size:.96rem}
.tags{display:flex; gap:.4rem; flex-wrap:wrap}
.tag{font-size:.76rem; color:var(--muted); border:1px solid var(--rule);
  padding:.1rem .6rem; border-radius:999px; line-height:1.9}

/* ---------- 截圖畫廊 ---------- */
.gallery{
  display:flex; gap:1rem; overflow-x:auto; padding:0 1.15rem 1.4rem;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
}
.gallery img{
  flex:0 0 auto; width:min(74vw,290px); height:auto;
  border:1px solid var(--rule); border-radius:16px;
  scroll-snap-align:center;
}
.gallery-note{color:var(--muted); font-size:.86rem; text-align:center; margin:0 0 4rem}

/* ---------- 錢：一行小字，刻意沒有小節標題 ---------- */
.money-note{
  max-width:34rem; margin:0 auto 2.4rem;
  color:var(--muted); font-size:.92rem; text-align:center;
}
.closing{text-align:center; margin:0 0 3rem}
.closing p{font-size:1.3rem; margin:0 0 1.3rem}

/* ---------- 頁尾 ---------- */
.pagefoot{
  border-top:1px solid var(--rule); padding:1.4rem 0 2.5rem;
  color:var(--muted); font-size:.9rem;
}
.pagefoot a{margin-right:1.2rem; display:inline-block}
.pagefoot .copy{margin:.8rem 0 0}

/* ---------- 長文頁 ---------- */
.prose{max-width:42rem; padding:2.5rem 0 1rem}
.prose h1{font-size:1.9rem; margin:0 0 .4rem}
.prose h2{font-size:1.1rem; margin:2.2rem 0 .4rem; color:var(--accent)}
.prose p{color:var(--muted); font-size:.98rem}
.prose ul{color:var(--muted); font-size:.98rem; padding-left:1.2rem}
.prose li{margin:.3rem 0}
.prose .updated{font-size:.86rem; margin:0 0 2rem}
.prose dt{color:var(--text); font-weight:600; margin:1.6rem 0 .2rem}
.prose dd{margin:0; color:var(--muted); font-size:.98rem}

/* ---------- 試玩插槽外框 ---------- */
.demo{margin-bottom:4rem}
#demo-slot{scroll-margin-top:3.6rem}
#demo-slot #sonarium-demo{padding-left:0; padding-right:0}

/* 語言切換與導覽分隔 */
.navsep{
  width:1px; height:16px; background:var(--rule);
  display:inline-block; align-self:center; margin:0 .3rem;
}

/* 頂列在窄螢幕不折行：導覽項與品牌名都是短標籤，折行會讀成兩個詞。 */
.topbar .brand b,
.topbar nav a{white-space:nowrap}
@media (max-width:479px){
  .topbar .wrap{gap:.6rem}
  .topbar .brand b{font-size:12px; letter-spacing:.06em}
  .topbar .brand img{width:22px; height:22px}
  .topbar nav a{padding:0 .3rem; font-size:.9rem; min-width:0}
  .navsep{margin:0 .15rem}
}

/* App Store 徽章。中英兩版的 viewBox 寬度不同（135 vs 119.66），
   所以只給高度、寬度自算——寫死 width 會把英文版拉變形。 */
.badge{display:inline-block; line-height:0}
.badge img{height:52px; width:auto; display:block}
@media (max-width:479px){ .badge img{height:46px} }
