/* =========================================================
   Hex SMP — site styles
   Brand color: #2E8565 (matches the Hex Helper Minecraft mod)
   Dark minimal theme. All accent / interactive color flows
   through --hex so it stays consistent.
   ========================================================= */

:root {
  --hex: #2E8565;
  --hex-bright: #3FB089;
  --hex-dim: #1F5C46;
  --hex-glow: rgba(46, 133, 101, 0.35);

  --bg: #0c0f0e;
  --bg-2: #111614;
  --bg-3: #161d1a;
  --panel: #141a18;
  --panel-2: #1a221f;
  --border: #232b28;
  --border-strong: #2e3a35;

  --text: #e6ece9;
  --text-dim: #9aa6a1;
  --text-faint: #6b7670;

  --radius: 10px;
  --radius-lg: 14px;

  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--hex-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--hex); }

img { max-width: 100%; display: block; }

/* ---------- layout ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
}

.section-tight {
  padding: 32px 0;
}

/* ---------- navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 15, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav-brand img {
  width: 28px;
  height: 28px;
}

.nav-brand .brand-mark {
  color: var(--hex);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-links a.active {
  color: var(--hex-bright);
  background: rgba(46, 133, 101, 0.12);
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
}

/* ---------- hero ---------- */
.hero {
  padding: 80px 0 56px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at top,
    rgba(46, 133, 101, 0.18) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--hex-bright);
  margin-bottom: 16px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero .accent {
  color: var(--hex-bright);
}

.hero p.lead {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 32px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--hex);
  color: #fff;
  border-color: var(--hex);
}
.btn-primary:hover {
  background: var(--hex-bright);
  border-color: var(--hex-bright);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--panel);
  border-color: var(--hex);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--hex);
  background: var(--panel-2);
  color: var(--text);
}

.card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(46, 133, 101, 0.14);
  color: var(--hex-bright);
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------- generic page content ---------- */
.page-header {
  padding: 56px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.page-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--hex-bright);
  margin-bottom: 10px;
  font-weight: 600;
}

.page-header h1 {
  font-size: clamp(30px, 4vw, 42px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  font-size: 16px;
  color: var(--text-dim);
  max-width: 640px;
}

.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: 22px;
  margin: 36px 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 17px;
  margin: 24px 0 8px;
  font-weight: 600;
  color: var(--text);
}

.prose p, .prose li {
  color: var(--text-dim);
  font-size: 15.5px;
}

.prose ul, .prose ol {
  padding-left: 22px;
}

.prose li { margin-bottom: 6px; }

.prose code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--hex-bright);
}

.prose pre {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.prose blockquote {
  border-left: 3px solid var(--hex);
  margin: 16px 0;
  padding: 4px 16px;
  color: var(--text-dim);
  background: rgba(46, 133, 101, 0.06);
  border-radius: 0 8px 8px 0;
}

.callout {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hex);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 15px;
}

.callout strong { color: var(--text); }

/* update entries */
.update-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  background: var(--panel);
}

.update-entry .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.update-entry .tag {
  background: rgba(46, 133, 101, 0.14);
  color: var(--hex-bright);
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
}

.update-entry h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.update-entry p { margin: 0; color: var(--text-dim); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
  color: var(--text-faint);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   ASK HEX — chat widget
   Visual style mirrors the in-game Hex Helper mod:
     - Brand color #2E8565 throughout
     - "Thinking" + cycling spinner glyph in the same green
     - Bot replies prefixed mentally with the same tone
   ========================================================= */

.askhex-launcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--hex);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(46, 133, 101, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  overflow: hidden;
}

.askhex-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow-lg), 0 0 0 6px rgba(46, 133, 101, 0.28);
}

.askhex-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.askhex-launcher .fallback-mark {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.askhex-panel {
  position: fixed;
  bottom: 96px;
  right: 22px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 130px);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform-origin: bottom right;
  animation: askhex-pop 0.18s ease;
}

.askhex-panel.open { display: flex; }

@keyframes askhex-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.askhex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.askhex-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.askhex-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hex-bright);
  box-shadow: 0 0 0 4px var(--hex-glow);
}

.askhex-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
}
.askhex-close:hover { color: var(--text); background: var(--panel-2); }

.askhex-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(46, 133, 101, 0.06), transparent 50%),
    var(--bg-2);
}

.askhex-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.askhex-msg.user {
  align-self: flex-end;
  background: var(--hex);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.askhex-msg.bot {
  align-self: flex-start;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.askhex-msg.bot .prefix {
  display: block;
  font-weight: 700;
  color: var(--hex-bright);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.askhex-msg.error {
  align-self: flex-start;
  background: rgba(180, 60, 60, 0.12);
  border: 1px solid rgba(180, 60, 60, 0.4);
  color: #f0a0a0;
}

/* Thinking indicator — same visual energy as the mod's
   "Hex Helper Thinking <spinner>" message: bold brand-color
   prefix + the word "Thinking" + a cycling glyph that
   advances in fixed time slices. */
.askhex-thinking {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--hex-bright);
  font-size: 14px;
  font-weight: 600;
}

.askhex-thinking .label { color: var(--hex-bright); }

.askhex-thinking .spinner {
  display: inline-block;
  min-width: 12px;
  text-align: center;
  color: var(--hex-bright);
  /* Glyph itself is swapped in JS at FRAME_MS interval to mirror the mod. */
}

.askhex-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.askhex-form {
  display: flex;
  gap: 8px;
}

.askhex-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: none;
  max-height: 96px;
  min-height: 38px;
}

.askhex-input:focus {
  border-color: var(--hex);
  box-shadow: 0 0 0 3px var(--hex-glow);
}

.askhex-send {
  background: var(--hex);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease;
}
.askhex-send:hover { background: var(--hex-bright); }
.askhex-send:disabled {
  background: var(--border-strong);
  color: var(--text-faint);
  cursor: not-allowed;
}

.askhex-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin: 6px 2px 0;
}
