/* =========================================================================
   WANDERING SWORD BUILDS — DESIGN TOKENS
   Theme: ink, rice paper, and the vermillion seal — not "fantasy gold glow."
   ========================================================================= */

:root {
  /* Palette */
  --ink-black: #1a1410;       /* lacquer / deep background */
  --ink-soft: #2b2118;        /* secondary panels, ink-brown */
  --paper: #f4ecd8;           /* aged rice paper */
  --paper-dim: #e8dcc0;       /* paper in shadow / disabled */
  --seal: #8b2635;            /* cinnabar / seal-stamp vermillion */
  --seal-bright: #b13347;     /* hover state of seal red */
  --brass: #c9a961;           /* muted brass, used sparingly */
  --jade: #4a5d4e;            /* rare accent, lightness/cultivation */
  --jade-bright: #6b8870;

  /* Type */
  --font-display: "Noto Serif TC", "EB Garamond", serif;
  --font-body: "EB Garamond", serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Texture */
  --paper-texture: radial-gradient(circle at 20% 20%, rgba(0,0,0,0.02) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.02) 0%, transparent 50%);

  /* Elevation */
  --shadow-card: 0 12px 40px rgba(0,0,0,0.45);
  --shadow-deep: 0 24px 70px rgba(0,0,0,0.6);

  --radius-card: 4px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-black);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(139,38,53,0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(74,93,78,0.05) 0%, transparent 40%);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

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

/* Visible focus state, always */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

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

/* =========================================================================
   SHARED: SEAL STAMP (signature element)
   A carved vermillion chop-mark. Appears on saved build cards, and
   "stamps" itself with a press animation when a build is sealed.
   ========================================================================= */
.seal-stamp {
  --seal-size: 56px;
  width: var(--seal-size);
  height: var(--seal-size);
  border-radius: 6px;
  background: var(--seal);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 2px rgba(244,236,216,0.25),
    0 4px 10px rgba(0,0,0,0.4);
  transform: rotate(-4deg);
}

.seal-stamp::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(244,236,216,0.35);
  border-radius: 3px;
}

.seal-stamp .seal-glyph {
  font-family: var(--font-display);
  color: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
}

.seal-stamp.texture-worn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background-image:
    radial-gradient(circle at 30% 30%, transparent 60%, rgba(0,0,0,0.15) 100%),
    radial-gradient(circle at 70% 70%, transparent 55%, rgba(244,236,216,0.06) 100%);
  mix-blend-mode: multiply;
}

@keyframes stampPress {
  0%   { transform: rotate(-4deg) scale(2.4); opacity: 0; }
  55%  { transform: rotate(-4deg) scale(0.92); opacity: 1; }
  75%  { transform: rotate(-4deg) scale(1.06); }
  100% { transform: rotate(-4deg) scale(1); }
}

.seal-stamp.animate-press {
  animation: stampPress 0.6s cubic-bezier(.2,.9,.3,1.1);
}

/* Utility */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
