/* =========================================================
   HR Knowledge Desk — shared design tokens & base styles
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Color */
  --ink: #16232B;
  --ink-soft: #3C4A50;
  --paper: #EFF2F0;
  --paper-raised: #FAFBFA;
  --line: #D7DED9;
  --line-strong: #B9C4BE;
  --accent: #3C7268;       /* deep teal-sage — trust, calm */
  --accent-strong: #26504A;
  --accent-tint: #E1EBE7;
  --amber: #C98A3E;        /* warm highlight, CTAs / attention */
  --amber-tint: #F5E9D6;
  --danger: #B5473B;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --shadow-card: 0 1px 2px rgba(22,35,43,0.04), 0 8px 24px -12px rgba(22,35,43,0.14);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* Connective thread motif — the signature element that ties both
   screens together: documents in, answers out. */
.thread-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background-image: linear-gradient(var(--line-strong) 3px, transparent 3px);
  background-size: 2px 10px;
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 780px) {
  .thread-rail { display: none; }
}

/* ---------- Top nav shared across both screens ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(239, 242, 240, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
  background: var(--paper-raised);
  border-radius: 1px;
}
.brand-mark::before { width: 12px; height: 2px; top: 11px; left: 9px; }
.brand-mark::after { width: 2px; height: 12px; top: 9px; left: 14px; transform: rotate(20deg); transform-origin: bottom; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.active {
  background: var(--ink);
  color: var(--paper-raised);
}

/* ---------- Shared layout shell ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px 80px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h1.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

h1.page-title em {
  font-style: italic;
  color: var(--accent-strong);
}

.page-sub {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 54ch;
  line-height: 1.55;
  margin: 0 0 40px;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 11px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: var(--paper-raised);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { background: var(--paper-raised); }

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}

/* ---------- Toast / status line ---------- */
.status-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.dot.live { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-tint); }
.dot.err { background: var(--danger); }

/* ---------- Scrollbar tidy-up ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
