/* AI 演算法課程 — William Ngo Labs (ai.willngo.com) */
:root {
  --bg: #050806;
  --bg-2: #08100b;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(158, 255, 87, 0.14);
  --line-2: rgba(255, 255, 255, 0.08);
  --lime: #9eff57;
  --lime-2: #c3ff86;
  --gold: #C9A96B;
  --text: #eef6ee;
  --muted: #9db19e;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Space Grotesk", "Noto Sans TC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--text); line-height: 1.7;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(158, 255, 87, .12), transparent 60%),
    radial-gradient(700px 500px at -10% 40%, rgba(77, 255, 196, .06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
willngo-labs-bar { display: block; min-height: 44px; background: #04090c; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--lime-2); }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(158, 255, 87, .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(158, 255, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(158, 255, 87, 0); } }

/* hero */
.hero { position: relative; padding: clamp(72px, 10vw, 140px) 0 clamp(64px, 8vw, 110px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 70%); mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 70%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { margin-top: 28px; font-weight: 900; font-size: clamp(44px, 7vw, 96px); line-height: 1.1; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--lime); text-shadow: 0 0 40px rgba(158, 255, 87, .35); }
.lead { margin-top: 28px; font-size: clamp(16px, 1.4vw, 19px); color: #d3e2d4; line-height: 1.9; }
.actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: transform .5s var(--ease), background .3s, box-shadow .4s, border-color .3s; }
.btn svg { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--lime { background: var(--lime); color: #071006; box-shadow: 0 10px 40px -10px rgba(158, 255, 87, .6); }
.btn--lime:hover { box-shadow: 0 16px 50px -10px rgba(158, 255, 87, .8); transform: translateY(-2px); }
.btn--ghost { border: 1px solid rgba(255, 255, 255, .2); }
.btn--ghost:hover { border-color: var(--lime); color: var(--lime-2); }
.stats { margin-top: 52px; display: flex; gap: clamp(24px, 4vw, 56px); padding-top: 28px; border-top: 1px solid var(--line-2); }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 4vw, 54px); line-height: 1; color: #fff; }
.stats dd { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.net svg { width: 100%; height: auto; display: block; overflow: visible; }
.net .edges line { stroke: rgba(158, 255, 87, .1); stroke-width: 1; }
.net .pulses line { stroke: var(--lime); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 9 100; stroke-dashoffset: 9; animation: flow 3.2s linear infinite; animation-delay: var(--d); filter: drop-shadow(0 0 4px rgba(158, 255, 87, .8)); }
@keyframes flow { to { stroke-dashoffset: -100; } }
.net .nodes circle { fill: #07110a; stroke: rgba(195, 255, 134, .55); stroke-width: 1.4; }
.net .nodes circle.o { fill: var(--lime); stroke: var(--lime-2); animation: glow 2.6s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(158, 255, 87, .9)); }
@keyframes glow { 50% { opacity: .55; } }

/* course map */
.map { position: sticky; top: 0; z-index: 20; background: rgba(5, 8, 6, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.map__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; }
.map__progress { font-family: var(--mono); font-size: 12px; color: var(--lime-2); }
.map__route { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px 0 18px; }
.map__route::before { content: ""; position: absolute; left: 6px; right: 6px; top: 21px; height: 1px; background: linear-gradient(90deg, var(--lime), rgba(158, 255, 87, .15)); }
.map__route a { position: relative; display: flex; flex-direction: column; gap: 4px; padding-top: 22px; min-width: 0; transition: color .25s; }
.map__dot { position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1px solid var(--lime); transition: background .3s, box-shadow .3s; }
.map__route a:hover .map__dot { background: var(--lime); box-shadow: 0 0 14px rgba(158, 255, 87, .8); }
.map__route small { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.map__route b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map__route a:hover b { color: var(--lime-2); }

/* chapters */
.chapter { padding: clamp(72px, 9vw, 120px) 0 0; scroll-margin-top: 110px; }
.chapter:last-of-type { padding-bottom: clamp(80px, 10vw, 140px); }
.ch-head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 24px 40px; align-items: end; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.ch-no { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 6vw, 84px); line-height: .85; color: transparent; -webkit-text-stroke: 1px rgba(158, 255, 87, .7); }
.ch-en { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--lime-2); }
.ch-head h2 { margin-top: 6px; font-weight: 900; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.2; }
.ch-desc { color: var(--muted); font-size: 16px; line-height: 1.8; justify-self: end; max-width: 380px; }

.lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lessons[data-count="4"], .lessons[data-count="7"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lesson {
  position: relative; display: flex; flex-direction: column; min-height: 230px; padding: 24px 24px 22px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); overflow: hidden; isolation: isolate;
  transition: transform .6s var(--ease), border-color .35s, background .35s;
}
.lesson::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(500px circle at 100% 0%, rgba(158, 255, 87, .14), transparent 55%); }
.lesson:hover { transform: translateY(-4px); border-color: rgba(158, 255, 87, .45); }
.lesson:hover::before { opacity: 1; }
.lesson__top { display: flex; align-items: center; gap: 8px; }
.lesson__no { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--lime); margin-right: auto; }
.tag, .done { height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag { color: var(--gold); border: 1px solid rgba(201, 169, 107, .45); }
.done { display: none; color: #071006; background: var(--lime-2); font-weight: 700; }
.lesson.is-done .done { display: inline-flex; }
.lesson h3 { margin-top: 22px; font-size: 20px; font-weight: 700; line-height: 1.45; }
.lesson p { margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.75; }
.lesson__foot { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lesson__en { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, .35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--lime-2); white-space: nowrap; }
.go svg { width: 14px; height: 14px; transition: transform .4s var(--ease); }
.lesson:hover .go svg { transform: translateX(4px); }

/* footer */
.foot { border-top: 1px solid var(--line-2); padding: 40px 0 48px; }
.foot__in { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot__brand { font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; font-weight: 600; }
.foot__brand span { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--gold); margin-left: 6px; }
.foot__line { margin-top: 6px; font-size: 13px; color: var(--muted); }
.foot__links { display: flex; gap: 10px; flex-wrap: wrap; }
.foot__links a { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; transition: border-color .3s, color .3s; }
.foot__links a:hover { border-color: var(--gold); color: #E6CF98; }

/* reveal */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; }
  .net { max-width: 520px; }
  .lessons, .lessons[data-count] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-head { grid-template-columns: auto minmax(0, 1fr); }
  .ch-desc { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 720px) {
  .map__route { display: flex; overflow-x: auto; gap: 22px; scrollbar-width: none; padding-right: 20px; }
  .map__route::-webkit-scrollbar { display: none; }
  .map__route a { flex: none; }
  .lessons, .lessons[data-count] { grid-template-columns: 1fr; }
  .lesson { min-height: 0; }
  .net { display: none; }
  .stats { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
