/* Noduma chat and legal pages (SPEC-010 R7, SPEC-049). The :root tokens,
   network.js and favicon.svg are copies of the homepage's
   (web/homepage/site); TestWebDesignMatchesHomepage keeps them equal. */
:root {
  --bg: #07090d;
  --fg: #eef2f7;
  --muted: #94a0b4;
  --line: rgba(148, 160, 180, .16);
  --card: rgba(17, 22, 31, .62);
  --teal: #2dd4bf;
  --indigo: #818cf8;
  --pink: #f472b6;
  --grad: linear-gradient(100deg, var(--teal) 0%, var(--indigo) 55%, var(--pink) 100%);
  --radius: 18px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: rgba(148, 160, 180, .12); padding: .1em .4em; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: #f87171; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Background, as on the homepage but quieter behind the chat. */
#network { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: .55; }
.glow { position: fixed; z-index: -1; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(120px); opacity: .1; pointer-events: none; }
.glow-a { background: var(--teal); top: -30vmax; left: -18vmax; animation: drift 22s ease-in-out infinite alternate; }
.glow-b { background: var(--indigo); bottom: -34vmax; right: -20vmax; animation: drift 26s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* Navigation */
.nav {
  position: sticky; top: 14px; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  width: min(960px, calc(100% - 32px)); margin: 14px auto 0; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(7, 9, 13, .55); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.brand:hover { text-decoration: none; }
.tagline { color: var(--muted); font-size: 14px; }
.nav-action { margin-left: auto; padding: 8px 16px; font-size: 14px; }
.nav-action:hover { text-decoration: none; }
.credits { margin-left: auto; font: 600 13px var(--mono); color: var(--teal); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font: 600 15px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  border: 1px solid var(--line); color: var(--fg); cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.btn-primary {
  color: #04120f; border: 0;
  /* A seamless loop: the gradient's two halves are equal, so moving it by
     its own width never shows a seam. */
  background: linear-gradient(100deg, var(--teal), #7dd3fc 25%, var(--indigo) 50%, #7dd3fc 75%, var(--teal));
  background-size: 200% 100%; animation: sheen 6s linear infinite;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, .4), 0 10px 40px -10px rgba(45, 212, 191, .7);
}
@keyframes sheen { from { background-position: 0% 0; } to { background-position: 200% 0; } }
/* Visible keyboard focus on every link and button (UX review 2026-11-25). */
a:focus-visible, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.btn-ghost { background: rgba(148, 160, 180, .08); }
.btn-ghost:hover { background: rgba(148, 160, 180, .16); }

/* Cards */
main { flex: 1; width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 0; }
.card {
  padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; letter-spacing: -.03em; }

/* Forms */
form { display: flex; gap: 10px; align-items: flex-end; }
input, textarea, select {
  flex: 1; font: inherit; color: var(--fg); padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(7, 9, 13, .6);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: rgba(45, 212, 191, .6); box-shadow: 0 0 0 3px rgba(45, 212, 191, .15); }
textarea { resize: vertical; }
select { flex: none; padding: 8px 12px; margin-left: 8px; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.bar label { color: var(--muted); font-size: 14px; margin-right: auto; }
.bar .btn { padding: 8px 16px; font-size: 14px; }

/* Conversation */
#log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(7, 9, 13, .55); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 85%; background: linear-gradient(135deg, rgba(45, 212, 191, .16), rgba(129, 140, 248, .16)); border-color: rgba(45, 212, 191, .3); }
.msg.assistant { align-self: stretch; }
.msg.error { color: #f87171; border-color: rgba(248, 113, 113, .4); }
.msg .meta { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
.msg .dev { font-family: var(--mono); color: var(--teal); margin-top: 2px; }

/* Legal pages (SPEC-049 R2). */
.doc { line-height: 1.7; }
.doc h1 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -.03em; }
.doc h2 { margin: 32px 0 10px; font-size: 21px; letter-spacing: -.015em; }
.doc p, .doc li { color: #cfd6e2; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc blockquote { margin: 0 0 24px; padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(244, 114, 182, .4); background: rgba(244, 114, 182, .08); color: var(--fg); }
.doc blockquote p { margin: 0; color: var(--fg); }
.doc .table { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 600; }

footer {
  display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: space-between; align-items: center;
  width: min(960px, calc(100% - 32px)); margin: 56px auto 0; padding: 24px 0 36px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { color: inherit; display: inline-block; padding: 4px 0; } /* at least 24px to tap */
footer a:hover { color: var(--fg); text-decoration: none; }

@media (max-width: 700px) {
  .tagline { display: none; }
  main { padding-top: 24px; }
  .card { padding: 20px; }
  form { flex-direction: column; align-items: stretch; }
  .msg.user { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn-primary { animation: none !important; }
}
