/* Custom site styles — extends Tailwind */

body {
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC",
               "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────── Hero（aurora 漸層） ─────────────── */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(99, 102, 241, .35), transparent),
    #0f172a;
}
.hero-blob {
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
  animation: blob-float 16s ease-in-out infinite;
}
.hero-blob-1 { background: #6366f1; top: -160px; left: -100px; }
.hero-blob-2 { background: #a855f7; top: 20%; right: -140px; animation-delay: -5s; }
.hero-blob-3 { background: #0ea5e9; bottom: -220px; left: 30%; animation-delay: -10s; opacity: .35; }
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 25px) scale(.95); }
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}
.grad-text {
  background: linear-gradient(120deg, #818cf8, #e879f9, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .7);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.stat-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: 1.1rem .75rem;
  transition: all .25s ease;
}
.stat-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

/* ─────────────── 精選專案卡 ─────────────── */
.featured-card {
  transition: all .25s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -16px rgba(15, 23, 42, .25);
  border-color: #c7d2fe;
}
.cover-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 85% 10%, rgba(255,255,255,.28), transparent 60%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px);
  pointer-events: none;
}

/* ─────────────── 進場動畫 ─────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-blob { animation: none; }
}

/* ─────────────── more-card（深色區塊連結卡） ─────────────── */
.more-card {
  display: block;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all .2s ease;
}
.more-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

/* 語言色點 */
.lang-dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: #94a3b8;
}
.lang-dot.lang-Python     { background: #3776ab; }
.lang-dot.lang-JavaScript { background: #f1c40f; }
.lang-dot.lang-TypeScript { background: #3178c6; }
.lang-dot.lang-HTML       { background: #e34f26; }
.lang-dot.lang-Shell      { background: #89e051; }

/* Article card hover */
.article-card {
  transition: all .2s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.15);
}

/* Tag pill */
.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 9999px;
  margin: 0.125rem;
}

/* Repo badge colors */
.lang-Python  { background: #3776ab; color: white; }
.lang-Cpp,
.lang-C\+\+   { background: #00599c; color: white; }
.lang-JavaScript { background: #f7df1e; color: #000; }
.lang-TypeScript { background: #3178c6; color: white; }
.lang-HTML    { background: #e34f26; color: white; }
.lang-Kotlin  { background: #7f52ff; color: white; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Strip WP-rendered HTML excerpts cleanly */
.wp-excerpt p {
  display: inline;
}
.wp-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Filter tag active state */
.filter-tag {
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.filter-tag.active {
  background: #4f46e5;
  color: white;
}

/* ═══════════ 現代化潤飾 (v2) ═══════════ */
/* 流動漸層標題 */
.grad-text{ background-size:200% auto; animation:grad-shift 6s linear infinite; }
@keyframes grad-shift{ to{ background-position:200% center; } }

/* 漸層發光主 CTA */
.btn-glow{
  background:linear-gradient(120deg,#6366f1,#a855f7,#0ea5e9);
  background-size:180% auto;
  box-shadow:0 8px 28px -6px rgba(124,77,255,.6);
  animation:grad-shift 5s linear infinite;
}
.btn-glow:hover{ box-shadow:0 14px 40px -6px rgba(124,77,255,.85); }

/* 技術跑馬燈 */
.marquee{ overflow:hidden; }
.marquee-track{ display:flex; gap:2.4rem; width:max-content; animation:marquee 32s linear infinite; padding:.8rem 0; }
.marquee:hover .marquee-track{ animation-play-state:paused; }
.marquee-track span{ display:inline-flex; align-items:center; gap:.5rem; white-space:nowrap;
  color:#475569; font-weight:600; font-size:.88rem; }
.marquee-track span::before{ content:'◆'; color:#a5b4fc; font-size:.55rem; }
@keyframes marquee{ to{ transform:translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .marquee-track{ animation:none; } .grad-text,.btn-glow{ animation:none; } }

/* 精選卡懸停漸層描邊 */
.featured-card{ position:relative; }
.featured-card::after{
  content:''; position:absolute; inset:0; border-radius:1rem; padding:1.5px;
  background:linear-gradient(120deg,#818cf8,#e879f9,#38bdf8);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  opacity:0; transition:opacity .25s; pointer-events:none;
}
.featured-card:hover::after{ opacity:.9; }

/* ═══════════ 雜誌式作品佈局 ═══════════ */
.serif{ font-family:"Noto Serif TC",serif; }
.mag-num{ font-family:"Noto Serif TC",serif; font-weight:900; line-height:1; color:rgba(255,255,255,.85); }
.mag-card{ position:relative; overflow:hidden; border-radius:18px; display:block; text-decoration:none; }
.mag-card .mag-ph{ position:absolute; inset:0; transition:transform .5s ease; }
.mag-card:hover .mag-ph{ transform:scale(1.05); }
.mag-card .mag-ov{ position:absolute; inset:0;
  background:linear-gradient(to top,rgba(15,23,42,.93),rgba(15,23,42,.12) 55%,transparent),
             linear-gradient(to bottom,rgba(11,16,32,.55),transparent 28%); }
.mag-num,.mag-kicker{ text-shadow:0 1px 6px rgba(0,0,0,.5); }
.mag-card .mag-body{ position:absolute; inset:0; display:flex; flex-direction:column; justify-content:space-between; }
.mag-kicker{ font-size:12px; letter-spacing:.16em; text-transform:uppercase; font-weight:700; }
.mag-card:hover .mag-title{ text-decoration:underline; text-underline-offset:3px; }
