/* Crystalix design tokens and shared components ("Control Room" style). */
:root {
  --bg: #f5f4f1; --surface: #ffffff; --surface-2: #eeece7;
  --ink: #17140f; --ink-soft: #57524a; --ink-faint: #8f8a7d;
  --line: #d9d4c9; --line-strong: #17140f;
  --invert-ink: #f5f4f1;
  --danger: #8a3b2e; --ok: #3a5a3a;
  --grad: linear-gradient(90deg, #3d4ff2, #8b3fe0, #e85fd0);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --surface: #1a1815; --surface-2: #211f1b;
    --ink: #f1ede4; --ink-soft: #b6afa0; --ink-faint: #7c7568;
    --line: #332e27; --line-strong: #f1ede4;
    --invert-ink: #121110;
    --danger: #d98a78; --ok: #8fc28f;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121110; --surface: #1a1815; --surface-2: #211f1b;
  --ink: #f1ede4; --ink-soft: #b6afa0; --ink-faint: #7c7568;
  --line: #332e27; --line-strong: #f1ede4;
  --invert-ink: #121110;
  --danger: #d98a78; --ok: #8fc28f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Logo + wordmark + gradient rule */
.mark { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mark img { width: 24px; height: 24px; }
.mark span { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.markline { height: 2px; width: 48px; background: var(--grad); }

/* Buttons */
.btn {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: .03em;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .85; }
.btn.quiet { border-color: var(--line); color: var(--ink-soft); }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--invert-ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: none; color: var(--ink); }

button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Form fields */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  padding: 9px 11px;
  font-size: 13.5px;
}
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--ink-soft); }

.card { border: 1px solid var(--line); background: var(--surface); }

/* Flowing gradient background (see fluid.js). The blurred blobs are the
   fallback when WebGL is unavailable. */
#fluidbg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
#fluidbg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fluidbg span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .6; }
#fluidbg .b1 { width: 70vw; height: 70vw; left: -18vw; top: -22vw; background: radial-gradient(circle, #3d4ff2 0%, transparent 78%); animation: fluid1 26s ease-in-out infinite alternate; }
#fluidbg .b2 { width: 64vw; height: 64vw; right: -20vw; top: -4vw; background: radial-gradient(circle, #8b3fe0 0%, transparent 78%); animation: fluid2 32s ease-in-out infinite alternate; }
#fluidbg .b3 { width: 68vw; height: 68vw; left: 10vw; bottom: -28vw; background: radial-gradient(circle, #e85fd0 0%, transparent 78%); animation: fluid1 22s ease-in-out infinite alternate-reverse; }
#fluidbg .b4 { width: 50vw; height: 50vw; left: -10vw; top: 24vw; background: radial-gradient(circle, #2fa9e0 0%, transparent 78%); animation: fluid2 24s ease-in-out infinite alternate-reverse; }
@keyframes fluid1 { 50% { transform: translate(6vw, 8vw) scale(1.12); } 100% { transform: translate(-4vw, 4vw) scale(.94); } }
@keyframes fluid2 { 50% { transform: translate(-8vw, 6vw) scale(.9); } 100% { transform: translate(4vw, -6vw) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  #fluidbg span { animation: none; }
}
