@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap");

:root,
[data-theme="light"] {
  --bg: #f3ede4;
  --bg-panel: #faf7f3;
  --text: #1c1713;
  --muted: #7a6f63;
  --accent: #604535;
  --accent-hover: #3d2c1f;
  --danger: #8f3220;
  --warning: #7a5718;
  --success: #3a5e2e;
  --border: #ddd3c5;
  --overlay: rgba(28, 23, 19, 0.4);
  --text-on-accent: #fff;
  --status-online: #43b581;
  --status-offline: #747f8d;
  --status-idle: #faa61a;
  --status-dnd: #f04747;
  --discord-brand: #5865f2;
  --discord-brand-hover: #4752c4;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;
  --line-1: 1px;
  --line-2: 2px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --shadow-1: 0 1px 3px rgba(28, 23, 19, 0.12);
  --shadow-2: 0 4px 8px rgba(28, 23, 19, 0.16);
  --shadow-3: 0 8px 16px rgba(28, 23, 19, 0.2);
  --motion-fast: 150ms ease;
  --motion-medium: 250ms ease;
  --font-body-sm: 400 0.875rem / 1.5 "Instrument Sans", sans-serif;
  --font-body-lg: 400 1rem / 1.5 "Instrument Sans", sans-serif;
  --font-title: 600 1.125rem / 1.3 "Instrument Sans", sans-serif;
  --font-heading: 700 1.5rem / 1.2 "Instrument Sans", sans-serif;
  --font-label: 500 0.75rem / 1.3 "Instrument Sans", sans-serif;

  /* z-index scale */
  --z-reaction-bar: 5;
  --z-reaction-actions: 10;
  --z-topbar: 10;
  --z-dropdown: 20;
  --z-gif-panel: 30;
  --z-modal-overlay: 100;
  --z-popup: 200;
  --z-context-menu: 200;
  --z-modal-content: 250;
  --z-lightbox: 300;
}

[data-theme="dark"] {
  --bg: #1a1614;
  --bg-panel: #231f1c;
  --text: #e8e0d6;
  --muted: #9a8e82;
  --accent: #c49a7c;
  --accent-hover: #dab49a;
  --danger: #d4644e;
  --warning: #c4943a;
  --success: #6aae54;
  --border: #3a332e;
  --overlay: rgba(0, 0, 0, 0.5);
  --text-on-accent: #fff;
  --status-online: #43b581;
  --status-offline: #747f8d;
  --status-idle: #faa61a;
  --status-dnd: #f04747;
  --discord-brand: #5865f2;
  --discord-brand-hover: #4752c4;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

main {
  padding: 1.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.topnav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.topnav a.active,
.topnav a:hover {
  color: var(--text);
  text-decoration: none;
}

.panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--accent);
  color: var(--bg-panel);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: var(--bg-panel);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  color: var(--text);
}

.field {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  -webkit-appearance: none;
  appearance: none;
}

.field:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.field::placeholder {
  color: var(--muted);
}

.entity-list,
.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.entity-item:last-child {
  border-bottom: none;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}

.status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.status-loading {
  color: var(--warning);
}

.status-error {
  color: var(--danger);
}

.status-success {
  color: var(--success);
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-footer {
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-links a:hover {
  color: var(--text);
}

/* ── Reduced motion ─────────────────────────────────── */

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

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.info-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.info-panel {
  padding: 2rem 2.5rem;
}

.info-panel h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.info-panel .info-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.info-panel h2 {
  margin: 1.75rem 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.info-panel p {
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.65;
}

.info-panel ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--text);
  line-height: 1.65;
}

.info-panel li {
  margin-bottom: 0.35rem;
}

@media (max-width: 760px) {
  main {
    padding: 1rem;
  }

  .topbar {
    padding: 0.875rem 1rem;
  }
}
