/* ─────────────────────────────────────────────────────────────
   MINDSMAN — brand foundation
   Tokens sampled from MINDSMAN_VISUAL_BRAND_BOARD.html
   ───────────────────────────────────────────────────────────── */

:root {
  --navy: #0e1b2d;
  --navy-deep: #08111e;
  --navy-rise: #142336;
  --crimson: #9f2a2a;
  --crimson-bright: #c23a3a;
  --crimson-deep: #6e1c1c;
  --slate: #3e5466;
  --slate-soft: #5a7286;
  --bone: #e8e2d4;
  --bone-dim: rgba(232, 226, 212, 0.62);
  --parchment: #f3ecdc;
  --paper: #faf6ec;
  --gold: #b08a4a;
  --gold-bright: #efc24a; /* brighter, more prominent gold — used for Fire Power */

  --line: rgba(232, 226, 212, 0.08);
  --line-strong: rgba(232, 226, 212, 0.16);

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --decorative: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 18px 50px rgba(4, 9, 17, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Thin, themed scrollbars so the scroll track never reads as a hard
   bar against the navy (Firefox + WebKit/Chromium). */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 226, 212, 0.18) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(232, 226, 212, 0.16);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 226, 212, 0.3);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html {
  background: var(--navy); /* root stays navy so no scrollbar gutter / overscroll ever reads as a stray bar */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--navy);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

a { color: inherit; }

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

button {
  font-family: var(--sans);
  cursor: pointer;
}

input, textarea, select {
  font-family: var(--sans);
  font-size: 16px; /* prevents iOS zoom-on-focus */
}

::selection {
  background: var(--crimson);
  color: var(--paper);
}

/* ── Shared atoms ─────────────────────────────────────────── */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--crimson-bright);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease,
    transform 0.12s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--crimson);
  color: var(--paper);
}
.btn-primary:hover { background: var(--crimson-bright); }

.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--bone-dim); }

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.card {
  background: var(--navy-rise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate-soft);
  margin: 18px 0 8px;
}

.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--navy-deep);
  color: var(--bone);
  outline: none;
  transition: border-color 0.15s ease;
}

.field:focus { border-color: var(--crimson); }

.field::placeholder { color: rgba(232, 226, 212, 0.32); }

.muted { color: var(--bone-dim); }

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.tier-badge.tier-flame { border-color: var(--crimson-deep); color: var(--crimson-bright); }
.tier-badge.tier-forge { border-color: rgba(176, 138, 74, 0.5); color: var(--gold); }
/* "Mindsmen" app wordmark — ornate Decorative "M", Cinzel-bold rest.
   Used in the sidebar brand and the auth screens (matches the landing). */
.app-name { white-space: nowrap; }
.app-name .cap { font-family: var(--decorative); font-weight: 900; }
.app-name .rest { font-family: var(--display); font-weight: 700; }

.tier-badge.role-moderator { border-color: rgba(90, 114, 134, 0.8); color: var(--slate-soft); }
.tier-badge.role-admin { border-color: var(--gold); color: var(--gold); }
.tier-badge.status-banned { border-color: var(--crimson); color: var(--crimson-bright); background: rgba(159, 42, 42, 0.14); }
.tier-badge.status-muted { border-color: rgba(90, 114, 134, 0.8); color: var(--slate-soft); background: rgba(90, 114, 134, 0.12); }
/* Fire User — the consistency badge. Warm ember frame; the flame emoji keeps
   its own color. Clickable like every badge (opens its popover on tap). */
.tier-badge.fire-user {
  border-color: rgba(224, 122, 51, 0.7);
  color: var(--gold-bright);
  background: rgba(207, 126, 51, 0.14);
  gap: 4px;
  cursor: pointer;
}
/* Compact form for dense rows (chat author lines, online list): just the flame. */
.tier-badge.fire-user.fire-user-compact {
  padding: 2px 6px;
  gap: 0;
}

/* "You can moderate this member." note on the profile card */
.mod-hint {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

/* Width-fitting one-line headline (SVG text technique) */
.fit-line {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Drifting embers canvas (mounted by js/embers.js) */
.embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Faint film grain over everything — the "rough" Mindsman surface */
body.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Arc motif */
.arc-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
