/* HH Radar demo: same design tokens and components as the product (HH radar/templates/base.html) */
:root {
  --bg: 246 245 240; --panel: 255 255 255; --raised: 239 238 232;
  --ink: 24 27 24; --muted: 92 99 92; --faint: 140 146 139; --line: 24 27 24;
  --accent: 77 124 15; --accent-ink: 255 255 255; --accent-soft: 236 245 214;
  --good: 21 128 61; --warn: 180 83 9; --bad: 190 18 60; --info: 3 105 161;
  --line-a: .11; --shadow: 0 1px 2px rgb(24 27 24 / .06), 0 8px 24px -12px rgb(24 27 24 / .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: 12 14 13; --panel: 19 22 20; --raised: 27 31 28;
    --ink: 230 235 228; --muted: 150 158 150; --faint: 101 109 102; --line: 230 235 228;
    --accent: 190 242 100; --accent-ink: 16 22 6; --accent-soft: 38 50 20;
    --good: 134 239 172; --warn: 252 211 77; --bad: 253 164 175; --info: 125 211 252;
    --line-a: .09; --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 12px 32px -16px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: 12 14 13; --panel: 19 22 20; --raised: 27 31 28;
  --ink: 230 235 228; --muted: 150 158 150; --faint: 101 109 102; --line: 230 235 228;
  --accent: 190 242 100; --accent-ink: 16 22 6; --accent-soft: 38 50 20;
  --good: 134 239 172; --warn: 252 211 77; --bad: 253 164 175; --info: 125 211 252;
  --line-a: .09; --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 12px 32px -16px rgb(0 0 0 / .6);
  color-scheme: dark;
}

body { background: rgb(var(--bg)); color: rgb(var(--ink)); font-feature-settings: "ss01", "cv11"; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hairline { border-color: rgb(var(--line) / var(--line-a)); }
.panel { background: rgb(var(--panel)); border: 1px solid rgb(var(--line) / var(--line-a)); border-radius: 18px; box-shadow: var(--shadow); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--faint)); font-weight: 600; }

.grid-bg {
  background-image:
    radial-gradient(circle at 0 0, rgb(var(--accent) / .07), transparent 40rem),
    linear-gradient(rgb(var(--line) / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--line) / .035) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .8rem; border-radius: 10px;
       font-size: 13px; font-weight: 500; color: rgb(var(--ink)); background: rgb(var(--raised));
       border: 1px solid rgb(var(--line) / var(--line-a)); transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: rgb(var(--line) / .25); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .seg a:focus-visible, .field:focus { outline: 2px solid rgb(var(--accent) / .6); outline-offset: 2px; }
.btn-icon { width: 34px; padding: 0; justify-content: center; font-size: 15px; }
.btn-primary { background: rgb(var(--accent)); color: rgb(var(--accent-ink)); border-color: transparent; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgb(var(--raised)); }
.btn-danger { color: rgb(var(--bad)); }
.btn.is-fav { color: rgb(var(--warn)); border-color: rgb(var(--warn) / .4); background: rgb(var(--warn) / .1); }
.btn.is-applied { color: rgb(var(--good)); border-color: rgb(var(--good) / .4); background: rgb(var(--good) / .1); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Form fields */
.field { height: 36px; width: 100%; padding: 0 .75rem; border-radius: 10px; font-size: 13.5px; color: rgb(var(--ink));
         background: rgb(var(--bg)); border: 1px solid rgb(var(--line) / var(--line-a)); }
.field::placeholder { color: rgb(var(--faint)); }
.field:disabled { opacity: .6; }
textarea.field { height: auto; padding: .7rem .8rem; line-height: 1.55; }
select.field { padding-right: 2rem; }
.label { display: block; font-size: 12px; color: rgb(var(--muted)); margin-bottom: .3rem; }

/* Chips & tags */
.chip { display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .7rem; border-radius: 999px; font-size: 12.5px;
        color: rgb(var(--muted)); border: 1px solid rgb(var(--line) / var(--line-a)); background: rgb(var(--panel)); white-space: nowrap; transition: all .15s; cursor: pointer; }
.chip:hover { color: rgb(var(--ink)); border-color: rgb(var(--line) / .25); }
.chip.is-on { color: rgb(var(--ink)); background: rgb(var(--accent-soft)); border-color: rgb(var(--accent) / .55); }
.chip .num { font-size: 11px; color: rgb(var(--faint)); }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 6px; font-size: 11.5px; line-height: 1.4;
       color: rgb(var(--muted)); background: rgb(var(--raised)); }
.tag-accent { color: rgb(var(--ink)); background: rgb(var(--accent-soft)); }
.src { font-family: "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: .1rem .4rem; border-radius: 5px; border: 1px solid; }
.src-hh { color: #e5484d; border-color: rgb(229 72 77 / .35); }
.src-trudvsem { color: rgb(var(--info)); border-color: rgb(var(--info) / .35); }
.src-habr { color: #3fb8a8; border-color: rgb(63 184 168 / .35); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgb(var(--raised)); border: 1px solid rgb(var(--line) / var(--line-a)); }
.seg a { display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .75rem; border-radius: 9px; font-size: 13px; color: rgb(var(--muted)); white-space: nowrap; cursor: pointer; }
.seg a:hover { color: rgb(var(--ink)); }
.seg a.is-on { background: rgb(var(--panel)); color: rgb(var(--ink)); box-shadow: var(--shadow); font-weight: 500; }
.seg .num { font-size: 11px; color: rgb(var(--faint)); }

/* Score ring */
.ring { --c: var(--faint); --s: 46px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%;
        background: conic-gradient(rgb(var(--c)) calc(var(--p, 0) * 1%), rgb(var(--line) / .1) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgb(var(--panel)); }
.ring > span { position: relative; font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: calc(var(--s) * .32); color: rgb(var(--ink)); }
.ring-hot { --c: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent) / .08), 0 0 22px -2px rgb(var(--accent) / .35); }
.ring-good { --c: var(--good); }
.ring-mid { --c: var(--warn); }
.ring-low { --c: var(--bad); }
.ring-low > span, .ring-none > span { color: rgb(var(--muted)); }
.ring-lg { --s: 92px; }
.ring-lg::before { inset: 7px; }

/* Vacancy card */
.vcard { position: relative; transition: border-color .15s, transform .25s, opacity .25s; }
.vcard:hover { border-color: rgb(var(--line) / .22); }
.vcard.is-viewed .vtitle { color: rgb(var(--muted)); }
.vcard.is-leaving { opacity: 0; transform: translateX(16px); }
.vtitle:hover { color: rgb(var(--accent)); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Nav */
.nav a { display: flex; align-items: center; gap: .7rem; height: 38px; padding: 0 .75rem; border-radius: 10px; font-size: 14px; color: rgb(var(--muted)); white-space: nowrap; }
.nav a:hover { color: rgb(var(--ink)); background: rgb(var(--raised)); }
.nav a.is-on { color: rgb(var(--ink)); background: rgb(var(--raised)); font-weight: 500; }
.nav a.is-on .nav-dot { background: rgb(var(--accent)); box-shadow: 0 0 10px rgb(var(--accent) / .7); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--line) / .2); flex: none; }

/* Status dots */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: rgb(var(--faint)); }
.dot-ok { background: rgb(var(--good)); box-shadow: 0 0 8px rgb(var(--good) / .6); }
.dot-err { background: rgb(var(--bad)); box-shadow: 0 0 8px rgb(var(--bad) / .6); }
.dot-busy { background: rgb(var(--warn)); animation: pulse 1.6s ease-in-out infinite; }

/* Radar logo sweep */
.sweep { transform-origin: 16px 16px; animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sweep, .dot-busy { animation: none; } }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
::selection { background: rgb(var(--accent) / .35); }

/* Demo-only bits */
.demo-strip { background: rgb(var(--accent-soft)); border: 1px solid rgb(var(--accent) / .35); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 60;
         max-width: calc(100vw - 32px); padding: .65rem 1rem; border-radius: 12px; font-size: 13px;
         background: rgb(var(--ink)); color: rgb(var(--bg)); box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.masked { filter: blur(3.5px); user-select: none; }
