/* HermesAgent Study theme overrides.
   Loaded AFTER the Astro/Tailwind bundle so rules here take precedence.
   Brand palette matches original hermes101.dev (neon-green on near-black).
   Fonts use system stack — no web-font download for fast CN rendering. */

:root {
  --brand: #18E299;
  --brand-light: #51ffb4;
  --brand-deep: #003823;
  --text-muted: #bacbbe;
  --hermes-bg: #0A0A0F;
  --hermes-bg-soft: #131318;
  --hermes-bg-surface: #1b1b20;
  --hermes-bg-code: #0E0E13;
}

/* System font stack — no external font download. Instant render on CN networks. */
html, body {
  background: var(--hermes-bg) !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
               "Noto Sans SC", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono, [class*="font-mono"] {
  font-family: ui-monospace, "SF Mono", "Menlo", "Cascadia Code",
               "JetBrains Mono", "Source Code Pro", Consolas, "Liberation Mono", monospace !important;
}

/* ——— Button fallbacks (existing .cta-primary class) ——— */
.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--brand);
  color: var(--brand-deep);
  border-radius: 9999px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 10px 30px rgba(24, 226, 153, 0.18);
}
.cta-primary:hover { background: var(--brand-light); transform: translateY(-1px); box-shadow: 0 14px 38px rgba(24, 226, 153, 0.28); }
.cta-primary:active { transform: translateY(0); }

/* Terminal glow */
.terminal-glow {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 20px 60px rgba(24, 226, 153, 0.06),
              0 40px 120px rgba(24, 226, 153, 0.04);
}

.feature-card-glow:hover {
  border-color: rgba(24, 226, 153, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(24, 226, 153, 0.18), 0 18px 44px rgba(24, 226, 153, 0.07);
}

main a:hover { text-decoration-thickness: 1.5px; text-underline-offset: 0.12em; }

/* ——————————————————————————————————————————————————————————————
   Community Float Widget
   —————————————————————————————————————————————————————————————— */

.hermes-community-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 54px;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(81, 255, 180, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(24, 226, 153, 0.16), rgba(24, 226, 153, 0.08)),
    rgba(10, 10, 15, 0.94);
  color: var(--brand);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.4),
              inset 0 0 0 1px rgba(81, 255, 180, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  user-select: none;
}
.hermes-community-float:hover {
  transform: translateY(-2px);
  border-color: rgba(81, 255, 180, 0.6);
  background:
    linear-gradient(180deg, rgba(24, 226, 153, 0.22), rgba(24, 226, 153, 0.12)),
    rgba(15, 15, 20, 0.96);
}
.hermes-community-float .cf-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(24, 226, 153, 0.14);
  font-size: 1.05rem;
}

.hermes-community-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 61;
  width: min(310px, calc(100vw - 1.5rem));
  padding: 1rem;
  border: 1px solid rgba(81, 255, 180, 0.32);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(81, 255, 180, 0.1), transparent 11rem),
    linear-gradient(180deg, rgba(15, 15, 20, 0.98), rgba(10, 10, 15, 0.98));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5),
              inset 0 0 0 1px rgba(81, 255, 180, 0.06);
  color: var(--text-muted);
  font-family: inherit;
}
.hermes-community-widget[hidden] { display: none; }
.hermes-community-widget .cw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.hermes-community-widget h3 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.hermes-community-widget .cw-close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 20, 25, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 160ms ease, background 160ms ease;
}
.hermes-community-widget .cw-close:hover { border-color: var(--brand); }
.hermes-community-widget .cw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0.75rem;
}
.hermes-community-widget .cw-tab {
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 140ms ease;
}
.hermes-community-widget .cw-tab[aria-selected="true"] {
  background: rgba(24, 226, 153, 0.12);
  border-color: var(--brand);
  color: var(--brand);
}
.hermes-community-widget .cw-tab:hover { color: #fff; }
.hermes-community-widget .cw-qr {
  width: min(100%, 230px);
  display: block;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: white;
}
.hermes-community-widget .cw-desc {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  text-align: center;
}

/* ——— Community page layout helpers ——— */
.community-card {
  background: var(--hermes-bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.community-card:hover {
  border-color: rgba(24, 226, 153, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(24, 226, 153, 0.08);
}
.community-card img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: white;
}
