/* =========================================================
   JUCLARITY TECHNOLOGY 雋澄科技 — 網站樣式表
   設計主軸：稽核報告 × 驗證印章。深色系、科技感。
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@500;700;900&family=Noto+Sans+TC:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root{
  --bg:            #0A0D12;
  --bg-panel:      #12161D;
  --bg-panel-2:    #171C25;
  --border:        #232A35;
  --border-soft:   #1A2029;
  --text:          #E7EAEE;
  --text-muted:    #8891A0;
  --text-dim:      #545D6B;
  --accent-scan:   #38BDF8;   /* 掃描 / 監控訊號藍 */
  --accent-alert:  #F0A22E;   /* 警示 / 重點琥珀 */
  --accent-verify: #34D399;   /* 驗證通過 / 印章綠 */
  --radius:        2px;
  --max-w:         1120px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }

body{
  background:var(--bg);
  color:var(--text);
  font-family:'Noto Sans TC', sans-serif;
  font-size:16px;
  line-height:1.75;
  -webkit-font-smoothing:antialiased;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
ul{ list-style:none; }

.mono{ font-family:'JetBrains Mono', monospace; }

h1,h2,h3{
  font-family:'Noto Serif TC', serif;
  font-weight:700;
  letter-spacing:0.01em;
  color:var(--text);
}

.wrap{
  max-width:var(--max-w);
  margin:0 auto;
  padding:0 28px;
}

/* ---------- 背景網格紋理 ---------- */
.grid-bg{
  position:fixed; inset:0; z-index:-1;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size:56px 56px;
  opacity:0.35;
  mask-image:radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

/* ---------- Header ---------- */
.site-header{
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:50;
  background:rgba(10,13,18,0.88);
  backdrop-filter:blur(8px);
}
.site-header .wrap{
  display:flex; align-items:center; justify-content:space-between;
  height:76px;
}
.logo{ display:flex; align-items:center; gap:12px; }
.logo-mark{ width:34px; height:34px; flex-shrink:0; }
.logo-text{ display:flex; flex-direction:column; line-height:1.15; }
.logo-text .zh{ font-family:'Noto Serif TC', serif; font-weight:700; font-size:17px; }
.logo-text .en{
  font-family:'JetBrains Mono', monospace; font-size:10px;
  letter-spacing:0.18em; color:var(--text-muted);
}

.main-nav{ display:flex; gap:32px; align-items:center; }
.main-nav a{
  font-size:14px; color:var(--text-muted);
  position:relative; padding:6px 0;
  transition:color .2s ease;
}
.main-nav a:hover, .main-nav a.active{ color:var(--text); }
.main-nav a.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-2px; height:1px;
  background:var(--accent-scan);
}
.nav-status{
  display:flex; align-items:center; gap:8px;
  font-family:'JetBrains Mono', monospace; font-size:11px;
  color:var(--accent-verify); letter-spacing:0.06em;
}
.nav-status .dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--accent-verify);
  box-shadow:0 0 0 0 rgba(52,211,153,.6);
  animation:pulse 2.4s infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(52,211,153,.5); }
  70%{ box-shadow:0 0 0 6px rgba(52,211,153,0); }
  100%{ box-shadow:0 0 0 0 rgba(52,211,153,0); }
}

/* ---------- Hero ---------- */
.hero{
  padding:88px 0 64px;
  border-bottom:1px solid var(--border);
}
.hero-eyebrow{
  display:inline-flex; align-items:center; gap:10px;
  font-family:'JetBrains Mono', monospace; font-size:12px;
  letter-spacing:0.12em; color:var(--accent-scan);
  border:1px solid var(--border); padding:6px 12px;
  margin-bottom:28px;
}
.hero-eyebrow::before{ content:"//"; color:var(--text-dim); }
.hero h1{
  font-size:clamp(32px, 5vw, 52px);
  line-height:1.35;
  max-width:14ch;
  margin-bottom:22px;
}
.hero h1 em{
  font-style:normal; color:var(--accent-scan);
}
.hero p.lede{
  font-size:17px; color:var(--text-muted);
  max-width:52ch; margin-bottom:36px;
}
.hero-actions{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:56px; }

.btn{
  display:inline-flex; align-items:center; gap:8px;
  font-size:14px; padding:13px 22px;
  border:1px solid var(--border); border-radius:var(--radius);
  transition:border-color .2s ease, background .2s ease;
}
.btn-primary{
  background:var(--accent-scan); color:#04121B; font-weight:700; border-color:var(--accent-scan);
}
.btn-primary:hover{ background:#5CCCFA; }
.btn-ghost:hover{ border-color:var(--text-muted); }

/* ---------- Terminal / status panel（簽名元素）---------- */
.term-panel{
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  max-width:640px;
}
.term-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; border-bottom:1px solid var(--border);
  font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-dim);
}
.term-body{ padding:18px 20px; font-family:'JetBrains Mono', monospace; font-size:13px; }
.term-line{
  display:flex; justify-content:space-between; gap:16px;
  padding:6px 0; color:var(--text-muted);
  border-bottom:1px dashed var(--border-soft);
}
.term-line:last-child{ border-bottom:none; }
.term-line .k{ color:var(--text); }
.term-line .v{ display:flex; align-items:center; gap:6px; }
.status-ok{ color:var(--accent-verify); }
.status-scan{ color:var(--accent-scan); }
.scan-cursor{
  display:inline-block; width:6px; height:12px; background:var(--accent-scan);
  animation:blink 1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

/* ---------- Section 共用 ---------- */
section{ padding:72px 0; border-bottom:1px solid var(--border); }
section:last-of-type{ border-bottom:none; }
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:24px; margin-bottom:40px; flex-wrap:wrap;
}
.section-head .tag{
  font-family:'JetBrains Mono', monospace; font-size:12px;
  letter-spacing:0.14em; color:var(--accent-alert);
  display:block; margin-bottom:10px;
}
.section-head h2{ font-size:clamp(22px,3vw,30px); }
.section-head .desc{ color:var(--text-muted); font-size:14px; max-width:40ch; }

/* ---------- 三欄服務卡 ---------- */
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--border); border:1px solid var(--border); }
.card{ background:var(--bg-panel); padding:30px 26px; }
.card .idx{ font-family:'JetBrains Mono', monospace; font-size:12px; color:var(--text-dim); display:block; margin-bottom:16px; }
.card h3{ font-size:17px; margin-bottom:10px; font-family:'Noto Sans TC',sans-serif; font-weight:700; }
.card p{ font-size:14px; color:var(--text-muted); }

@media (max-width:820px){ .grid-3{ grid-template-columns:1fr; } }

/* ---------- 印章 / 認證徽章 ---------- */
.seal-row{ display:flex; gap:28px; flex-wrap:wrap; }
.seal{
  display:flex; align-items:center; gap:18px;
  border:1px solid var(--border); padding:20px 24px;
  background:var(--bg-panel); min-width:280px; flex:1;
}
.seal-badge{
  width:64px; height:64px; flex-shrink:0;
  border:2px solid var(--accent-verify); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  position:relative;
}
.seal-badge::before{
  content:""; position:absolute; inset:5px;
  border:1px dashed var(--accent-verify); border-radius:50%; opacity:.5;
}
.seal-badge .mono{ font-size:11px; color:var(--accent-verify); font-weight:700; letter-spacing:.03em; }
.seal-info .title{ font-weight:700; font-size:15px; margin-bottom:4px; }
.seal-info .sub{ font-size:12.5px; color:var(--text-muted); font-family:'JetBrains Mono', monospace; }

/* ---------- 專業領域清單 ---------- */
.expertise-list{ display:grid; grid-template-columns:1fr 1fr; gap:0 40px; }
.expertise-list li{
  display:flex; gap:14px; padding:16px 0; border-bottom:1px solid var(--border-soft);
  font-size:14.5px; color:var(--text-muted);
}
.expertise-list li::before{ content:"◆"; color:var(--accent-scan); font-size:10px; margin-top:5px; }
.expertise-list li b{ color:var(--text); font-weight:700; display:block; margin-bottom:2px; }
@media (max-width:720px){ .expertise-list{ grid-template-columns:1fr; } }

/* ---------- 內文區塊 ---------- */
.prose{ max-width:68ch; }
.prose p{ margin-bottom:18px; color:var(--text-muted); font-size:15.5px; }
.prose p.lead{ color:var(--text); font-size:17px; }

/* ---------- Blog 卡片 ---------- */
.post-grid{ display:grid; grid-template-columns:1fr; gap:1px; background:var(--border); border:1px solid var(--border); }
.post-card{
  background:var(--bg-panel); padding:28px 30px;
  display:grid; grid-template-columns:140px 1fr; gap:24px; align-items:start;
  transition:background .2s ease;
}
.post-card.is-link:hover{ background:var(--bg-panel-2); }
.post-card .meta{ font-family:'JetBrains Mono', monospace; font-size:12px; color:var(--text-dim); }
.post-card .meta .date{ display:block; margin-bottom:8px; color:var(--accent-scan); }
.post-card h3{ font-size:18px; margin-bottom:8px; font-family:'Noto Sans TC',sans-serif; font-weight:700; }
.post-card p{ font-size:14px; color:var(--text-muted); }
.post-tag{
  display:inline-block; font-family:'JetBrains Mono', monospace; font-size:10.5px;
  border:1px solid var(--border); color:var(--text-muted); padding:2px 8px; margin-top:12px;
  letter-spacing:.04em;
}
.post-card.placeholder{ opacity:0.55; }
.post-card.placeholder h3::after{
  content:"草稿中"; font-size:11px; font-family:'JetBrains Mono',monospace;
  color:var(--accent-alert); border:1px solid var(--accent-alert);
  padding:1px 8px; margin-left:10px; vertical-align:middle;
}
@media (max-width:640px){ .post-card{ grid-template-columns:1fr; } }

/* ---------- 文章內頁 ---------- */
.post-header{ padding:64px 0 40px; border-bottom:1px solid var(--border); }
.post-header .meta{ font-family:'JetBrains Mono', monospace; font-size:12px; color:var(--accent-scan); margin-bottom:18px; }
.post-header h1{ font-size:clamp(26px,4vw,38px); line-height:1.4; margin-bottom:20px; max-width:20ch; }
.post-header .sub{ color:var(--text-muted); font-size:15px; max-width:60ch; }
.post-body{ padding:56px 0; }
.post-body h2{ font-size:20px; margin:40px 0 16px; }
.post-body ul{ margin:0 0 20px 0; }
.post-body ul li{ color:var(--text-muted); font-size:15px; padding:5px 0 5px 20px; position:relative; }
.post-body ul li::before{ content:"—"; position:absolute; left:0; color:var(--accent-scan); }
.callout{
  border-left:2px solid var(--accent-alert); background:var(--bg-panel);
  padding:18px 22px; margin:28px 0; font-size:14.5px; color:var(--text-muted);
}
.callout b{ color:var(--accent-alert); }

/* ---------- CTA ---------- */
.cta{
  background:var(--bg-panel); border:1px solid var(--border);
  padding:48px; display:flex; align-items:center; justify-content:space-between;
  gap:24px; flex-wrap:wrap;
}
.cta h2{ font-size:22px; margin-bottom:8px; }
.cta p{ color:var(--text-muted); font-size:14px; }

/* ---------- Footer ---------- */
.site-footer{ padding:48px 0 40px; }
.footer-grid{
  display:grid; grid-template-columns:2fr 1fr 1fr; gap:40px;
  padding-bottom:36px; border-bottom:1px solid var(--border); margin-bottom:24px;
}
.footer-grid h4{
  font-family:'JetBrains Mono', monospace; font-size:11px; letter-spacing:.1em;
  color:var(--text-dim); margin-bottom:16px;
}
.footer-grid p, .footer-grid li{ font-size:13.5px; color:var(--text-muted); margin-bottom:8px; }
.footer-grid a:hover{ color:var(--accent-scan); }
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center;
  font-size:12px; color:var(--text-dim); flex-wrap:wrap; gap:10px;
}
@media (max-width:720px){ .footer-grid{ grid-template-columns:1fr; gap:28px; } }

/* =========================================================
   互動科幻層：雷達掃描、HUD 邊角、游標光暈、發光互動
   ========================================================= */

/* 全站雷達掃描光束（固定、極低透明度，不干擾閱讀） */
.scan-sweep{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:linear-gradient(180deg, transparent 0%, rgba(56,189,248,0.05) 48%, rgba(56,189,248,0.10) 50%, rgba(56,189,248,0.05) 52%, transparent 100%);
  background-size:100% 320%;
  animation:sweep 9s linear infinite;
}
@keyframes sweep{
  0%{ background-position:0 -220%; }
  100%{ background-position:0 220%; }
}

/* 游標光暈：於 hero 區塊內跟隨滑鼠位置（由 JS 更新 --mx/--my） */
.hero{ position:relative; overflow:hidden; }
.hero::before{
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(360px circle at var(--mx,50%) var(--my,20%), rgba(56,189,248,0.10), transparent 70%);
  transition:background .15s ease-out;
}
.hero .wrap{ position:relative; z-index:1; }

/* HUD 邊角框：包住 term-panel，強化「儀表板」感 */
.hud-frame{ position:relative; max-width:640px; }
.hud-frame::before, .hud-frame::after,
.hud-frame .term-panel::before, .hud-frame .term-panel::after{
  content:""; position:absolute; width:14px; height:14px;
  border:1px solid var(--accent-scan); opacity:.8; z-index:2;
}
.hud-frame::before{ top:-6px; left:-6px; border-right:none; border-bottom:none; }
.hud-frame::after{ top:-6px; right:-6px; border-left:none; border-bottom:none; }
.hud-frame .term-panel::before{ bottom:-6px; left:-6px; border-right:none; border-top:none; }
.hud-frame .term-panel::after{ bottom:-6px; right:-6px; border-left:none; border-top:none; }
.hud-frame .term-panel{ position:relative; }

/* 終端機掃描線：面板頂部持續掃過的細線 */
.term-panel{ position:relative; }
.term-panel .sweep-line{
  position:absolute; left:0; right:0; height:2px; top:0;
  background:linear-gradient(90deg, transparent, var(--accent-scan), transparent);
  opacity:.7; animation:term-sweep 3.2s ease-in-out infinite;
}
@keyframes term-sweep{
  0%{ top:0; opacity:0; }
  10%{ opacity:.8; }
  50%{ top:100%; opacity:.8; }
  60%{ opacity:0; }
  100%{ top:100%; opacity:0; }
}

/* term-line 逐行浮現（由 JS 加上 .is-in class 觸發） */
.term-line{ opacity:0; transform:translateY(4px); transition:opacity .5s ease, transform .5s ease; }
.term-line.is-in{ opacity:1; transform:translateY(0); }

/* 標題輕微 glitch 進場（僅一次性，尊重 reduced motion） */
.glitch-in{ animation:glitch-in .6s ease-out both; }
@keyframes glitch-in{
  0%{ opacity:0; text-shadow:2px 0 var(--accent-scan), -2px 0 var(--accent-alert); transform:translateX(-3px); }
  30%{ text-shadow:-1px 0 var(--accent-scan), 1px 0 var(--accent-alert); transform:translateX(2px); }
  60%{ text-shadow:1px 0 var(--accent-scan), -1px 0 var(--accent-alert); transform:translateX(-1px); }
  100%{ opacity:1; text-shadow:none; transform:translateX(0); }
}

/* 卡片 / 印章 / 文章卡：hover 發光互動 */
.card, .seal, .post-card.is-link, .btn, .seal-badge{
  transition:box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.card:hover, .seal:hover{
  border-color:var(--accent-scan);
  box-shadow:inset 0 0 0 1px rgba(56,189,248,0.25), 0 0 24px -8px rgba(56,189,248,0.45);
  transform:translateY(-2px);
}
.post-card.is-link:hover{
  box-shadow:inset 2px 0 0 var(--accent-scan);
}
.btn-primary:hover{ box-shadow:0 0 22px -4px rgba(56,189,248,.65); }
.btn-ghost:hover{ box-shadow:0 0 16px -6px rgba(255,255,255,.15); }

/* 印章徽章：外圍虛線環持續緩慢旋轉，象徵「驗證掃描中」 */
.seal-badge::before{ animation:seal-spin 8s linear infinite; }
@keyframes seal-spin{ to{ transform:rotate(360deg); } }

/* CTA 區塊掃描邊框微光 */
.cta{ position:relative; }
.cta::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  box-shadow:0 0 0 1px transparent;
  transition:box-shadow .3s ease;
}
.cta:hover::before{ box-shadow:0 0 0 1px rgba(56,189,248,0.35), 0 0 30px -10px rgba(56,189,248,.5); }

@media (prefers-reduced-motion: reduce){
  .scan-sweep, .term-panel .sweep-line, .seal-badge::before{ animation:none !important; }
  .term-line{ opacity:1; transform:none; }
}

/* ---------- Responsive nav ---------- */
@media (max-width:760px){
  .main-nav{ gap:18px; }
  .nav-status{ display:none; }
  .hero{ padding:56px 0 40px; }
}
