/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ---------- Theme tokens ---------- */
:root {
  --bg: #fafafa;
  --bg-dot: rgba(0, 0, 0, 0.08);
  --bg-stripe: rgba(0, 0, 0, 0.05);
  --spotlight: rgba(120, 170, 255, 0.16);
  --bg-glow:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(140, 180, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f6f7fa 100%);
  --fg: #1c1c1c;
  --fg-muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.10);
  --chip-bg: rgba(255, 255, 255, 0.65);
  --header-bg: rgba(250, 250, 250, 0.72);
  --card-hover-bg: rgba(0, 0, 0, 0.03);
  --card-hover-border: rgba(0, 0, 0, 0.22);
  --card-hover-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-dot: rgba(255, 255, 255, 0.10);
  --bg-stripe: rgba(255, 255, 255, 0.06);
  --spotlight: rgba(120, 170, 255, 0.12);
  --bg-glow:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(80, 120, 255, 0.14), transparent 60%),
    linear-gradient(180deg, #0d0d10 0%, #0b0b0d 100%);
  --fg: #ededed;
  --fg-muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --header-bg: rgba(11, 11, 13, 0.68);
  --card-hover-bg: rgba(255, 255, 255, 0.06);
  --card-hover-border: rgba(255, 255, 255, 0.18);
  --card-hover-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- Body ---------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(
      300px circle at var(--mx, 50%) var(--my, -200px),
      var(--spotlight),
      transparent 65%
    ),
    var(--bg-glow);
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1.2px);
  background-size: 32px 32px;
  background-position: 0 0;
}

body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  width: 200px;
  height: 160px;
  top: 88px;
  right: 24px;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--bg-stripe) 0,
    var(--bg-stripe) 1px,
    transparent 1px,
    transparent 9px
  );
  -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(135deg, #000 0%, transparent 75%);
  opacity: 0.9;
  font-family:
    -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 6px 24px -18px rgba(0, 0, 0, 0.45);
}

.site-header-inner {
  max-width: min(720px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--fg);
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--fg);
}

.brand-name {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  font-size: 15px;
  color: var(--fg-muted);
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--fg); }

.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--fg-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover { color: var(--fg); background: var(--border); }

.theme-toggle .icon { width: 18px; height: 18px; }

.lang-toggle {
  width: auto;
  min-width: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

:root[data-theme="light"] .theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

/* ---------- Container ---------- */
.container {
  flex: 1;
  width: 100%;
  max-width: min(720px, 92vw);
  margin: 0 auto;
  padding: 72px 0 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 64px - 80px);
}

.container.is-flow {
  justify-content: flex-start;
  min-height: 0;
  padding-top: 64px;
}

/* ---------- Hero ---------- */
.hero { margin-bottom: 32px; }

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.sparkle { margin-right: 6px; }

.name { color: var(--fg); }

.hero-subtitle {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-subtitle .sep {
  color: var(--fg-muted);
  margin: 0 8px;
  font-weight: 400;
}

.hero-desc {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.7;
}

.lead {
  margin: 0 0 28px;
  color: var(--fg-muted);
  font-size: 16px;
}

.stack-line {
  margin: 0 0 18px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.stack-label {
  color: var(--fg);
  font-weight: 600;
  margin-right: 2px;
}

.stack-suffix { color: var(--fg-muted); }

/* ---------- Chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--brand, var(--fg));
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--brand, var(--fg));
}

.chip .logo {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chip span:last-child {
  color: var(--fg);
}

/* ---------- Page links ---------- */
.page-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}

@media (max-width: 520px) {
  .page-links { grid-template-columns: 1fr; }
}

.page-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--fg);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

/* Spotlight glow following the cursor */
.page-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    180px circle at var(--mx, -200px) var(--my, -200px),
    rgba(140, 180, 255, 0.22),
    rgba(140, 180, 255, 0.06) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 0;
}

/* Gradient border that lights up on hover */
.page-link::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    200px circle at var(--mx, -200px) var(--my, -200px),
    rgba(140, 180, 255, 0.55),
    transparent 70%
  );
  -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 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

:root[data-theme="dark"] .page-link::before {
  background: radial-gradient(
    200px circle at var(--mx, -200px) var(--my, -200px),
    rgba(120, 170, 255, 0.18),
    rgba(120, 170, 255, 0.04) 40%,
    transparent 70%
  );
}

:root[data-theme="dark"] .page-link::after {
  background: radial-gradient(
    220px circle at var(--mx, -200px) var(--my, -200px),
    rgba(140, 190, 255, 0.6),
    transparent 70%
  );
}

.page-link > * { position: relative; z-index: 2; }

.page-link:hover {
  transform: translateY(-3px);
  border-color: transparent;
  background: var(--card-hover-bg);
  box-shadow: var(--card-hover-shadow);
}

.page-link:hover::before,
.page-link:hover::after { opacity: 1; }

.page-link:active {
  transform: translateY(-1px);
  transition-duration: 0.05s;
}

.page-link-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.page-link-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-link-arrow {
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.page-link:hover .page-link-arrow {
  color: var(--fg);
}

.page-link[target="_blank"]:hover .page-link-arrow {
  transform: translate(2px, -2px);
}

.page-link:not([target="_blank"]):hover .page-link-arrow {
  transform: translateX(3px);
}

/* ---------- Status indicator ---------- */
.page-link--wide {
  grid-column: 1 / -1;
}

.status-text {
  margin-left: auto;
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.page-link--wide .page-link-title {
  flex: 0 0 auto;
}

.status-text[data-status="up"]      { color: var(--fg); }
.status-text[data-status="partial"] { color: #d97706; }
.status-text[data-status="down"]    { color: #ef4444; }

:root[data-theme="dark"] .status-text[data-status="partial"] { color: #fbbf24; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-muted);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-dot[data-status="up"] {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.status-dot[data-status="partial"] {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.status-dot[data-status="down"] {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  animation: status-pulse 1.6s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.10); }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 24px 0 32px;
  text-align: center;
  color: var(--fg-muted);
  font-style: italic;
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .site-header-inner { height: 56px; }
  .brand-name { font-size: 15px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 14px; }
  .container { padding: 48px 0 40px; min-height: calc(100vh - 56px - 80px); }
  .container.is-flow { padding-top: 48px; }
  .hero { margin-bottom: 36px; }
  .hero-title { line-height: 1.5; }
  .hero-subtitle .sep { margin: 0 6px; }
  .hero-desc { font-size: 14px; }
}
