/* MOAAII - shared design system.
   Copyright (c) 2026 Spark Fire Technologies. */

:root {
  --ink: #0a0f18;
  --ink-2: #101827;
  --panel: #141d2c;
  --panel-2: #1b2637;
  --line: rgba(201, 162, 74, 0.22);
  --line-soft: rgba(226, 232, 240, 0.10);
  --text: #f2ede2;
  --text-dim: #a9b6c9;
  --text-faint: #6f7f95;
  --brass: #c9a24a;
  --brass-bright: #e6c069;
  --copper: #c07a4a;
  --verdigris: #7fbfa8;
  --crimson: #b4404f;
  --ok: #6fbf8e;
  --warn: #e0a03c;
  --danger: #d9534f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.page {
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(201, 162, 74, 0.13), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(127, 191, 168, 0.09), transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #070b12 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--brass-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, 1280px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }

/* ------------------------------------------------------------------ header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(8, 12, 20, 0.82);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid var(--brass);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--brass-bright);
  flex: none;
}

.brand-name { font-family: var(--serif); font-size: 1.12rem; letter-spacing: 0.06em; }
.brand-sub { font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.16em; text-transform: uppercase; }

.nav { display: flex; gap: 1.3rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-size: 0.92rem; }
.nav a:hover, .nav a.active { color: var(--brass-bright); text-decoration: none; }

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(201, 162, 74, 0.10);
  color: var(--brass-bright);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: rgba(201, 162, 74, 0.2); border-color: var(--brass); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--brass); color: #14100a; border-color: var(--brass); font-weight: 600; }
.btn-primary:hover { background: var(--brass-bright); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line-soft); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn-sm { padding: 0.32rem 0.75rem; font-size: 0.82rem; }
.btn-danger { color: #ffd9d6; border-color: rgba(217, 83, 79, 0.4); background: rgba(217, 83, 79, 0.14); }

input, select, textarea {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(6, 10, 18, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(201, 162, 74, 0.5); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.3rem; letter-spacing: 0.02em; }
.field + .field { margin-top: 0.85rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 190px; }
.row > .shrink { flex: 0 0 auto; }

/* ------------------------------------------------------------------ surfaces */

.card {
  background: linear-gradient(180deg, rgba(20, 29, 44, 0.92), rgba(13, 19, 30, 0.92));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card-tight { padding: 0.9rem; }
.card h3 { margin-bottom: 0.35rem; }

.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
}
.tag-brass { color: var(--brass-bright); border-color: var(--line); background: rgba(201, 162, 74, 0.1); }
.tag-ok { color: var(--ok); border-color: rgba(111, 191, 142, 0.35); background: rgba(111, 191, 142, 0.1); }
.tag-warn { color: var(--warn); border-color: rgba(224, 160, 60, 0.35); background: rgba(224, 160, 60, 0.1); }
.tag-danger { color: #ffb4ae; border-color: rgba(217, 83, 79, 0.4); background: rgba(217, 83, 79, 0.12); }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.6rem;
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 0.86rem; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.center { text-align: center; }
.hidden { display: none !important; }

/* A record's honesty line: what the museum does and does not hold. */
.provenance-note {
  border-left: 2px solid var(--line);
  padding: 0.45rem 0 0.45rem 0.85rem;
  font-size: 0.84rem;
  color: var(--text-dim);
  background: rgba(201, 162, 74, 0.04);
}

.placeholder-flag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint);
}
.placeholder-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* ------------------------------------------------------------------ artifact cards */

.artifact-card {
  display: flex; flex-direction: column;
  background: rgba(13, 19, 30, 0.85);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
  color: inherit;
}
.artifact-card:hover { border-color: var(--line); transform: translateY(-2px); text-decoration: none; }
.artifact-card img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  background: #0d1420; display: block;
}
.artifact-card .body { padding: 0.85rem 0.95rem 1rem; }
.artifact-card .title { font-family: var(--serif); font-size: 1rem; line-height: 1.35; margin-bottom: 0.2rem; }
.artifact-card .meta { font-size: 0.8rem; color: var(--text-faint); }

/* ------------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--text-faint); font-weight: 500; font-size: 0.76rem; letter-spacing: 0.09em; text-transform: uppercase; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* ------------------------------------------------------------------ feedback */

.toast-host { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; display: grid; gap: 0.5rem; max-width: 380px; }
.toast {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(16, 24, 39, 0.97);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: toast-in 0.18s ease-out;
}
.toast.err { border-color: rgba(217, 83, 79, 0.5); }
.toast.ok { border-color: rgba(111, 191, 142, 0.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-faint); border: 1px dashed var(--line-soft); border-radius: var(--radius); }

.footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 0.84rem;
}
.footer strong { color: var(--text-dim); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
