/* Atelier — velith's editorial design system, web expression.
   Mirrors mobile/lib/design/tokens.dart: warm-ink canvas, one bronze accent,
   Fraunces for display, Inter for UI. Served at /atelier.css and shared by the
   landing page, dashboard, and legal pages. */

:root {
  --bg: #14110d;
  --surface: #1b1712;
  --surface-hi: #221c16;
  --sunken: #0c0a07;
  --hairline: #352c22;
  --ink: #f1e9dc;
  --ink-soft: #d2c8b6;
  --mute: #9a8e7a;
  --bronze: #cb9b55;
  --bronze-deep: #a9793c;
  --bronze-soft: #3a2e1b;
  --ok: #93ae6c;
  --warn: #d7a44a;
  --danger: #cc6f5c;

  /* Noto Sans CJK leads the sans stack so Hangul never falls back to a system
     face. The local desktop name comes first, then the Google Fonts family the
     pages load. Headings keep Fraunces — it carries no Hangul, so Korean drops
     through to Noto Serif KR on its own. */
  --serif: "Fraunces", "Noto Serif CJK KR", "Noto Serif KR", "Iowan Old Style", Georgia, serif;
  --sans: "Noto Sans CJK KR", "Noto Sans KR", "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --pagew: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

a { color: var(--bronze); text-decoration: none; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- brand mark: the four-point spark ---- */
.spark {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.1em;
  flex: none;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-weight: 600; font-size: 21px;
  color: var(--ink); letter-spacing: -0.02em;
}

/* ---- primitives ---- */
.eyebrow {
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow.accent { color: var(--bronze); }

.card {
  background: var(--surface-hi);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 18px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--sans);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--bronze); color: #14110d; }
.btn-primary:hover { background: #d9ab63; color: #14110d; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--bronze-deep); color: var(--ink); }
.btn-quiet { background: var(--bronze-soft); color: var(--bronze); }
.btn-quiet:hover { color: #e9cb95; }
.btn[disabled] { opacity: 0.5; cursor: default; }

input, textarea, select {
  width: 100%;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  padding: 11px 13px;
}
input::placeholder, textarea::placeholder { color: var(--mute); }
input:focus, textarea:focus, select:focus {
  border-color: var(--bronze);
  outline: none;
}
textarea { resize: vertical; min-height: 96px; }
label { display: block; font: 500 12px/1.4 var(--sans); color: var(--mute); margin: 12px 0 5px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 11px/1 var(--sans);
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid;
}
.pill-bronze { color: var(--bronze); border-color: rgba(203, 155, 85, 0.4); background: rgba(203, 155, 85, 0.12); }
.pill-ok { color: var(--ok); border-color: rgba(147, 174, 108, 0.4); background: rgba(147, 174, 108, 0.1); }
.pill-mute { color: var(--mute); border-color: var(--hairline); background: var(--surface); }

hr.rule { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

/* ---- the signature: threshold gauge ----
   A bucket filling toward its trigger. The tick is the rule's threshold; the
   fill is real node count on the dashboard, animated on the landing page. */
.gauge { position: relative; height: 8px; border-radius: 999px; background: var(--sunken); overflow: visible; }
.gauge-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bronze-deep), var(--bronze));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge-fill.over { background: linear-gradient(90deg, var(--bronze), var(--ok)); }
.gauge-tick {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px; border-radius: 2px;
  background: var(--ink-soft);
  opacity: 0.7;
}
.gauge-tick::after {
  content: attr(data-label);
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font: 600 10px/1 var(--sans); letter-spacing: 0.06em;
  color: var(--mute); white-space: nowrap;
}

/* ---- stats ---- */
.stat .n { font: 500 30px/1 var(--serif); color: var(--ink); letter-spacing: -0.02em; }
.stat .l { margin-top: 5px; font: 600 10.5px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }

/* ---- utility ---- */
.muted { color: var(--mute); }
.soft { color: var(--ink-soft); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }
