/* Lair base styles: reset, type, buttons and fields. Uses only tokens.css variables.
   Same shapes and motion as the Hub (pill buttons, soft focus rings, spring presses); respects reduced motion. */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px / 1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Film grain + a warm glow behind everything (fixed, painted once). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  pointer-events: none;
  top: -35vh;
  right: -15vw;
  width: 75vw;
  height: 80vh;
  background: radial-gradient(closest-side, var(--glow), transparent);
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 650;
}
p {
  margin: 0;
}
img,
svg {
  max-width: 100%;
}
::selection {
  background: var(--accent);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--text-3);
}
.dim {
  color: var(--text-2);
}
.display {
  font-family: var(--display);
  letter-spacing: -0.03em;
}
.hidden {
  display: none !important;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 0.25s var(--spring),
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.3s var(--ease),
    color 0.2s;
}
.btn:hover {
  border-color: var(--text-3);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-text);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.7);
}
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px var(--accent);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn.sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

/* ---------- fields ---------- */
.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.25s var(--ease),
    background-color 0.2s;
}
.input:hover {
  border-color: var(--text-3);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input::placeholder {
  color: var(--text-3);
}

@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;
  }
}
