/* Hog Worxs Labs portal. It sits on two stylesheets: the cjplans one (the
   signed-in app's building blocks) and the shared Hog Worxs theme (theme.css →
   brand/theme.css; the rules are in brand/THEME.md). This file only joins them:
   it points the cjplans tokens at the theme's, and lays out the signed-out
   screens like the public site. index.html pins data-theme="dark". */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--hx-bg);
  --bg-elev: #121312;
  --bg-elev-2: #191a19;
  --line: var(--hx-line);
  --text: var(--hx-ink);
  --text-dim: var(--hx-dim);
  --text-faint: var(--hx-faint);
  --card-border: var(--hx-line);
  --shadow-1: none;
  --press: rgba(236, 232, 223, 0.06);
  --accent: var(--hx-ink);
  --accent-2: var(--hx-dim);
  --grad: var(--hx-ink);
  /* Square corners, as everywhere in the theme. */
  --radius: 0px;
  --radius-sm: 0px;
  --radius-lg: 0px;
}

/* Everything sits above the starfield (theme.css: content at z-index 2). */
.app { position: relative; z-index: 2; }

.splash { background: radial-gradient(55% 45% at 50% 42%, var(--hx-pool), transparent 70%), var(--hx-bg); }
.splash-mark { filter: drop-shadow(0 0 28px var(--hx-glow)); animation: none; }
.splash-name { padding-left: 0.42em; font: 600 0.9rem / 1 var(--hx-mono); letter-spacing: 0.42em; text-transform: uppercase; }
.splash-spin { border-color: var(--hx-line); border-top-color: var(--hx-ink); }

/* ---- signed out: the public site's layout, with the form under the masthead */

.hx-auth-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 28px;
  padding:
    max(40px, env(safe-area-inset-top))
    max(var(--hx-gutter), env(safe-area-inset-right))
    max(36px, calc(env(safe-area-inset-bottom) + 28px))
    max(var(--hx-gutter), env(safe-area-inset-left));
}
.hx-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
/* Room for the form below: a smaller logo and title than the public site's. */
.hx-auth .hx-mark { height: clamp(120px, 24vh, 220px); -webkit-user-drag: none; }
.hx-auth .hx-title { margin-top: clamp(20px, 3.5vh, 32px); font-size: clamp(1rem, 4.6vw, 1.45rem); }
.hx-auth .hx-status { margin-bottom: clamp(22px, 4vh, 34px); }

/* "Tap your key": a brighter hairline that breathes until the key answers. */
.hx-tap {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--hx-line-hi);
  text-align: center;
}
.hx-tap.on { display: block; animation: hx-breathe 1.6s ease-in-out infinite; }
.hx-tap b {
  display: block;
  margin-bottom: 6px;
  font: 600 0.7rem / 1.2 var(--hx-mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--hx-ink);
}
.hx-tap span { font-size: 13px; line-height: 1.5; color: var(--hx-dim); }
@keyframes hx-breathe { 50% { border-color: var(--hx-line); } }

/* Toasts: square and hairline, in mono, like everything else. */
.toasts { bottom: calc(var(--sa-bottom) + 24px); }
.toast,
.toast.err,
.toast.ok {
  border-radius: 0;
  border-color: var(--hx-line-hi);
  background: color-mix(in srgb, var(--hx-bg) 92%, transparent);
  font: 500 0.78rem / 1.4 var(--hx-mono);
  letter-spacing: 0.04em;
}

/* ---- signed in --------------------------------------------------------- */

.appbar { background: color-mix(in srgb, var(--hx-bg) 80%, transparent); }
.appbar-title { padding-left: 0.32em; font: 600 0.8rem / 1 var(--hx-mono); letter-spacing: 0.32em; text-transform: uppercase; }
.appbar-sub { font: 400 0.66rem / 1.6 var(--hx-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hx-faint); }
.empty .hx-mark { height: 140px; margin: 0 auto; }
.btn.primary { background: var(--hx-ink); color: var(--hx-bg); box-shadow: none; }
.card { background: color-mix(in srgb, var(--hx-bg) 78%, transparent); }
.hx-mono { font-family: var(--hx-mono); letter-spacing: 0.2em; text-transform: uppercase; }

/* No tab bar yet, so the screen doesn't need to clear one. */
.screen { padding-bottom: calc(var(--sa-bottom) + 40px); }

@media (prefers-reduced-motion: reduce) { .hx-tap.on { animation: none; } }
